From f81dc1b7835e4c1c5c22b0e29142effe862fe695 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 16 Jun 2022 14:57:10 +0200 Subject: [PATCH] 5.4-stable patches added patches: 9p-missing-chunk-of-fs-9p-don-t-update-file-type-when-updating-file-attributes.patch --- ...e-type-when-updating-file-attributes.patch | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 queue-5.4/9p-missing-chunk-of-fs-9p-don-t-update-file-type-when-updating-file-attributes.patch diff --git a/queue-5.4/9p-missing-chunk-of-fs-9p-don-t-update-file-type-when-updating-file-attributes.patch b/queue-5.4/9p-missing-chunk-of-fs-9p-don-t-update-file-type-when-updating-file-attributes.patch new file mode 100644 index 00000000000..8a3cadaf555 --- /dev/null +++ b/queue-5.4/9p-missing-chunk-of-fs-9p-don-t-update-file-type-when-updating-file-attributes.patch @@ -0,0 +1,41 @@ +From b577d0cd2104fdfcf0ded3707540a12be8ddd8b0 Mon Sep 17 00:00:00 2001 +From: Al Viro +Date: Sun, 31 Jan 2021 14:37:39 -0500 +Subject: 9p: missing chunk of "fs/9p: Don't update file type when updating file attributes" + +From: Al Viro + +commit b577d0cd2104fdfcf0ded3707540a12be8ddd8b0 upstream. + +In commit 45089142b149 Aneesh had missed one (admittedly, very unlikely +to hit) case in v9fs_stat2inode_dotl(). However, the same considerations +apply there as well - we have no business whatsoever to change ->i_rdev +or the file type. + +Cc: Tadeusz Struk +Signed-off-by: Al Viro +Signed-off-by: Greg Kroah-Hartman +--- + fs/9p/vfs_inode_dotl.c | 10 +++------- + 1 file changed, 3 insertions(+), 7 deletions(-) + +--- a/fs/9p/vfs_inode_dotl.c ++++ b/fs/9p/vfs_inode_dotl.c +@@ -641,14 +641,10 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl + if (stat->st_result_mask & P9_STATS_NLINK) + set_nlink(inode, stat->st_nlink); + if (stat->st_result_mask & P9_STATS_MODE) { +- inode->i_mode = stat->st_mode; +- if ((S_ISBLK(inode->i_mode)) || +- (S_ISCHR(inode->i_mode))) +- init_special_inode(inode, inode->i_mode, +- inode->i_rdev); ++ mode = stat->st_mode & S_IALLUGO; ++ mode |= inode->i_mode & ~S_IALLUGO; ++ inode->i_mode = mode; + } +- if (stat->st_result_mask & P9_STATS_RDEV) +- inode->i_rdev = new_decode_dev(stat->st_rdev); + if (!(flags & V9FS_STAT2INODE_KEEP_ISIZE) && + stat->st_result_mask & P9_STATS_SIZE) + v9fs_i_size_write(inode, stat->st_size); -- 2.47.3