Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp1977343rwb; Thu, 29 Sep 2022 04:51:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4SDQn9w0J3IwlUhvXRDMx6oyOiSB80QXPr10UUkId3E00yMc5OHdzS1WKStU5bGx3PbWQe X-Received: by 2002:a17:907:b0e:b0:77a:d97d:9afc with SMTP id h14-20020a1709070b0e00b0077ad97d9afcmr2376202ejl.199.1664452288470; Thu, 29 Sep 2022 04:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664452288; cv=none; d=google.com; s=arc-20160816; b=PObHGzjBfwMAtTWDd/boGhrnpQJHUC9MnCf/+94V1wGSlM4lXLDqKKeJwrThY18yl3 xQy2ltFw8oe85E9mrhXOy1WqvPyDyLDoqNxEFyNIa2tJc0IpHPI2wzNL4dzEXC9GxtID 7AUXq7KWE7xF5syAH0hV7o9xIA6E9gZyoddspa9ahb9jsjwYVgq1H2tGXRUHIlfvxQga vFC9gFjxrtWVmu5MS/waujnvk1y+u2otQlDkBcptEacGP07hsbnnrglGbaUF6UtEhAOg F+hss0RKiD7281UEBhRdUaCLqK+6dFfgkIzvdGKCoMv9Ad1ALqB6pFJCCoSsEtnI0naB jOJg== 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=6O4FPnXSlhjPq+S068RqZ2q0RwWz5vWZUIecrgaOBnk=; b=mvGNXEkDY9wdqcGC62z+PCzSuobsksxBbIfJln9XaSJ0A4CIIz2o+zPwGil7LTdQ6n HSNxJ2n1f9mVEkuL7pqn5lQ3wVVCe3LQExZVi9NxLbiMj1bT+vIZZkx5QHITpg78S7KL p3yXboXi3Z9neYrh6PR0BbeWUQ2eUhVSvtQ4z1iDVYmy9WUBQivlqJKi1hq38J1afKja jzZzPDA3pYbw1lAmf76WeImmx9UBc13c/EEz1oj/IDxeqxLTH6eycTsSVznDvXIf044v wwfCUtH7eoG/npPhwM6dKKXKcNY87TrWfH8PoyS6mFSye6XPut23n5qr0WhFKmTod319 okzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=oGFezCy3; 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 y18-20020a056402359200b0045815457fc0si2418761edc.542.2022.09.29.04.51.03; Thu, 29 Sep 2022 04:51:28 -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=oGFezCy3; 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 S234756AbiI2LZD (ORCPT + 99 others); Thu, 29 Sep 2022 07:25:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234315AbiI2LY7 (ORCPT ); Thu, 29 Sep 2022 07:24:59 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CD4212EDB1; Thu, 29 Sep 2022 04:24:56 -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 7FBD921AC4; Thu, 29 Sep 2022 11:24:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1664450695; 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=6O4FPnXSlhjPq+S068RqZ2q0RwWz5vWZUIecrgaOBnk=; b=oGFezCy3MFwxgCctvsgzqD9ZEPfsorkpC+wmGy3FrJLYgIlzRBcASTAnvNNdMpfN3ZRXKA 1bcd83PsfrQz9b1K7d1e5F9CkLpJetS2TyH25is7b61It6CN0ggFlRqyvQSvcHVaffWYxO sa5SgUCdipZBHeh5iGf4HJmxmo7U5FA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1664450695; 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=6O4FPnXSlhjPq+S068RqZ2q0RwWz5vWZUIecrgaOBnk=; b=U9k5yAA0xsbygtnTyyi2TTkEMojGuGrwMPKqbPcFBuQYtHC49PzJQ9XKbev8AKfWjQ0xhy ujaONt/OcKzzRwAA== 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 6E6CD1348E; Thu, 29 Sep 2022 11:24:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id WZzpGoeANWNcbQAAMHmgww (envelope-from ); Thu, 29 Sep 2022 11:24:55 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 02DCEA0681; Thu, 29 Sep 2022 13:24:54 +0200 (CEST) Date: Thu, 29 Sep 2022 13:24:54 +0200 From: Jan Kara To: Ojaswin Mujoo Cc: linux-ext4@vger.kernel.org, Theodore Ts'o , Ritesh Harjani , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Andreas Dilger , Jan Kara , rookxu , Ritesh Harjani Subject: Re: [RFC v3 1/8] ext4: Stop searching if PA doesn't satisfy non-extent file Message-ID: <20220929112454.ribbghdrz3qvyy2b@quack3> References: <113e30014fdcf409680e20ec1ef4455ace33884d.1664269665.git.ojaswin@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <113e30014fdcf409680e20ec1ef4455ace33884d.1664269665.git.ojaswin@linux.ibm.com> X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no 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 Tue 27-09-22 14:46:41, Ojaswin Mujoo wrote: > If we come across a PA that matches the logical offset but is unable to > satisfy a non-extent file due to its physical start being higher than > that supported by non extent files, then simply stop searching for > another PA and break out of loop. This is because, since PAs don't > overlap, we won't be able to find another inode PA which can satisfy the > original request. > > Signed-off-by: Ojaswin Mujoo > Reviewed-by: Ritesh Harjani (IBM) Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/ext4/mballoc.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c > index 71f5b67d7f28..2e3eb632a216 100644 > --- a/fs/ext4/mballoc.c > +++ b/fs/ext4/mballoc.c > @@ -4383,8 +4383,13 @@ ext4_mb_use_preallocated(struct ext4_allocation_context *ac) > /* non-extent files can't have physical blocks past 2^32 */ > if (!(ext4_test_inode_flag(ac->ac_inode, EXT4_INODE_EXTENTS)) && > (pa->pa_pstart + EXT4_C2B(sbi, pa->pa_len) > > - EXT4_MAX_BLOCK_FILE_PHYS)) > - continue; > + EXT4_MAX_BLOCK_FILE_PHYS)) { > + /* > + * Since PAs don't overlap, we won't find any > + * other PA to satisfy this. > + */ > + break; > + } > > /* found preallocated blocks, use them */ > spin_lock(&pa->pa_lock); > -- > 2.31.1 > -- Jan Kara SUSE Labs, CR