Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp696825rwe; Thu, 1 Sep 2022 06:25:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR4jTE4EzAs2T9hNEMVV3NEENLQmuGq9nlekXaVLpk5z84jLPiAGSySXsh+j7yBhsbeTi7KY X-Received: by 2002:a17:907:60c7:b0:739:52ba:cbd0 with SMTP id hv7-20020a17090760c700b0073952bacbd0mr24037235ejc.152.1662038745355; Thu, 01 Sep 2022 06:25:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662038745; cv=none; d=google.com; s=arc-20160816; b=biasgxhwi9kgMLk5urz098HNIOd3RH/g8eEzxGLqrJ9bnSfyOEQVwI2VvtsBU1qzFi W0qTIVpjslWHlLh7OmkY/UiyUz7xMmpIAz89DjFUsHi7k7jLvzLKV11xJfHcA7pzuFoX iv6dM5pOtbB/r9qe9EArJybG9q9dSeY1a/FiCnqQVkWanIhy9uG2Sm1YN23nF6KEp/T3 ZaB4RTrzudab5dnrKZf6sYzgWHTuGME99ZBtHDqPxTi0RhDTDknhz2qsB1KyjiYDODzj Fku8+IH2nTz1XAj7sS7jG8zfCBQ7eJzH20/B4MKRSqcEDQoACeMgJ/kz5HjtM0bJfe/b ELXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=R0uXiA+gyyun+T+Hfd82TQYI28PlsdP2i+aqXg5D6iI=; b=Ijoq9f3K7KvgUBN+gMjmCWPtN+w/OnbtH/Ih/gmZrBqzn+Z92o7AL8Fi+HhlJfCu2Y eg1sV1e25npdO+6m/1f81bQO8jLDWu0GrKcO+LdJpugefBsS79EWmswIBV+9RtXluw1+ pxaFXME5sbSH9ImQAX5PmEGxDyC/UFH6fyRpmCjJMW8PbVs3qIPo76if7qhPf7bPuhgH 0nwZhW5uWgQZXAYH2elMdm09/P9y32M59wwm5cnQKeWO2qNRsXHbsFeTr9AlOUlx/3tS Rid3qICR4m+Tq1TuzbAPL1UW/6jgQqmWJcjPvUbDCU8o4SCX4FLK4BHBUgYlIi7isGtp 3KhA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eh14-20020a0564020f8e00b00445db0fa9cfsi1501744edb.284.2022.09.01.06.25.20; Thu, 01 Sep 2022 06:25:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234462AbiIANYx (ORCPT + 99 others); Thu, 1 Sep 2022 09:24:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234310AbiIANYP (ORCPT ); Thu, 1 Sep 2022 09:24:15 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86AA1FD22; Thu, 1 Sep 2022 06:24:07 -0700 (PDT) Received: from canpemm500005.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MJM9d6LJkzlWcl; Thu, 1 Sep 2022 21:20:37 +0800 (CST) Received: from huawei.com (10.175.127.227) by canpemm500005.china.huawei.com (7.192.104.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 1 Sep 2022 21:24:03 +0800 From: Zhang Yi To: , , , , , , , CC: , , , , , , , , , , , , Subject: [PATCH v2 07/14] ntfs3: replace ll_rw_block() Date: Thu, 1 Sep 2022 21:34:58 +0800 Message-ID: <20220901133505.2510834-8-yi.zhang@huawei.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220901133505.2510834-1-yi.zhang@huawei.com> References: <20220901133505.2510834-1-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500005.china.huawei.com (7.192.104.229) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org ll_rw_block() is not safe for the sync read path because it cannot guarantee that submitting read IO if the buffer has been locked. We could get false positive EIO after wait_on_buffer() if the buffer has been locked by others. So stop using ll_rw_block() in ntfs_get_block_vbo(). Signed-off-by: Zhang Yi --- fs/ntfs3/inode.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index 51363d4e8636..cadbfa111539 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -630,12 +630,9 @@ static noinline int ntfs_get_block_vbo(struct inode *inode, u64 vbo, bh->b_size = block_size; off = vbo & (PAGE_SIZE - 1); set_bh_page(bh, page, off); - ll_rw_block(REQ_OP_READ, 1, &bh); - wait_on_buffer(bh); - if (!buffer_uptodate(bh)) { - err = -EIO; + err = bh_read(bh, 0); + if (err < 0) goto out; - } zero_user_segment(page, off + voff, off + block_size); } } -- 2.31.1