diff options
author | Jeff Layton <jlayton@redhat.com> | 2013-05-07 17:28:31 +0200 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2013-05-24 19:55:39 +0200 |
commit | 62106e96279f66c52e2123782f9420af9dbe8cbe (patch) | |
tree | d008f1b2ff13541b62c562cdb061ecdd1acd06dd /fs | |
parent | Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-3.0-fixes (diff) | |
download | linux-62106e96279f66c52e2123782f9420af9dbe8cbe.tar.xz linux-62106e96279f66c52e2123782f9420af9dbe8cbe.zip |
cifs: only set ops for inodes in I_NEW state
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.
Cc: <stable@vger.kernel.org>
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: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-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 fc3025199cb3..20efd81266c6 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -171,7 +171,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 |