diff options
author | Pavel Shilovsky <piastry@etersoft.ru> | 2011-10-22 14:37:50 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-11-11 09:35:11 -0800 |
commit | e842a3e0d2bd01e0e32c0af4ef266f08b9b9ef75 (patch) | |
tree | 6786c08b37fccd8f772653db0495451061d4d5b7 /fs | |
parent | 2d925a5b8e7ea244bca1e988df4ce0c6db0c4d07 (diff) | |
download | kernel_samsung_espresso10-e842a3e0d2bd01e0e32c0af4ef266f08b9b9ef75.zip kernel_samsung_espresso10-e842a3e0d2bd01e0e32c0af4ef266f08b9b9ef75.tar.gz kernel_samsung_espresso10-e842a3e0d2bd01e0e32c0af4ef266f08b9b9ef75.tar.bz2 |
CIFS: Fix DFS handling in cifs_get_file_info
commit 42274bb22afc3e877ae5abed787b0b09d7dede52 upstream.
We should call cifs_all_info_to_fattr in rc == 0 case only.
Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/inode.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index a7b2dcd..745e5cd 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -562,7 +562,16 @@ int cifs_get_file_info(struct file *filp) xid = GetXid(); rc = CIFSSMBQFileInfo(xid, tcon, cfile->netfid, &find_data); - if (rc == -EOPNOTSUPP || rc == -EINVAL) { + switch (rc) { + case 0: + cifs_all_info_to_fattr(&fattr, &find_data, cifs_sb, false); + break; + case -EREMOTE: + cifs_create_dfs_fattr(&fattr, inode->i_sb); + rc = 0; + break; + case -EOPNOTSUPP: + case -EINVAL: /* * FIXME: legacy server -- fall back to path-based call? * for now, just skip revalidating and mark inode for @@ -570,18 +579,14 @@ int cifs_get_file_info(struct file *filp) */ rc = 0; CIFS_I(inode)->time = 0; + default: goto cgfi_exit; - } else if (rc == -EREMOTE) { - cifs_create_dfs_fattr(&fattr, inode->i_sb); - rc = 0; - } else if (rc) - goto cgfi_exit; + } /* * don't bother with SFU junk here -- just mark inode as needing * revalidation. */ - cifs_all_info_to_fattr(&fattr, &find_data, cifs_sb, false); fattr.cf_uniqueid = CIFS_I(inode)->uniqueid; fattr.cf_flags |= CIFS_FATTR_NEED_REVAL; cifs_fattr_to_inode(inode, &fattr); |