cifs: fix broken oplock handling
authorSuresh Jayaraman <sjayaraman@suse.de>
Fri, 17 Sep 2010 13:26:39 +0000 (18:56 +0530)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 22 Nov 2010 19:03:02 +0000 (11:03 -0800)
commit30d01aacb2ced4a54be35d650c73f2cf5ac235fa
tree1d7b36fee037b8517aa9147aa18260d004189e8c
parent380c7ff30fb28ea236d1543e220c52de7d65343a
cifs: fix broken oplock handling

commit aa91c7e4ab9b0842b7d7a7cbf8cca18b20df89b5 upstream.

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.

Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Suresh Jayaraman <sjayaraman@suse.de>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/cifs/cifsproto.h
fs/cifs/dir.c
fs/cifs/file.c