diff options
author | Jeff Layton <jlayton@redhat.com> | 2013-05-07 11:28:31 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-07 12:52:26 -0700 |
commit | 92f3a29f74d31f4d2d055e0eaeb21145019c4a0a (patch) | |
tree | 1858369fa50b3e9b03c05dc64a247c77ae961566 | |
parent | 3343e275c00997a0c68485434f149302830a2583 (diff) | |
download | lwn-92f3a29f74d31f4d2d055e0eaeb21145019c4a0a.tar.gz lwn-92f3a29f74d31f4d2d055e0eaeb21145019c4a0a.zip |
cifs: only set ops for inodes in I_NEW state
commit c2b93e0699723700f886ce17bb65ffd771195a6d upstream.
It's generally not safe to reset the inode ops once they've been set. In
the case where the inode was originally thought to be a directory and
then later found to be a DFS referral, this can lead to an oops when we
try to trigger an inode op on it after changing the ops to the blank
referral operations.
Reported-and-Tested-by: Sachin Prabhu <sprabhu@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | fs/cifs/inode.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 20887bf63121..cb8842944f9c 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -169,7 +169,8 @@ cifs_fattr_to_inode(struct inode *inode, struct cifs_fattr *fattr) if (fattr->cf_flags & CIFS_FATTR_DFS_REFERRAL) inode->i_flags |= S_AUTOMOUNT; - cifs_set_ops(inode); + if (inode->i_state & I_NEW) + cifs_set_ops(inode); } void |