summaryrefslogtreecommitdiffstats
path: root/fs/cifs/readdir.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2021-02-10 21:23:04 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2021-03-12 22:15:20 -0500
commit4d66952a2032cf6b65183fc4a8d8039304c70d48 (patch)
tree32ab5eedf7ae87418e9cf314dd357cf95234662d /fs/cifs/readdir.c
parent3bcb39b086bf8d7c3cff013564f86162ec497d90 (diff)
downloadlinux-4d66952a2032cf6b65183fc4a8d8039304c70d48.tar.gz
linux-4d66952a2032cf6b65183fc4a8d8039304c70d48.tar.bz2
linux-4d66952a2032cf6b65183fc4a8d8039304c70d48.zip
cifs: have cifs_fattr_to_inode() refuse to change type on live inode
... instead of trying to do that in the callers (and missing some, at that) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/cifs/readdir.c')
-rw-r--r--fs/cifs/readdir.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 80bf4c6f4c7b..e563c0fb47cb 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -119,9 +119,7 @@ retry:
/* update inode in place
* if both i_ino and i_mode didn't change */
if (CIFS_I(inode)->uniqueid == fattr->cf_uniqueid &&
- (inode->i_mode & S_IFMT) ==
- (fattr->cf_mode & S_IFMT)) {
- cifs_fattr_to_inode(inode, fattr);
+ cifs_fattr_to_inode(inode, fattr) == 0) {
dput(dentry);
return;
}