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>
This commit is contained in:

committed by
Steve French

parent
a347ecb209
commit
aa91c7e4ab
@@ -277,7 +277,7 @@ int cifs_open(struct inode *inode, struct file *file)
|
||||
|
||||
pCifsFile = cifs_new_fileinfo(inode, netfid, file,
|
||||
file->f_path.mnt,
|
||||
oflags);
|
||||
oflags, oplock);
|
||||
if (pCifsFile == NULL) {
|
||||
CIFSSMBClose(xid, tcon, netfid);
|
||||
rc = -ENOMEM;
|
||||
@@ -370,7 +370,7 @@ int cifs_open(struct inode *inode, struct file *file)
|
||||
goto out;
|
||||
|
||||
pCifsFile = cifs_new_fileinfo(inode, netfid, file, file->f_path.mnt,
|
||||
file->f_flags);
|
||||
file->f_flags, oplock);
|
||||
if (pCifsFile == NULL) {
|
||||
rc = -ENOMEM;
|
||||
goto out;
|
||||
|
Reference in New Issue
Block a user