aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSachin Prabhu <sprabhu@redhat.com>2013-03-05 14:25:56 -0500
committerSteve French <sfrench@us.ibm.com>2013-03-06 19:30:04 -0500
commitc483a9841df1de327e01af7deb6ba349210e5f82 (patch)
treed48fe8bb27a79e4777d0df626884129a0a2623ee /fs
parent72d282dc5109e5dc0d963be020604e0cc82f7ed7 (diff)
cifs: Check server capability before attempting silly rename
cifs_rename_pending_delete() attempts to silly rename file using CIFSSMBRenameOpenFile(). This uses the SET_FILE_INFORMATION TRANS2 command with information level set to the passthru info-level SMB_SET_FILE_RENAME_INFORMATION. We need to check to make sure that the server support passthru info-levels before attempting the silly rename or else we will fail to rename the file. Signed-off-by: Sachin Prabhu <sprabhu@redhat.com> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/inode.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index e7ae45cd94ef..0079696305c9 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -995,6 +995,15 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry,
995 return PTR_ERR(tlink); 995 return PTR_ERR(tlink);
996 tcon = tlink_tcon(tlink); 996 tcon = tlink_tcon(tlink);
997 997
998 /*
999 * We cannot rename the file if the server doesn't support
1000 * CAP_INFOLEVEL_PASSTHRU
1001 */
1002 if (!(tcon->ses->capabilities & CAP_INFOLEVEL_PASSTHRU)) {
1003 rc = -EBUSY;
1004 goto out;
1005 }
1006
998 rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN, 1007 rc = CIFSSMBOpen(xid, tcon, full_path, FILE_OPEN,
999 DELETE|FILE_WRITE_ATTRIBUTES, CREATE_NOT_DIR, 1008 DELETE|FILE_WRITE_ATTRIBUTES, CREATE_NOT_DIR,
1000 &netfid, &oplock, NULL, cifs_sb->local_nls, 1009 &netfid, &oplock, NULL, cifs_sb->local_nls,