aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 39b23f4fa6c3..11806c879c47 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -855,7 +855,7 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
855 struct kvec iov[2]; 855 struct kvec iov[2];
856 unsigned int len; 856 unsigned int len;
857 857
858 len = min(cifs_sb->wsize, 858 len = min((size_t)cifs_sb->wsize,
859 write_size - total_written); 859 write_size - total_written);
860 /* iov[0] is reserved for smb header */ 860 /* iov[0] is reserved for smb header */
861 iov[1].iov_base = (char *)write_data + 861 iov[1].iov_base = (char *)write_data +
@@ -920,7 +920,8 @@ struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode)
920 ((open_file->pfile->f_flags & O_RDWR) || 920 ((open_file->pfile->f_flags & O_RDWR) ||
921 (open_file->pfile->f_flags & O_WRONLY))) { 921 (open_file->pfile->f_flags & O_WRONLY))) {
922 read_unlock(&GlobalSMBSeslock); 922 read_unlock(&GlobalSMBSeslock);
923 if(open_file->invalidHandle) { 923 if((open_file->invalidHandle) &&
924 (!open_file->closePend)) {
924 rc = cifs_reopen_file(&cifs_inode->vfs_inode, 925 rc = cifs_reopen_file(&cifs_inode->vfs_inode,
925 open_file->pfile, FALSE); 926 open_file->pfile, FALSE);
926 /* if it fails, try another handle - might be */ 927 /* if it fails, try another handle - might be */