aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/file.c
diff options
context:
space:
mode:
authorSuresh Jayaraman <sjayaraman@suse.de>2010-09-17 09:26:39 -0400
committerSteve French <sfrench@us.ibm.com>2010-09-29 15:04:28 -0400
commitaa91c7e4ab9b0842b7d7a7cbf8cca18b20df89b5 (patch)
tree94827b3006d85b8accf179ea3da30e1569983e68 /fs/cifs/file.c
parenta347ecb209b58a1b37f20d8299ab552f7d3ee8c3 (diff)
cifs: fix broken oplock handling
cifs_new_fileinfo() does not use the 'oplock' value from the callers. Instead, it sets it to REQ_OPLOCK which seems wrong. We should be using the oplock value obtained from the Server to set the inode's clientCanCacheAll or clientCanCacheRead flags. Fix this by passing oplock from the callers to cifs_new_fileinfo(). This change dates back to commit a6ce4932 (2.6.30-rc3). So, all the affected versions will need this fix. Please Cc stable once reviewed and accepted. Cc: Stable <stable@kernel.org> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/file.c')
-rw-r--r--fs/cifs/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index d33da45fe98..60061b9c2f6 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -277,7 +277,7 @@ int cifs_open(struct inode *inode, struct file *file)
277 277
278 pCifsFile = cifs_new_fileinfo(inode, netfid, file, 278 pCifsFile = cifs_new_fileinfo(inode, netfid, file,
279 file->f_path.mnt, 279 file->f_path.mnt,
280 oflags); 280 oflags, oplock);
281 if (pCifsFile == NULL) { 281 if (pCifsFile == NULL) {
282 CIFSSMBClose(xid, tcon, netfid); 282 CIFSSMBClose(xid, tcon, netfid);
283 rc = -ENOMEM; 283 rc = -ENOMEM;
@@ -370,7 +370,7 @@ int cifs_open(struct inode *inode, struct file *file)
370 goto out; 370 goto out;
371 371
372 pCifsFile = cifs_new_fileinfo(inode, netfid, file, file->f_path.mnt, 372 pCifsFile = cifs_new_fileinfo(inode, netfid, file, file->f_path.mnt,
373 file->f_flags); 373 file->f_flags, oplock);
374 if (pCifsFile == NULL) { 374 if (pCifsFile == NULL) {
375 rc = -ENOMEM; 375 rc = -ENOMEM;
376 goto out; 376 goto out;