aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifssmb.c
diff options
context:
space:
mode:
authorShirish Pargaonkar <shirishpargaonkar@gmail.com>2012-05-15 11:19:16 -0400
committerPavel Shilovsky <piastry@etersoft.ru>2012-05-17 05:07:49 -0400
commit2608bee744a92d60d15ff4e6e0b913d8b406aedd (patch)
tree3104d96b86e25c931b2bee199eb67842327aeaa1 /fs/cifs/cifssmb.c
parent7f92447aa7be605fd80d9f248efe0b8ac9379f11 (diff)
cifs: Include backup intent search flags during searches {try #2)
As observed and suggested by Tushar Gosavi... --------- readdir calls these function to send TRANS2_FIND_FIRST and TRANS2_FIND_NEXT command to the server. The current cifs module is not specifying CIFS_SEARCH_BACKUP_SEARCH flag while sending these command when backupuid/backupgid is specified. This can be resolved by specifying CIFS_SEARCH_BACKUP_SEARCH flag. --------- Cc: <stable@kernel.org> Reported-and-Tested-by: Tushar Gosavi <tugosavi@in.ibm.com> Signed-off-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com> Acked-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r--fs/cifs/cifssmb.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 45633da461a..3563c93d9f1 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -4238,7 +4238,7 @@ int
4238CIFSFindFirst(const int xid, struct cifs_tcon *tcon, 4238CIFSFindFirst(const int xid, struct cifs_tcon *tcon,
4239 const char *searchName, 4239 const char *searchName,
4240 const struct nls_table *nls_codepage, 4240 const struct nls_table *nls_codepage,
4241 __u16 *pnetfid, 4241 __u16 *pnetfid, __u16 search_flags,
4242 struct cifs_search_info *psrch_inf, int remap, const char dirsep) 4242 struct cifs_search_info *psrch_inf, int remap, const char dirsep)
4243{ 4243{
4244/* level 257 SMB_ */ 4244/* level 257 SMB_ */
@@ -4310,8 +4310,7 @@ findFirstRetry:
4310 cpu_to_le16(ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM | 4310 cpu_to_le16(ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM |
4311 ATTR_DIRECTORY); 4311 ATTR_DIRECTORY);
4312 pSMB->SearchCount = cpu_to_le16(CIFSMaxBufSize/sizeof(FILE_UNIX_INFO)); 4312 pSMB->SearchCount = cpu_to_le16(CIFSMaxBufSize/sizeof(FILE_UNIX_INFO));
4313 pSMB->SearchFlags = cpu_to_le16(CIFS_SEARCH_CLOSE_AT_END | 4313 pSMB->SearchFlags = cpu_to_le16(search_flags);
4314 CIFS_SEARCH_RETURN_RESUME);
4315 pSMB->InformationLevel = cpu_to_le16(psrch_inf->info_level); 4314 pSMB->InformationLevel = cpu_to_le16(psrch_inf->info_level);
4316 4315
4317 /* BB what should we set StorageType to? Does it matter? BB */ 4316 /* BB what should we set StorageType to? Does it matter? BB */
@@ -4381,8 +4380,8 @@ findFirstRetry:
4381 return rc; 4380 return rc;
4382} 4381}
4383 4382
4384int CIFSFindNext(const int xid, struct cifs_tcon *tcon, 4383int CIFSFindNext(const int xid, struct cifs_tcon *tcon, __u16 searchHandle,
4385 __u16 searchHandle, struct cifs_search_info *psrch_inf) 4384 __u16 search_flags, struct cifs_search_info *psrch_inf)
4386{ 4385{
4387 TRANSACTION2_FNEXT_REQ *pSMB = NULL; 4386 TRANSACTION2_FNEXT_REQ *pSMB = NULL;
4388 TRANSACTION2_FNEXT_RSP *pSMBr = NULL; 4387 TRANSACTION2_FNEXT_RSP *pSMBr = NULL;
@@ -4425,8 +4424,7 @@ int CIFSFindNext(const int xid, struct cifs_tcon *tcon,
4425 cpu_to_le16(CIFSMaxBufSize / sizeof(FILE_UNIX_INFO)); 4424 cpu_to_le16(CIFSMaxBufSize / sizeof(FILE_UNIX_INFO));
4426 pSMB->InformationLevel = cpu_to_le16(psrch_inf->info_level); 4425 pSMB->InformationLevel = cpu_to_le16(psrch_inf->info_level);
4427 pSMB->ResumeKey = psrch_inf->resume_key; 4426 pSMB->ResumeKey = psrch_inf->resume_key;
4428 pSMB->SearchFlags = 4427 pSMB->SearchFlags = cpu_to_le16(search_flags);
4429 cpu_to_le16(CIFS_SEARCH_CLOSE_AT_END | CIFS_SEARCH_RETURN_RESUME);
4430 4428
4431 name_len = psrch_inf->resume_name_len; 4429 name_len = psrch_inf->resume_name_len;
4432 params += name_len; 4430 params += name_len;