Skip to content

Commit b577d0c

Browse files
author
Al Viro
committed
9p: missing chunk of "fs/9p: Don't update file type when updating file attributes"
In commit 4508914 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. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent e34d657 commit b577d0c

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

fs/9p/vfs_inode_dotl.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -663,14 +663,10 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode,
663663
if (stat->st_result_mask & P9_STATS_NLINK)
664664
set_nlink(inode, stat->st_nlink);
665665
if (stat->st_result_mask & P9_STATS_MODE) {
666-
inode->i_mode = stat->st_mode;
667-
if ((S_ISBLK(inode->i_mode)) ||
668-
(S_ISCHR(inode->i_mode)))
669-
init_special_inode(inode, inode->i_mode,
670-
inode->i_rdev);
666+
mode = stat->st_mode & S_IALLUGO;
667+
mode |= inode->i_mode & ~S_IALLUGO;
668+
inode->i_mode = mode;
671669
}
672-
if (stat->st_result_mask & P9_STATS_RDEV)
673-
inode->i_rdev = new_decode_dev(stat->st_rdev);
674670
if (!(flags & V9FS_STAT2INODE_KEEP_ISIZE) &&
675671
stat->st_result_mask & P9_STATS_SIZE)
676672
v9fs_i_size_write(inode, stat->st_size);

0 commit comments

Comments
 (0)