CIFS: Fix lock consistensy bug in cifs_setlk
authorPavel Shilovsky <piastry@etersoft.ru>
Thu, 22 Nov 2012 14:56:39 +0000 (18:56 +0400)
committerSteve French <smfrench@gmail.com>
Wed, 5 Dec 2012 19:27:29 +0000 (13:27 -0600)
commit21cb2d90c76cbc951da3a266f0dd439d64f3114a
treeb38829c87f5be4c9da6c2bfdb11fd5a7ec4e98fb
parentf152fd5fffa78910c467b17f12d0aa060aa408a6
CIFS: Fix lock consistensy bug in cifs_setlk

If we netogiate mandatory locking style, have a read lock and try
to set a write lock we end up with a write lock in vfs cache and
no lock in cifs lock cache - that's wrong. Fix it by returning
from cifs_setlk immediately if a error occurs during setting a lock.

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