diff options
Diffstat (limited to 'fs/cifs/inode.c')
-rw-r--r-- | fs/cifs/inode.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 83f2606c76d0..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, |
@@ -1023,7 +1032,7 @@ cifs_rename_pending_delete(const char *full_path, struct dentry *dentry, | |||
1023 | current->tgid); | 1032 | current->tgid); |
1024 | /* although we would like to mark the file hidden | 1033 | /* although we would like to mark the file hidden |
1025 | if that fails we will still try to rename it */ | 1034 | if that fails we will still try to rename it */ |
1026 | if (rc != 0) | 1035 | if (!rc) |
1027 | cifsInode->cifsAttrs = dosattr; | 1036 | cifsInode->cifsAttrs = dosattr; |
1028 | else | 1037 | else |
1029 | dosattr = origattr; /* since not able to change them */ | 1038 | dosattr = origattr; /* since not able to change them */ |