]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Apr 2022 11:45:32 +0000 (13:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 3 Apr 2022 11:45:32 +0000 (13:45 +0200)
added patches:
ubifs-add-missing-iput-if-do_tmpfile-failed-in-rename-whiteout.patch
ubifs-setflags-make-dirtied_ino_d-8-bytes-aligned.patch

queue-4.9/series
queue-4.9/ubifs-add-missing-iput-if-do_tmpfile-failed-in-rename-whiteout.patch [new file with mode: 0644]
queue-4.9/ubifs-setflags-make-dirtied_ino_d-8-bytes-aligned.patch [new file with mode: 0644]

index 6206e9b25aba5dd5589ae85c17621e0b8930e2da..63d2fe9c6546ed49f3d3bff99a78ccc601281996 100644 (file)
@@ -148,3 +148,5 @@ media-hdpvr-initialize-dev-worker-at-hdpvr_register_.patch
 mmc-host-return-an-error-when-enable_sdio_irq-ops-is.patch
 scsi-qla2xxx-fix-incorrect-reporting-of-task-management-failure.patch
 kvm-prevent-module-exit-until-all-vms-are-freed.patch
+ubifs-add-missing-iput-if-do_tmpfile-failed-in-rename-whiteout.patch
+ubifs-setflags-make-dirtied_ino_d-8-bytes-aligned.patch
diff --git a/queue-4.9/ubifs-add-missing-iput-if-do_tmpfile-failed-in-rename-whiteout.patch b/queue-4.9/ubifs-add-missing-iput-if-do_tmpfile-failed-in-rename-whiteout.patch
new file mode 100644 (file)
index 0000000..622ca5c
--- /dev/null
@@ -0,0 +1,35 @@
+From 716b4573026bcbfa7b58ed19fe15554bac66b082 Mon Sep 17 00:00:00 2001
+From: Zhihao Cheng <chengzhihao1@huawei.com>
+Date: Mon, 27 Dec 2021 11:22:35 +0800
+Subject: ubifs: Add missing iput if do_tmpfile() failed in rename whiteout
+
+From: Zhihao Cheng <chengzhihao1@huawei.com>
+
+commit 716b4573026bcbfa7b58ed19fe15554bac66b082 upstream.
+
+whiteout inode should be put when do_tmpfile() failed if inode has been
+initialized. Otherwise we will get following warning during umount:
+  UBIFS error (ubi0:0 pid 1494): ubifs_assert_failed [ubifs]: UBIFS
+  assert failed: c->bi.dd_growth == 0, in fs/ubifs/super.c:1930
+  VFS: Busy inodes after unmount of ubifs. Self-destruct in 5 seconds.
+
+Fixes: 9e0a1fff8db56ea ("ubifs: Implement RENAME_WHITEOUT")
+Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
+Suggested-by: Sascha Hauer <s.hauer@pengutronix.de>
+Signed-off-by: Richard Weinberger <richard@nod.at>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/ubifs/dir.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/fs/ubifs/dir.c
++++ b/fs/ubifs/dir.c
+@@ -376,6 +376,8 @@ out_inode:
+       make_bad_inode(inode);
+       if (!instantiated)
+               iput(inode);
++      else if (whiteout)
++              iput(*whiteout);
+ out_budg:
+       ubifs_release_budget(c, &req);
+       if (!instantiated)
diff --git a/queue-4.9/ubifs-setflags-make-dirtied_ino_d-8-bytes-aligned.patch b/queue-4.9/ubifs-setflags-make-dirtied_ino_d-8-bytes-aligned.patch
new file mode 100644 (file)
index 0000000..7af6d53
--- /dev/null
@@ -0,0 +1,38 @@
+From 1b83ec057db16b4d0697dc21ef7a9743b6041f72 Mon Sep 17 00:00:00 2001
+From: Zhihao Cheng <chengzhihao1@huawei.com>
+Date: Mon, 27 Dec 2021 11:22:39 +0800
+Subject: ubifs: setflags: Make dirtied_ino_d 8 bytes aligned
+
+From: Zhihao Cheng <chengzhihao1@huawei.com>
+
+commit 1b83ec057db16b4d0697dc21ef7a9743b6041f72 upstream.
+
+Make 'ui->data_len' aligned with 8 bytes before it is assigned to
+dirtied_ino_d. Since 8871d84c8f8b0c6b("ubifs: convert to fileattr")
+applied, 'setflags()' only affects regular files and directories, only
+xattr inode, symlink inode and special inode(pipe/char_dev/block_dev)
+have none- zero 'ui->data_len' field, so assertion
+'!(req->dirtied_ino_d & 7)' cannot fail in ubifs_budget_space().
+To avoid assertion fails in future evolution(eg. setflags can operate
+special inodes), it's better to make dirtied_ino_d 8 bytes aligned,
+after all aligned size is still zero for regular files.
+
+Fixes: 1e51764a3c2ac05a ("UBIFS: add new flash file system")
+Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
+Signed-off-by: Richard Weinberger <richard@nod.at>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/ubifs/ioctl.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/ubifs/ioctl.c
++++ b/fs/ubifs/ioctl.c
+@@ -105,7 +105,7 @@ static int setflags(struct inode *inode,
+       struct ubifs_inode *ui = ubifs_inode(inode);
+       struct ubifs_info *c = inode->i_sb->s_fs_info;
+       struct ubifs_budget_req req = { .dirtied_ino = 1,
+-                                      .dirtied_ino_d = ui->data_len };
++                      .dirtied_ino_d = ALIGN(ui->data_len, 8) };
+       err = ubifs_budget_space(c, &req);
+       if (err)