diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-05-30 11:46:45 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-05-30 11:46:45 -0700 |
commit | 2c56554ec596adadd562679ef672d83e290f1732 (patch) | |
tree | 391308e07b307714896dc71ed2f25448cef75ed6 /fs/cifs/file.c | |
parent | d1b3f96b0f9c1d9bc305a4d14bee0dc3509101a0 (diff) | |
parent | 55aa2e097dd5f0546972fc2607d7094181967ce2 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
[[CIFS] Pass truncate open flag through on file open in case setattr fails
[CIFS] Fix typos in previous fix
[CIFS] endian fix for new POSIX byte range lock support
[CIFS] fix memory leak in cifs session info struct on reconnect
[CIFS] ACPI suspend oops
[CIFS] Do not limit the length of share names (was 100 for whole UNC name)
[CIFS] Fix new POSIX Locking for setting lock_type correctly on unlock
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r-- | fs/cifs/file.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index e152bf6afa60..e2b4ce1dad66 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -84,6 +84,8 @@ static inline int cifs_get_disposition(unsigned int flags) return FILE_OVERWRITE_IF; else if ((flags & O_CREAT) == O_CREAT) return FILE_OPEN_IF; + else if ((flags & O_TRUNC) == O_TRUNC) + return FILE_OVERWRITE; else return FILE_OPEN; } @@ -656,7 +658,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock) else posix_lock_type = CIFS_WRLCK; rc = CIFSSMBPosixLock(xid, pTcon, netfid, 1 /* get */, - length, pfLock->fl_start, + length, pfLock, posix_lock_type, wait_flag); FreeXid(xid); return rc; @@ -704,7 +706,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock) return -EOPNOTSUPP; } rc = CIFSSMBPosixLock(xid, pTcon, netfid, 0 /* set */, - length, pfLock->fl_start, + length, pfLock, posix_lock_type, wait_flag); } else rc = CIFSSMBLock(xid, pTcon, netfid, length, pfLock->fl_start, @@ -904,8 +906,10 @@ static ssize_t cifs_write(struct file *file, const char *write_data, if (rc != 0) break; } - if(experimEnabled || (pTcon->ses->server->secMode & - (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) == 0) { + if(experimEnabled || (pTcon->ses->server && + ((pTcon->ses->server->secMode & + (SECMODE_SIGN_REQUIRED | SECMODE_SIGN_ENABLED)) + == 0))) { struct kvec iov[2]; unsigned int len; |