Received: by 10.223.176.5 with SMTP id f5csp806306wra; Sat, 3 Feb 2018 10:42:50 -0800 (PST) X-Google-Smtp-Source: AH8x225Eckl1C8KeG71HTXZ2jxdKTV56ZMtRapITtkWiZBeyLHCseJGhOrdTIKqK4gNWw3o1VTWa X-Received: by 10.98.57.27 with SMTP id g27mr44393403pfa.128.1517683370426; Sat, 03 Feb 2018 10:42:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517683370; cv=none; d=google.com; s=arc-20160816; b=Q0gIVrKI/qYapOr4NXWYlUmGByR3YBwVrwPJXeuGjh+QrOM9Y7e35KFZO+50AdkmYx 1Byzar0dq5m7+MuQ3vcMLGToDCAvfwUbcmK5CzR4dXTzhboSkHDOQmorfYdDwOLry/0P 5NLNVikbr1+KvD6c/KpxCA0gKvnOHIwznkBmTPAyapYGtFQ2vDb0aFM3ioQDU2Lu2g1X GZ1ih5zCx+I5tLhmiLXz5f3RnMOObnTZ+AevZeeJDjNU8WAvYDa7sS6RbITyACO56KxT KfwtGLpGbSNb8x962UUgvSkRLmTjVaEGCM8Rp8BlDew+dTt2zP2F/GMJjkbPG79U8sy8 Sh0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=Se3NQ+ZVaqnKySBCnENBEhKu764a02lx6KuG9plX+vI=; b=l6nMm6RKEw68XSFtNQPTn+iEOIgb6pFVzPevPVaNsep6d+9vg6m2EwOLtDrHqOZ2PL qFWXxQpHNNAsZoVY2uG/zyedljBxal0KdCDdwVQDoeDC4zkr8zdoVkN1hqt6Czg/WxHo PSCMhNLVCW0WyLdMM5I+ZLF8W0m+PUOVroO3BQ1elujg1BrnNfVpFpNR3obzPiUYu/vw MWW5elbWaFOYHVT1YGlo9uQtlNb29rrd3mPDxy5KPgHszSurfNen6LPisYNavDYqQCmo fla1qHz4TSBmsLlr17dbfFUiwzrPh/4hYOMOT/64STCGOeJU1cMZr+9pHp2fWUTSrvz5 cwww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=BeF1XcqA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 36-v6si1657187pla.343.2018.02.03.10.42.36; Sat, 03 Feb 2018 10:42:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=BeF1XcqA; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755039AbeBCSli (ORCPT + 99 others); Sat, 3 Feb 2018 13:41:38 -0500 Received: from mail-by2nam03on0136.outbound.protection.outlook.com ([104.47.42.136]:45129 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753244AbeBCSD2 (ORCPT ); Sat, 3 Feb 2018 13:03:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Se3NQ+ZVaqnKySBCnENBEhKu764a02lx6KuG9plX+vI=; b=BeF1XcqAWB53RfjvTE8DEOD7IC4S22CzkiTYD+5MU2nxbostXGw7B4zwoN2YvB90C0sqt4zGjpxWKFLgYJ2FUuyMrm56VHwwf2l7m/27VmBJjM/HqhJyje6Uy4SkZpo/IKuMoc2/H1fDEq7bwZrLm5fxRWApgwXjG2hN6UN1CHc= Received: from BL0PR2101MB1027.namprd21.prod.outlook.com (52.132.20.161) by BL0PR2101MB1105.namprd21.prod.outlook.com (52.132.24.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.485.5; Sat, 3 Feb 2018 18:02:05 +0000 Received: from BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9]) by BL0PR2101MB1027.namprd21.prod.outlook.com ([fe80::a8da:b5d9:d710:9bf9%3]) with mapi id 15.20.0485.006; Sat, 3 Feb 2018 18:02:05 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: David Howells , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 068/110] afs: Fix missing error handling in afs_write_end() Thread-Topic: [PATCH AUTOSEL for 4.14 068/110] afs: Fix missing error handling in afs_write_end() Thread-Index: AQHTnRjzRINjaCinU02VytHpalYPcw== Date: Sat, 3 Feb 2018 18:01:01 +0000 Message-ID: <20180203180015.29073-68-alexander.levin@microsoft.com> References: <20180203180015.29073-1-alexander.levin@microsoft.com> In-Reply-To: <20180203180015.29073-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BL0PR2101MB1105;6:FD4B62RWiKkFPNdynaMOrJe4yX4UGnULrO+kksGae1UiYmm6WfK/7W+mEygCkvyzojymUR2vUAKbhcp6GbtCcV757AqLP7pHfY3We4sQIQNWlla+SCmfQX424hxpCxLyCGI/qvgGZ5EPH9j9K374EE3TSKWTYwpmQQYqBn8ohErP9+ywwSQv+73EAGtLO0RLhFDZ/YcNBueLf+oO2+E3KrJnXyGSN0dGQHr88wx5utOwHit+DiwawqjEjAyTT7T8XCQv+y4B0o6LFe7OP22AnHA6Oaq6o+/uSnzWnQhfoMZlAPktBI2Nv1I+khoDIPbf3eGVODwaI5r5qVXGO0RXp3amwI34XAKWhYjo5Iuj48opy8CXO3LdL/j1DxJDBtL5;5:uh2IAMdIP4XSjVez1PbSRRGjelsacFuv+QYL5dx1vg4Vux4+2Zbyl9TvjZU5TmeVLzbYm+yFecD5U9TUv0IBcT5ZWGKQ1+D5gjfiVuGN29dIQHe1nka9G25fDaGSRTR2ujrT0rwAm3M7m8KtN2YDvnvg6crKlGr5BbEcyUuWqZs=;24:8bd6VHeNMzUrk80PUX8zh6pyhtDlnrJ+qnGqwAZfVQQzek9cIM3qRHdaoKk7/MK1BPsKV6sMmnNjINsx0GHLl6HseO35/+/Y2ldbcLXARwg=;7:h2TS0liL63xJh3f2lVFM+dp5Qr6ANACQ972dJWgj7uJBPbsAxlr82prqwcfiMwX4nrV7QMsfG2VzcoEOUpp361z9YgiQIEllLvkL1wC1EPKe5AnQV2VlYNl/nCmvyc3dyCtZhjmeTjHRlJS+4GY/Hg8pqZm3qH2Fht3PVpI43/BOhteOI5e3CKQx5fNpmacWJr7rY40ll8LW6uWmagPc/9FWjrKtaZZUqqU2DmEOGRRQWdeiQsbo55lYbneDCKsC x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: b53e8200-aa19-4dbd-5b6d-08d56b303c75 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(2017052603307)(7193020);SRVR:BL0PR2101MB1105; x-ms-traffictypediagnostic: BL0PR2101MB1105: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(3002001)(10201501046)(3231101)(2400082)(944501161)(93006095)(93001095)(6055026)(61426038)(61427038)(6041288)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(6072148)(201708071742011);SRVR:BL0PR2101MB1105;BCL:0;PCL:0;RULEID:;SRVR:BL0PR2101MB1105; x-forefront-prvs: 05724A8921 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(979002)(366004)(396003)(39380400002)(39860400002)(346002)(376002)(199004)(189003)(6346003)(97736004)(6512007)(7736002)(26005)(305945005)(102836004)(105586002)(68736007)(5250100002)(8936002)(6486002)(6436002)(106356001)(6506007)(81166006)(81156014)(2501003)(2906002)(10090500001)(99286004)(66066001)(54906003)(6116002)(3846002)(36756003)(1076002)(8676002)(110136005)(107886003)(72206003)(2950100002)(478600001)(10290500003)(22452003)(6666003)(5660300001)(2900100001)(4326008)(25786009)(14454004)(316002)(86362001)(53936002)(3280700002)(186003)(3660700001)(76176011)(86612001)(22906009)(217873001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:BL0PR2101MB1105;H:BL0PR2101MB1027.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: bQtvU8kjbqf7wX3F3tcQS9jkW36u224p+rSvIVtBO4EjIUEkQ2wJZes/dYu4EewIDDzVqeQccJrhRG6Ew/JmNQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: b53e8200-aa19-4dbd-5b6d-08d56b303c75 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Feb 2018 18:01:01.1284 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR2101MB1105 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- fs/afs/write.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/afs/write.c b/fs/afs/write.c index 106e43db1115..926d4d68f791 100644 --- a/fs/afs/write.c +++ b/fs/afs/write.c @@ -282,7 +282,7 @@ int afs_write_end(struct file *file, struct address_spa= ce *mapping, ret =3D 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, struct address_s= pace *mapping, set_page_dirty(page); if (PageDirty(page)) _debug("dirtied"); + ret =3D copied; + +out: unlock_page(page); put_page(page); - - return copied; + return ret; } =20 /* --=20 2.11.0