diff options
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 5c497c529772..e152bf6afa60 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -203,9 +203,7 @@ int cifs_open(struct inode *inode, struct file *file) | |||
203 | } | 203 | } |
204 | } | 204 | } |
205 | 205 | ||
206 | mutex_lock(&inode->i_sb->s_vfs_rename_mutex); | ||
207 | full_path = build_path_from_dentry(file->f_dentry); | 206 | full_path = build_path_from_dentry(file->f_dentry); |
208 | mutex_unlock(&inode->i_sb->s_vfs_rename_mutex); | ||
209 | if (full_path == NULL) { | 207 | if (full_path == NULL) { |
210 | FreeXid(xid); | 208 | FreeXid(xid); |
211 | return -ENOMEM; | 209 | return -ENOMEM; |
@@ -906,8 +904,7 @@ static ssize_t cifs_write(struct file *file, const char *write_data, | |||
906 | if (rc != 0) | 904 | if (rc != 0) |
907 | break; | 905 | break; |
908 | } | 906 | } |
909 | /* BB FIXME We can not sign across two buffers yet */ | 907 | if(experimEnabled || (pTcon->ses->server->secMode & |
910 | if((pTcon->ses->server->secMode & | ||
911 | (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0) { | 908 | (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0) { |
912 | struct kvec iov[2]; | 909 | struct kvec iov[2]; |
913 | unsigned int len; | 910 | unsigned int len; |
@@ -923,13 +920,13 @@ static ssize_t cifs_write(struct file *file, const char *write_data, | |||
923 | *poffset, &bytes_written, | 920 | *poffset, &bytes_written, |
924 | iov, 1, long_op); | 921 | iov, 1, long_op); |
925 | } else | 922 | } else |
926 | /* BB FIXME fixup indentation of line below */ | 923 | rc = CIFSSMBWrite(xid, pTcon, |
927 | rc = CIFSSMBWrite(xid, pTcon, | 924 | open_file->netfid, |
928 | open_file->netfid, | 925 | min_t(const int, cifs_sb->wsize, |
929 | min_t(const int, cifs_sb->wsize, | 926 | write_size - total_written), |
930 | write_size - total_written), | 927 | *poffset, &bytes_written, |
931 | *poffset, &bytes_written, | 928 | write_data + total_written, |
932 | write_data + total_written, NULL, long_op); | 929 | NULL, long_op); |
933 | } | 930 | } |
934 | if (rc || (bytes_written == 0)) { | 931 | if (rc || (bytes_written == 0)) { |
935 | if (total_written) | 932 | if (total_written) |
@@ -968,6 +965,16 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode) | |||
968 | struct cifsFileInfo *open_file; | 965 | struct cifsFileInfo *open_file; |
969 | int rc; | 966 | int rc; |
970 | 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 | |||
971 | read_lock(&GlobalSMBSeslock); | 978 | read_lock(&GlobalSMBSeslock); |
972 | list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { | 979 | list_for_each_entry(open_file, &cifs_inode->openFileList, flist) { |
973 | if (open_file->closePend) | 980 | if (open_file->closePend) |
@@ -1093,12 +1100,11 @@ static int cifs_writepages(struct address_space *mapping, | |||
1093 | if (cifs_sb->wsize < PAGE_CACHE_SIZE) | 1100 | if (cifs_sb->wsize < PAGE_CACHE_SIZE) |
1094 | return generic_writepages(mapping, wbc); | 1101 | return generic_writepages(mapping, wbc); |
1095 | 1102 | ||
1096 | /* BB FIXME we do not have code to sign across multiple buffers yet, | ||
1097 | so go to older writepage style write which we can sign if needed */ | ||
1098 | if((cifs_sb->tcon->ses) && (cifs_sb->tcon->ses->server)) | 1103 | if((cifs_sb->tcon->ses) && (cifs_sb->tcon->ses->server)) |
1099 | if(cifs_sb->tcon->ses->server->secMode & | 1104 | if(cifs_sb->tcon->ses->server->secMode & |
1100 | (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) | 1105 | (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) |
1101 | return generic_writepages(mapping, wbc); | 1106 | if(!experimEnabled) |
1107 | return generic_writepages(mapping, wbc); | ||
1102 | 1108 | ||
1103 | /* | 1109 | /* |
1104 | * BB: Is this meaningful for a non-block-device file system? | 1110 | * BB: Is this meaningful for a non-block-device file system? |