9p: missing chunk of "fs/9p: Don't update file type when updating file attributes"
commitb577d0cd21upstream. In commit45089142b1Aneesh 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 <tadeusz.struk@linaro.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
2a59239b22
commit
56a7f57da5
@@ -657,14 +657,10 @@ v9fs_stat2inode_dotl(struct p9_stat_dotl *stat, struct inode *inode,
|
|||||||
if (stat->st_result_mask & P9_STATS_NLINK)
|
if (stat->st_result_mask & P9_STATS_NLINK)
|
||||||
set_nlink(inode, stat->st_nlink);
|
set_nlink(inode, stat->st_nlink);
|
||||||
if (stat->st_result_mask & P9_STATS_MODE) {
|
if (stat->st_result_mask & P9_STATS_MODE) {
|
||||||
inode->i_mode = stat->st_mode;
|
mode = stat->st_mode & S_IALLUGO;
|
||||||
if ((S_ISBLK(inode->i_mode)) ||
|
mode |= inode->i_mode & ~S_IALLUGO;
|
||||||
(S_ISCHR(inode->i_mode)))
|
inode->i_mode = mode;
|
||||||
init_special_inode(inode, inode->i_mode,
|
|
||||||
inode->i_rdev);
|
|
||||||
}
|
}
|
||||||
if (stat->st_result_mask & P9_STATS_RDEV)
|
|
||||||
inode->i_rdev = new_decode_dev(stat->st_rdev);
|
|
||||||
if (!(flags & V9FS_STAT2INODE_KEEP_ISIZE) &&
|
if (!(flags & V9FS_STAT2INODE_KEEP_ISIZE) &&
|
||||||
stat->st_result_mask & P9_STATS_SIZE)
|
stat->st_result_mask & P9_STATS_SIZE)
|
||||||
v9fs_i_size_write(inode, stat->st_size);
|
v9fs_i_size_write(inode, stat->st_size);
|
||||||
|
|||||||
Reference in New Issue
Block a user