Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp889395rwe; Thu, 1 Sep 2022 09:06:20 -0700 (PDT) X-Google-Smtp-Source: AA6agR70qiC90tzjsUImx4fAnXY6OhjYF+zUdCizycz/Q7jMpZor9bNsMPrjB6gKHRCL4LC2aewF X-Received: by 2002:a17:907:1c23:b0:741:8389:12e8 with SMTP id nc35-20020a1709071c2300b00741838912e8mr14526060ejc.131.1662048380210; Thu, 01 Sep 2022 09:06:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662048380; cv=none; d=google.com; s=arc-20160816; b=iSboJvrh7P4bod+z4kaSdTK67zKHkXhbOVx9mCCAGbLzLreVBwwZhpn7l6GsfAUPAL Pg4v3nvEeLHkY7ovA3/g5pqAwqM6ykb483k62/ixe6Bu/ITHiDR5kd+WmWk1xcLTp7Rw 5rhXthBI4mQik1pGxuNiSo+xpgzryKnx0tJP8hMJJsduLs/RchAPqlyH9mureBp/32OX VQ5dKn1vIoRvD2N+zAcj2HYGW6fAlxH4JUjOncx08HBUhmO54eCacpSnsZQs3bAAFLMv rDAHDgzhCNgrX2wB214HNOrU3FpdqW4l16ESCKcQzNlcjkrBaBjATw2kORAo1DkfMf/f SsLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=KBfsBLjkBk+MOp0nQfi/nmYmADNsHmXsxHUoLjnY3bA=; b=CJ79WNqinXYuVxj7UENAb4QE0VbJfM9dCp07YjEGd4otgzPkl43c8ASdTv8135+PhA mIw2rQUmYdRZ4/XbPfjHBIcNQGipImgpjU7/C4tOkOF2vKXBjcRBPvn/LOZezO8Swlqk ditCBfsm/LEzHUeH9Yl+2xOyHAdHP72pfrzjLAUUyZkbtMQROu2zG36FbT9FYKMNCT/e PP4oJqtetWcrwq3UFGaYxuG0/A9BcOjm3ObquQSuT2MO3eHagAAVhKMy5Za0Hf/bQlCy nbMXl8bYwgcXtsbL6db63e3fsxNF+dSlljTIsevuUewYfJZ4CWRVYiIhEalF15/SOJh6 gWbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=eTkuxs55; dkim=neutral (no key) header.i=@suse.cz; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ho37-20020a1709070ea500b007419f5496fdsi8881457ejc.406.2022.09.01.09.05.55; Thu, 01 Sep 2022 09:06:20 -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; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=eTkuxs55; dkim=neutral (no key) header.i=@suse.cz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234737AbiIAP7P (ORCPT + 99 others); Thu, 1 Sep 2022 11:59:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234733AbiIAP7P (ORCPT ); Thu, 1 Sep 2022 11:59:15 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC7DF8E0F8; Thu, 1 Sep 2022 08:59:13 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 6F8A321B35; Thu, 1 Sep 2022 15:59:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1662047952; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KBfsBLjkBk+MOp0nQfi/nmYmADNsHmXsxHUoLjnY3bA=; b=eTkuxs55IxFpE7hDRb6Zude0PNe42Rg2iDMXK6ovgOmLJ8ol+1hu0xPXSwQoqG9TGCaDc3 i42+WNdKtbB6Lfrn3L5KkY4OhWhqvQdspBys/xSEJGbnPDDd/Ub0fAQLxecq4hpNU8HyuG G6/KF4WT3KI1yrz/XlU9iNhXieN8XTA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1662047952; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KBfsBLjkBk+MOp0nQfi/nmYmADNsHmXsxHUoLjnY3bA=; b=Z4hcUx2ha2YSNK1fJxrz+uxnK+d2neX9kSNscLfnZg2OLnp020u8KVt2k2u2P+l6DPBLZE LGa6Pt9b/QN5juCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5C72C13A89; Thu, 1 Sep 2022 15:59:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id XmaNFtDWEGMSCAAAMHmgww (envelope-from ); Thu, 01 Sep 2022 15:59:12 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id E1C2BA067C; Thu, 1 Sep 2022 17:59:11 +0200 (CEST) Date: Thu, 1 Sep 2022 17:59:11 +0200 From: Jan Kara To: Zhang Yi Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, cluster-devel@redhat.com, ntfs3@lists.linux.dev, ocfs2-devel@oss.oracle.com, reiserfs-devel@vger.kernel.org, jack@suse.cz, tytso@mit.edu, akpm@linux-foundation.org, axboe@kernel.dk, viro@zeniv.linux.org.uk, rpeterso@redhat.com, agruenba@redhat.com, almaz.alexandrovich@paragon-software.com, mark@fasheh.com, dushistov@mail.ru, hch@infradead.org, chengzhihao1@huawei.com, yukuai3@huawei.com Subject: Re: [PATCH v2 11/14] ufs: replace ll_rw_block() Message-ID: <20220901155911.fbdsdn26kaj7ehjb@quack3> References: <20220901133505.2510834-1-yi.zhang@huawei.com> <20220901133505.2510834-12-yi.zhang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220901133505.2510834-12-yi.zhang@huawei.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 On Thu 01-09-22 21:35:02, Zhang Yi wrote: > 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 ufs. > > Signed-off-by: Zhang Yi Looks good to me. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/ufs/balloc.c | 12 ++++-------- > 1 file changed, 4 insertions(+), 8 deletions(-) > > diff --git a/fs/ufs/balloc.c b/fs/ufs/balloc.c > index bd810d8239f2..2436e3f82147 100644 > --- a/fs/ufs/balloc.c > +++ b/fs/ufs/balloc.c > @@ -295,14 +295,10 @@ static void ufs_change_blocknr(struct inode *inode, sector_t beg, > > if (!buffer_mapped(bh)) > map_bh(bh, inode->i_sb, oldb + pos); > - if (!buffer_uptodate(bh)) { > - ll_rw_block(REQ_OP_READ, 1, &bh); > - wait_on_buffer(bh); > - if (!buffer_uptodate(bh)) { > - ufs_error(inode->i_sb, __func__, > - "read of block failed\n"); > - break; > - } > + if (bh_read(bh, 0) < 0) { > + ufs_error(inode->i_sb, __func__, > + "read of block failed\n"); > + break; > } > > UFSD(" change from %llu to %llu, pos %u\n", > -- > 2.31.1 > -- Jan Kara SUSE Labs, CR