summaryrefslogtreecommitdiff
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2010-04-27 04:38:15 (GMT)
committerSteve French <sfrench@us.ibm.com>2010-04-27 04:38:15 (GMT)
commitd54ff73259a852d4b3886dc586587fdef5e9c8de (patch)
tree417ed0f9b87e4187641b053892eeb8f32ec32746 /fs/cifs/file.c
parent9bf67e516f16d31f86aa6f063576a959bbf19990 (diff)
downloadlinux-d54ff73259a852d4b3886dc586587fdef5e9c8de.tar.xz
[CIFS] Fix lease break for writes
On lease break we were breaking to readonly leases always even if write requested. Also removed experimental ifdef around setlease code Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 5f1f768..d53d630 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -2306,12 +2306,10 @@ cifs_oplock_break(struct slow_work *work)
int rc, waitrc = 0;
if (inode && S_ISREG(inode->i_mode)) {
-#ifdef CONFIG_CIFS_EXPERIMENTAL
- if (cinode->clientCanCacheAll == 0)
+ if (cinode->clientCanCacheRead)
break_lease(inode, O_RDONLY);
- else if (cinode->clientCanCacheRead == 0)
+ else
break_lease(inode, O_WRONLY);
-#endif
rc = filemap_fdatawrite(inode->i_mapping);
if (cinode->clientCanCacheRead == 0) {
waitrc = filemap_fdatawait(inode->i_mapping);