Patch "cifs: Fix missing put_xid in cifs_file_strict_mmap" has been added to the 3.18-stable tree
This is a note to let you know that I've just added the patch titled
cifs: Fix missing put_xid in cifs_file_strict_mmap
to the 3.18-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
cifs-fix-missing-put_xid-in-cifs_file_strict_mmap.patch
and it can be found in the queue-3.18 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
f04a703c3d613845ae3141bfaf223489de8ab3ebMon Sep 17 00:00:00 2001
From: Matthew Wilcox <[email protected]>
Date: Fri, 15 Dec 2017 12:48:32 -0800
Subject: cifs: Fix missing put_xid in cifs_file_strict_mmap
From: Matthew Wilcox <[email protected]>
commit f04a703c3d613845ae3141bfaf223489de8ab3eb upstream.
If cifs_zap_mapping() returned an error, we would return without putting the xid that we got earlier. Restructure cifs_file_strict_mmap() and cifs_file_mmap() to be more similar to each other and have a single point of return that always puts the xid.
--- fs/cifs/file.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)
fs/cifs/file.c +12 -14
@@ -3261,20 +3261,18 @@ static struct vm_operations_struct cifs_int cifs_file_strict_mmap (struct file *file,struct vm_area_struct *vma) { -int rc, xid; +int xid, rc =0 ;struct inode *inode =file_inode (file); xid =get_xid (); -if (!CIFS_CACHE_READ (CIFS_I (inode))) { +if (!CIFS_CACHE_READ (CIFS_I (inode))) rc =cifs_zap_mapping (inode); -if (rc) -return rc; - } - - rc =generic_file_mmap (file, vma); -if (rc ==0 ) +if (!rc) + rc =generic_file_mmap (file, vma); +if (!rc) vma->vm_ops = &cifs_file_vm_ops; +free_xid (xid);return rc; }
@@ -3284,16 +3282,16 @@ int cifs_file_mmap(struct file *file, stint rc, xid; xid =get_xid (); + rc =cifs_revalidate_file (file); -if (rc) { +if (rc)cifs_dbg (FYI ,"Validation prior to mmap failed, error=%d\n" , rc); -free_xid (xid); -return rc; - } - rc =generic_file_mmap (file, vma); -if (rc ==0 ) +if (!rc) + rc =generic_file_mmap (file, vma); +if (!rc) vma->vm_ops = &cifs_file_vm_ops; +free_xid (xid);return rc; }
Patches currently in stable-queue which might be from [email protected] are
queue-3.18/cifs-fix-missing-put_xid-in-cifs_file_strict_mmap.patch