Message ID | 20190424043730.13683-2-chandan@linux.ibm.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Return-Path: <linux-fscrypt-owner@kernel.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 414681390 for <patchwork-linux-fscrypt@patchwork.kernel.org>; Wed, 24 Apr 2019 04:37:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3312E289F1 for <patchwork-linux-fscrypt@patchwork.kernel.org>; Wed, 24 Apr 2019 04:37:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2498528A29; Wed, 24 Apr 2019 04:37:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3A03289F1 for <patchwork-linux-fscrypt@patchwork.kernel.org>; Wed, 24 Apr 2019 04:37:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726458AbfDXEhA (ORCPT <rfc822;patchwork-linux-fscrypt@patchwork.kernel.org>); Wed, 24 Apr 2019 00:37:00 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59994 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726184AbfDXEhA (ORCPT <rfc822;linux-fscrypt@vger.kernel.org>); Wed, 24 Apr 2019 00:37:00 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x3O4XQEu013958 for <linux-fscrypt@vger.kernel.org>; Wed, 24 Apr 2019 00:36:59 -0400 Received: from e13.ny.us.ibm.com (e13.ny.us.ibm.com [129.33.205.203]) by mx0b-001b2d01.pphosted.com with ESMTP id 2s2f2d4ap3-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for <linux-fscrypt@vger.kernel.org>; Wed, 24 Apr 2019 00:36:58 -0400 Received: from localhost by e13.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for <linux-fscrypt@vger.kernel.org> from <chandan@linux.ibm.com>; Wed, 24 Apr 2019 05:36:51 +0100 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e13.ny.us.ibm.com (146.89.104.200) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 24 Apr 2019 05:36:47 +0100 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x3O4akkV28049564 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Apr 2019 04:36:46 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6AE11B205F; Wed, 24 Apr 2019 04:36:46 +0000 (GMT) Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0D286B2064; Wed, 24 Apr 2019 04:36:43 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.85.81.252]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 24 Apr 2019 04:36:42 +0000 (GMT) From: Chandan Rajendra <chandan@linux.ibm.com> To: linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-fscrypt@vger.kernel.org Cc: Chandan Rajendra <chandan@linux.ibm.com>, tytso@mit.edu, adilger.kernel@dilger.ca, ebiggers@kernel.org, jaegeuk@kernel.org, yuchao0@huawei.com Subject: [PATCH V1 01/14] ext4: Clear BH_Uptodate flag on decryption error Date: Wed, 24 Apr 2019 10:07:17 +0530 X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190424043730.13683-1-chandan@linux.ibm.com> References: <20190424043730.13683-1-chandan@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 19042404-0064-0000-0000-000003D026C9 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010984; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000285; SDB=6.01193533; UDB=6.00625685; IPR=6.00974357; MB=3.00026570; MTD=3.00000008; XFM=3.00000015; UTC=2019-04-24 04:36:50 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19042404-0065-0000-0000-00003D2EF9C2 Message-Id: <20190424043730.13683-2-chandan@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-04-24_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1904240038 Sender: linux-fscrypt-owner@vger.kernel.org Precedence: bulk List-ID: <linux-fscrypt.vger.kernel.org> X-Mailing-List: linux-fscrypt@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Consolidate Post read processing code
|
expand
|
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 3c2e7f5a6c84..05b258db8673 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -1225,11 +1225,15 @@ static int ext4_block_write_begin(struct page *page, loff_t pos, unsigned len, if (!buffer_uptodate(*wait_bh)) err = -EIO; } - if (unlikely(err)) + if (unlikely(err)) { page_zero_new_buffers(page, from, to); - else if (decrypt) + } else if (decrypt) { err = fscrypt_decrypt_page(page->mapping->host, page, PAGE_SIZE, 0, page->index); + if (err) + clear_buffer_uptodate(*wait_bh); + } + return err; } #endif
On an error return from fscrypt_decrypt_page(), ext4_block_write_begin() can return with the page's buffer_head marked with BH_Uptodate flag. This commit clears the BH_Uptodate flag in such cases. Signed-off-by: Chandan Rajendra <chandan@linux.ibm.com> --- fs/ext4/inode.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)