linux-stable/fs/cifs
Sachin Prabhu ca7df8e0bb Complete oplock break jobs before closing file handle
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>
Cc: stable@vger.kernel.org
Signed-off-by: Steve French <steve.french@primarydata.com>
2015-01-19 20:20:46 -06:00
..
asn1.c [CIFS] cifs: Rename cERROR and cFYI to cifs_dbg 2013-05-04 22:17:23 -05:00
cache.c [CIFS] cifs: Rename cERROR and cFYI to cifs_dbg 2013-05-04 22:17:23 -05:00
cifs_debug.c cifs: convert printk(LEVEL...) to pr_<level> 2014-12-07 22:48:07 -06:00
cifs_debug.h cifs: convert printk(LEVEL...) to pr_<level> 2014-12-07 22:48:07 -06:00
cifs_dfs_ref.c cifs: replace strnicmp with strncasecmp 2014-10-14 02:18:24 +02:00
cifs_fs_sb.h Allow conversion of characters in Mac remap range. Part 1 2014-10-16 15:20:20 -05:00
cifs_spnego.c KEYS: Remove key_type::match in favour of overriding default by match_preparse 2014-09-16 17:36:06 +01:00
cifs_spnego.h
cifs_unicode.c Remap reserved posix characters by default (part 3/3) 2014-10-16 15:20:20 -05:00
cifs_unicode.h Remap reserved posix characters by default (part 3/3) 2014-10-16 15:20:20 -05:00
cifs_uniupr.h
cifsacl.c fs/cifs: remove obsolete __constant 2014-12-10 17:41:02 -08:00
cifsacl.h
cifsencrypt.c Allow conversion of characters in Mac remap range. Part 1 2014-10-16 15:20:20 -05:00
cifsfs.c cifs: get rid of ->f_path.dentry->d_sb uses, add a new helper 2014-11-19 13:01:22 -05:00
cifsfs.h Update modinfo cifs version for cifs.ko 2014-12-07 22:17:19 -06:00
cifsglob.h Convert MessageID in smb2_hdr to LE 2014-12-14 14:55:45 -06:00
cifspdu.h Add missing definitions for CIFS File System Attributes 2014-08-12 23:47:14 -05:00
cifsproto.h CIFS: Use multicredits for SMB 2.1/3 writes 2014-08-02 01:23:03 -05:00
cifssmb.c fs/cifs: remove obsolete __constant 2014-12-10 17:41:02 -08:00
connect.c cifs: convert printk(LEVEL...) to pr_<level> 2014-12-07 22:48:07 -06:00
dir.c Allow mknod and mkfifo on SMB2/SMB3 mounts 2014-10-16 15:20:19 -05:00
dns_resolve.c cifs: fix composing of mount options for DFS referrals 2013-05-24 13:08:31 -05:00
dns_resolve.h
export.c [CIFS] cifs: Rename cERROR and cFYI to cifs_dbg 2013-05-04 22:17:23 -05:00
file.c Complete oplock break jobs before closing file handle 2015-01-19 20:20:46 -06:00
fscache.c NFS client updates for Linux 3.13 2013-11-08 05:57:46 +09:00
fscache.h CIFS: FS-Cache: Uncache unread pages in cifs_readpages() before freeing them 2013-09-18 10:17:03 -05:00
inode.c move d_rcu from overlapping d_child to overlapping d_alias 2014-11-03 15:20:29 -05:00
ioctl.c fs: cifs: new helper: file_inode(file) 2014-05-21 10:18:05 -07:00
Kconfig Clarify Kconfig help text for CIFS and SMB2/SMB3 2014-08-25 17:01:05 -05:00
link.c [CIFS] Remove obsolete comment 2014-10-17 17:17:12 -05:00
Makefile cifs: add new case-insensitive conversion routines that are based on wchar_t's 2013-09-08 14:38:05 -05:00
misc.c cifs: convert to print_hex_dump() instead of custom implementation 2014-12-07 22:48:01 -06:00
netmisc.c Fix signed/unsigned pointer warning 2014-12-14 14:55:57 -06:00
nterr.c
nterr.h
ntlmssp.h
readdir.c cifs: make new inode cache when file type is different 2014-12-22 14:16:21 -06:00
rfc1002pdu.h
sess.c Merge branch 'akpm' (patchbomb from Andrew) 2014-12-10 18:34:42 -08:00
smb1ops.c Remap reserved posix characters by default (part 3/3) 2014-10-16 15:20:20 -05:00
smb2file.c fs/cifs/smb2file.c: replace count*size kzalloc by kcalloc 2014-12-10 17:41:02 -08:00
smb2glob.h CIFS: Fix too big maxBuf size for SMB3 mounts 2014-02-14 16:50:47 -06:00
smb2inode.c CIFS: Fix wrong filename length for SMB2 2014-08-25 16:45:17 -05:00
smb2maperror.c Fix problem recognizing symlinks 2014-10-02 14:10:04 -05:00
smb2misc.c Convert MessageID in smb2_hdr to LE 2014-12-14 14:55:45 -06:00
smb2ops.c Convert MessageID in smb2_hdr to LE 2014-12-14 14:55:45 -06:00
smb2pdu.c Merge branch 'akpm' (patchbomb from Andrew) 2014-12-10 18:34:42 -08:00
smb2pdu.h Convert MessageID in smb2_hdr to LE 2014-12-14 14:55:45 -06:00
smb2proto.h mfsymlinks support for SMB2.1/SMB3. Part 2 query symlink 2014-10-16 15:20:20 -05:00
smb2status.h
smb2transport.c Convert MessageID in smb2_hdr to LE 2014-12-14 14:55:45 -06:00
smbencrypt.c cifs: use memzero_explicit to clear stack buffer 2015-01-19 15:32:13 -06:00
smberr.h
smbfsctl.h enable fallocate punch hole ("fallocate -p") for SMB3 2014-08-17 18:12:38 -05:00
transport.c cifs: convert printk(LEVEL...) to pr_<level> 2014-12-07 22:48:07 -06:00
winucase.c [CIFS] quiet sparse compile warning 2013-09-08 14:54:24 -05:00
xattr.c Remap reserved posix characters by default (part 3/3) 2014-10-16 15:20:20 -05:00