From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:59796 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932728AbeB1PZX (ORCPT ); Wed, 28 Feb 2018 10:25:23 -0500 Subject: Patch "afs: Fix missing error handling in afs_write_end()" has been added to the 4.14-stable tree To: dhowells@redhat.com, alexander.levin@verizon.com, gregkh@linuxfoundation.org, viro@zeniv.linux.org.uk Cc: , From: Date: Wed, 28 Feb 2018 16:25:23 +0100 Message-ID: <1519831523209216@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled afs: Fix missing error handling in afs_write_end() to the 4.14-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: afs-fix-missing-error-handling-in-afs_write_end.patch and it can be found in the queue-4.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Wed Feb 28 16:23:28 CET 2018 From: David Howells Date: Tue, 2 Jan 2018 10:02:19 +0000 Subject: afs: Fix missing error handling in afs_write_end() From: David Howells [ Upstream commit afae457d874860a7e299d334f59eede5f3ad4b47 ] afs_write_end() is missing page unlock and put if afs_fill_page() fails. Reported-by: Al Viro Signed-off-by: David Howells Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/afs/write.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -282,7 +282,7 @@ int afs_write_end(struct file *file, str ret = afs_fill_page(vnode, key, pos + copied, len - copied, page); if (ret < 0) - return ret; + goto out; } SetPageUptodate(page); } @@ -290,10 +290,12 @@ int afs_write_end(struct file *file, str set_page_dirty(page); if (PageDirty(page)) _debug("dirtied"); + ret = copied; + +out: unlock_page(page); put_page(page); - - return copied; + return ret; } /* Patches currently in stable-queue which might be from dhowells@redhat.com are queue-4.14/afs-fix-missing-error-handling-in-afs_write_end.patch