CIFS: Fix write after setting a read lock for read oplock files
authorPavel Shilovsky <piastry@etersoft.ru>
Fri, 21 Dec 2012 11:07:52 +0000 (15:07 +0400)
committerSteve French <smfrench@gmail.com>
Wed, 2 Jan 2013 05:04:14 +0000 (23:04 -0600)
commit88cf75aaaf27a652b3e85960ac3060172dd3edac
tree4d9b9f8050a5dce17bcfd0726daec0edceca08b9
parentca8aa29c60238720af2ca2a5caab25fa0c70067e
CIFS: Fix write after setting a read lock for read oplock files

If we have a read oplock and set a read lock in it, we can't write to the
locked area - so, filemap_fdatawrite may fail with a no information for a
userspace application even if we request a write to non-locked area. Fix
this by writing directly to the server and then breaking oplock level from
level2 to None.

Also remove CONFIG_CIFS_SMB2 ifdefs because it's suitable for both CIFS
and SMB2 protocols.

Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
Reviewed-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <smfrench@gmail.com>
fs/cifs/file.c