aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2006-04-22 11:53:05 -0400
committerSteve French <sfrench@us.ibm.com>2006-04-22 11:53:05 -0400
commit60808233f374aebba26488d06a5f25443f6763c3 (patch)
treee2f85a165398f0c6c7432a7fa715d18efc3d8d5b /fs/cifs/file.c
parent45af7a0f2ebad1304cab956e15f0b37318226fcd (diff)
[CIFS] Readdir fixes to allow search to start at arbitrary position
in directory Also includes first part of fix to compensate for servers which forget to return . and .. as well as updates to changelog and cifs readme. Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 1476725e6051..e152bf6afa60 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -904,8 +904,7 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
904 if (rc != 0) 904 if (rc != 0)
905 break; 905 break;
906 } 906 }
907 /* BB FIXME We can not sign across two buffers yet */ 907 if(experimEnabled || (pTcon->ses->server->secMode &
908 if((pTcon->ses->server->secMode &
909 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0) { 908 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0) {
910 struct kvec iov[2]; 909 struct kvec iov[2];
911 unsigned int len; 910 unsigned int len;
@@ -921,13 +920,13 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
921 *poffset, &bytes_written, 920 *poffset, &bytes_written,
922 iov, 1, long_op); 921 iov, 1, long_op);
923 } else 922 } else
924 /* BB FIXME fixup indentation of line below */ 923 rc = CIFSSMBWrite(xid, pTcon,
925 rc = CIFSSMBWrite(xid, pTcon, 924 open_file->netfid,
926 open_file->netfid, 925 min_t(const int, cifs_sb->wsize,
927 min_t(const int, cifs_sb->wsize, 926 write_size - total_written),
928 write_size - total_written), 927 *poffset, &bytes_written,
929 *poffset, &bytes_written, 928 write_data + total_written,
930 write_data + total_written, NULL, long_op); 929 NULL, long_op);
931 } 930 }
932 if (rc || (bytes_written == 0)) { 931 if (rc || (bytes_written == 0)) {
933 if (total_written) 932 if (total_written)
@@ -966,6 +965,16 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode)
966 struct cifsFileInfo *open_file; 965 struct cifsFileInfo *open_file;
967 int rc; 966 int rc;
968 967
968 /* Having a null inode here (because mapping->host was set to zero by
969 the VFS or MM) should not happen but we had reports of on oops (due to
970 it being zero) during stress testcases so we need to check for it */
971
972 if(cifs_inode == NULL) {
973 cERROR(1,("Null inode passed to cifs_writeable_file"));
974 dump_stack();
975 return NULL;
976 }
977
969 read_lock(&GlobalSMBSeslock); 978 read_lock(&GlobalSMBSeslock);
970 list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { 979 list_for_each_entry(open_file, &cifs_inode->openFileList, flist) {
971 if (open_file->closePend) 980 if (open_file->closePend)
@@ -1091,12 +1100,11 @@ static int cifs_writepages(struct address_space *mapping,
1091 if (cifs_sb->wsize < PAGE_CACHE_SIZE) 1100 if (cifs_sb->wsize < PAGE_CACHE_SIZE)
1092 return generic_writepages(mapping, wbc); 1101 return generic_writepages(mapping, wbc);
1093 1102
1094 /* BB FIXME we do not have code to sign across multiple buffers yet,
1095 so go to older writepage style write which we can sign if needed */
1096 if((cifs_sb->tcon->ses) && (cifs_sb->tcon->ses->server)) 1103 if((cifs_sb->tcon->ses) && (cifs_sb->tcon->ses->server))
1097 if(cifs_sb->tcon->ses->server->secMode & 1104 if(cifs_sb->tcon->ses->server->secMode &
1098 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) 1105 (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED))
1099 return generic_writepages(mapping, wbc); 1106 if(!experimEnabled)
1107 return generic_writepages(mapping, wbc);
1100 1108
1101 /* 1109 /*
1102 * BB: Is this meaningful for a non-block-device file system? 1110 * BB: Is this meaningful for a non-block-device file system?