linux/fs/cifs
Sachin Prabhu 7af7e9a452 Complete oplock break jobs before closing file handle
commit ca7df8e0bb upstream.

Commit
c11f1df500
requires writers to wait for any pending oplock break handler to
complete before proceeding to write. This is done by waiting on bit
CIFS_INODE_PENDING_OPLOCK_BREAK in cifsFileInfo->flags. This bit is
cleared by the oplock break handler job queued on the workqueue once it
has completed handling the oplock break allowing writers to proceed with
writing to the file.

While testing, it was noticed that the filehandle could be closed while
there is a pending oplock break which results in the oplock break
handler on the cifsiod workqueue being cancelled before it has had a
chance to execute and clear the CIFS_INODE_PENDING_OPLOCK_BREAK bit.
Any subsequent attempt to write to this file hangs waiting for the
CIFS_INODE_PENDING_OPLOCK_BREAK bit to be cleared.

We fix this by ensuring that we also clear the bit
CIFS_INODE_PENDING_OPLOCK_BREAK when we remove the oplock break handler
from the workqueue.

The bug was found by Red Hat QA while testing using ltp's fsstress
command.

Signed-off-by: Sachin Prabhu <sprabhu@redhat.com>
Acked-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Jeff Layton <jlayton@samba.org>
Signed-off-by: Steve French <steve.french@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-11 14:54:47 +08:00
..
Kconfig
Makefile
asn1.c
cache.c
cifs_debug.c
cifs_debug.h
cifs_dfs_ref.c
cifs_fs_sb.h
cifs_spnego.c
cifs_spnego.h
cifs_unicode.c CIFS: fix mount failure with broken pathnames when smb3 mount with mapchars option 2014-07-09 11:18:27 -07:00
cifs_unicode.h
cifs_uniupr.h
cifsacl.c
cifsacl.h
cifsencrypt.c
cifsfs.c
cifsfs.h
cifsglob.h CIFS: Fix SMB2 readdir error handling 2014-10-09 12:21:27 -07:00
cifspdu.h
cifsproto.h
cifssmb.c
connect.c
dir.c
dns_resolve.c
dns_resolve.h
export.c
file.c Complete oplock break jobs before closing file handle 2015-02-11 14:54:47 +08:00
fscache.c
fscache.h
inode.c CIFS: Fix directory rename error 2014-09-17 09:19:27 -07:00
ioctl.c fix deadlock in cifs_ioctl_clone() 2015-01-29 17:40:49 -08:00
link.c SMB3: Fix oops when creating symlinks on smb3 2014-10-05 14:52:17 -07:00
misc.c
netmisc.c
nterr.c
nterr.h
ntlmssp.h
readdir.c CIFS: Fix SMB2 readdir error handling 2014-10-09 12:21:27 -07:00
rfc1002pdu.h
sess.c
smb1ops.c CIFS: Fix SMB2 readdir error handling 2014-10-09 12:21:27 -07:00
smb2file.c CIFS: Fix wrong filename length for SMB2 2014-09-17 09:19:27 -07:00
smb2glob.h
smb2inode.c CIFS: Fix wrong filename length for SMB2 2014-09-17 09:19:27 -07:00
smb2maperror.c CIFS: Fix SMB2 readdir error handling 2014-10-09 12:21:27 -07:00
smb2misc.c
smb2ops.c CIFS: Fix SMB2 readdir error handling 2014-10-09 12:21:27 -07:00
smb2pdu.c CIFS: Fix SMB2 readdir error handling 2014-10-09 12:21:27 -07:00
smb2pdu.h
smb2proto.h
smb2status.h
smb2transport.c
smbencrypt.c
smberr.h
smbfsctl.h
transport.c
winucase.c
xattr.c