[][Upgrade kernel version from 5.4.236 to 5.4.246]

[Description]
Fix fs/ubifs/dir.c confilct in 999-2380-fix-dirty-race-between-do_tmpfile.patch
Change kernel version and hash in 201-change_kernel_version_and_hash_due_to_upgrading_from_5.4.238_to_5.4.246.patch
Remove patch because kernel has merge patch in 202-fix-patch-conflict-due_to_upgrading_from_5.4.238_to_5.4.246.patch

[Release-log]

Change-Id: I4e419ac395ea2229d26b0c9f4b2a5145d96095b8
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/7648993
diff --git a/openwrt_patches-21.02/201-change_kernel_version_and_hash_due_to_upgrading_from_5.4.238_to_5.4.246.patch b/openwrt_patches-21.02/201-change_kernel_version_and_hash_due_to_upgrading_from_5.4.238_to_5.4.246.patch
new file mode 100644
index 0000000..c54b0d6
--- /dev/null
+++ b/openwrt_patches-21.02/201-change_kernel_version_and_hash_due_to_upgrading_from_5.4.238_to_5.4.246.patch
@@ -0,0 +1,7 @@
+--- a/include/kernel-5.4
++++ b/include/kernel-5.4
+@@ -1,2 +1,2 @@
+-LINUX_VERSION-5.4 = .238
+-LINUX_KERNEL_HASH-5.4.238 = 70a2b2da85598eba6a73cdc0749e441cbdf3011d9babcb7028a46aa8d98aa91f
++LINUX_VERSION-5.4 = .246
++LINUX_KERNEL_HASH-5.4.246 = 0938790a858fd0af6aa6b27a3bdf4c5d4a46aba60e6178156980d58bef7ed9ea
diff --git a/openwrt_patches-21.02/202-fix-patch-conflict-due_to_upgrading_from_5.4.238_to_5.4.246.patch b/openwrt_patches-21.02/202-fix-patch-conflict-due_to_upgrading_from_5.4.238_to_5.4.246.patch
new file mode 100644
index 0000000..cf27e86
--- /dev/null
+++ b/openwrt_patches-21.02/202-fix-patch-conflict-due_to_upgrading_from_5.4.238_to_5.4.246.patch
@@ -0,0 +1,72 @@
+--- a/target/linux/generic/backport-5.4/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch
++++ b/target/linux/generic/backport-5.4/430-v6.3-ubi-Fix-failure-attaching-when-vid_hdr-offset-equals.patch
+@@ -1,69 +0,0 @@
+-From 1e020e1b96afdecd20680b5b5be2a6ffc3d27628 Mon Sep 17 00:00:00 2001
+-From: Zhihao Cheng <chengzhihao1@huawei.com>
+-Date: Mon, 6 Mar 2023 09:33:08 +0800
+-Subject: [PATCH] ubi: Fix failure attaching when vid_hdr offset equals to
+- (sub)page size
+-
+-Following process will make ubi attaching failed since commit
+-1b42b1a36fc946 ("ubi: ensure that VID header offset ... size"):
+-
+-ID="0xec,0xa1,0x00,0x15" # 128M 128KB 2KB
+-modprobe nandsim id_bytes=$ID
+-flash_eraseall /dev/mtd0
+-modprobe ubi mtd="0,2048"  # set vid_hdr offset as 2048 (one page)
+-(dmesg):
+-  ubi0 error: ubi_attach_mtd_dev [ubi]: VID header offset 2048 too large.
+-  UBI error: cannot attach mtd0
+-  UBI error: cannot initialize UBI, error -22
+-
+-Rework original solution, the key point is making sure
+-'vid_hdr_shift + UBI_VID_HDR_SIZE < ubi->vid_hdr_alsize',
+-so we should check vid_hdr_shift rather not vid_hdr_offset.
+-Then, ubi still support (sub)page aligined VID header offset.
+-
+-Fixes: 1b42b1a36fc946 ("ubi: ensure that VID header offset ... size")
+-Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
+-Tested-by: Nicolas Schichan <nschichan@freebox.fr>
+-Tested-by: Miquel Raynal <miquel.raynal@bootlin.com> # v5.10, v4.19
+-Signed-off-by: Richard Weinberger <richard@nod.at>
+----
+- drivers/mtd/ubi/build.c | 21 +++++++++++++++------
+- 1 file changed, 15 insertions(+), 6 deletions(-)
+-
+---- a/drivers/mtd/ubi/build.c
+-+++ b/drivers/mtd/ubi/build.c
+-@@ -644,12 +644,6 @@ static int io_init(struct ubi_device *ub
+- 	ubi->ec_hdr_alsize = ALIGN(UBI_EC_HDR_SIZE, ubi->hdrs_min_io_size);
+- 	ubi->vid_hdr_alsize = ALIGN(UBI_VID_HDR_SIZE, ubi->hdrs_min_io_size);
+- 
+--	if (ubi->vid_hdr_offset && ((ubi->vid_hdr_offset + UBI_VID_HDR_SIZE) >
+--	    ubi->vid_hdr_alsize)) {
+--		ubi_err(ubi, "VID header offset %d too large.", ubi->vid_hdr_offset);
+--		return -EINVAL;
+--	}
+--
+- 	dbg_gen("min_io_size      %d", ubi->min_io_size);
+- 	dbg_gen("max_write_size   %d", ubi->max_write_size);
+- 	dbg_gen("hdrs_min_io_size %d", ubi->hdrs_min_io_size);
+-@@ -667,6 +661,21 @@ static int io_init(struct ubi_device *ub
+- 						ubi->vid_hdr_aloffset;
+- 	}
+- 
+-+	/*
+-+	 * Memory allocation for VID header is ubi->vid_hdr_alsize
+-+	 * which is described in comments in io.c.
+-+	 * Make sure VID header shift + UBI_VID_HDR_SIZE not exceeds
+-+	 * ubi->vid_hdr_alsize, so that all vid header operations
+-+	 * won't access memory out of bounds.
+-+	 */
+-+	if ((ubi->vid_hdr_shift + UBI_VID_HDR_SIZE) > ubi->vid_hdr_alsize) {
+-+		ubi_err(ubi, "Invalid VID header offset %d, VID header shift(%d)"
+-+			" + VID header size(%zu) > VID header aligned size(%d).",
+-+			ubi->vid_hdr_offset, ubi->vid_hdr_shift,
+-+			UBI_VID_HDR_SIZE, ubi->vid_hdr_alsize);
+-+		return -EINVAL;
+-+	}
+-+
+- 	/* Similar for the data offset */
+- 	ubi->leb_start = ubi->vid_hdr_offset + UBI_VID_HDR_SIZE;
+- 	ubi->leb_start = ALIGN(ubi->leb_start, ubi->min_io_size);
diff --git a/target/linux/mediatek/patches-5.4/999-2380-fix-dirty-race-between-do_tmpfile.patch b/target/linux/mediatek/patches-5.4/999-2380-fix-dirty-race-between-do_tmpfile.patch
index 63943f8..cece259 100644
--- a/target/linux/mediatek/patches-5.4/999-2380-fix-dirty-race-between-do_tmpfile.patch
+++ b/target/linux/mediatek/patches-5.4/999-2380-fix-dirty-race-between-do_tmpfile.patch
@@ -45,7 +45,7 @@
  static int do_tmpfile(struct inode *dir, struct dentry *dentry,
  		      umode_t mode, struct inode **whiteout)
  {
-@@ -364,7 +390,7 @@ static int do_tmpfile(struct inode *dir, struct dentry *dentry,
+@@ -364,7 +390,7 @@ static int do_tmpfile(struct inode *dir,
  	struct ubifs_budget_req req = { .new_ino = 1, .new_dent = 1,
  					.dirtied_ino = 1};
  	struct ubifs_budget_req ino_req = { .dirtied_ino = 1 };
@@ -54,7 +54,7 @@
  	int err, instantiated = 0;
  	struct fscrypt_name nm;
  
-@@ -426,18 +452,18 @@ static int do_tmpfile(struct inode *dir, struct dentry *dentry,
+@@ -426,11 +452,11 @@ static int do_tmpfile(struct inode *dir,
  	instantiated = 1;
  	mutex_unlock(&ui->ui_mutex);
  
@@ -67,7 +67,8 @@
 +	unlock_2_inodes(dir, inode);
  
  	ubifs_release_budget(c, &req);
- 
+ 	fscrypt_free_filename(&nm);
+@@ -438,7 +464,7 @@ static int do_tmpfile(struct inode *dir,
  	return 0;
  
  out_cancel:
@@ -76,7 +77,7 @@
  out_inode:
  	make_bad_inode(inode);
  	if (!instantiated)
-@@ -672,32 +698,6 @@ static int ubifs_dir_release(struct inode *dir, struct file *file)
+@@ -673,32 +699,6 @@ static int ubifs_dir_release(struct inod
  	return 0;
  }