Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp508388pxb; Mon, 7 Feb 2022 17:16:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+jWN56WzhuM7SBOyfo0M/HNmW5CK4w1NyfDHWboNeY5waM6X8J3/ZH/XHH9fqYQuFHAuL X-Received: by 2002:aa7:c04e:: with SMTP id k14mr2095665edo.131.1644282964853; Mon, 07 Feb 2022 17:16:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644282964; cv=none; d=google.com; s=arc-20160816; b=cfmq/zjJE8nM4UlMl6ow7OheREdfFatXk7NWN8Bg76kAngNuaJADf2e6fAAUYCMPc/ KNEbsEXNkAN0kj1gbi/UPVmQdmOtHlIspQUUQa1X+oQ3RvrWO5Kk5fXXZIl7gsK7LScR 4WOoL/PJZLZx4IHcIHnpXwtSkcFBuKZP7e2MZUXguElwFLwEgo69gfFAMGAt5/xOw/CM lNgRw97IQJpOBFm3xUvSQKopBbwpa0XnjD/1Mug3qxfR3sa5HfcfS8BF71SUKIFHOlY4 8VMxhhVO0FYgW3h4qRjQoKk5v1beq/ZOHfpV6x5sWjdkAXBvW/fGDK9cD2p2SLTlMwId RYUg== 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=6RisJZ8b8EPVQ7pfozdxNwp19nb/lmVtKodGngXI8S8=; b=Vvtn+JNF/Kk4JTn5Fb9IQVzbEBwNB4Sz6aEi5D6Zpy5LiDs1mGOw6BrEnx6cUd9n9W TVbnDQxGiqeAcIKTN/ZQ5wuKcHlxfg+0I7uJzIISGPfP4UMTiifGr+fBWKMDb6mguzRR 4yvj3+5SKX1blNTyNSo1Qq3UX4G7yUklk8HsqQgqK0pFwCd8HccguBVarSQ3VKC1pf6H 56epYsWOvmyii6WPRAkUVgjQWmqh9KKbVKR5UPgvUb1s/Ko5+ktYraENjSM7dKRR4wmZ QzuEsiPVuiQF8DcEVsgUVA5IYbGcQ8DMOvMYDfkzn4Q6Awokx12TAG6mtf0dkFP47oye Xs9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="F58l/veJ"; 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 nc37si9092632ejc.697.2022.02.07.17.15.40; Mon, 07 Feb 2022 17:16:04 -0800 (PST) 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="F58l/veJ"; 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 S229706AbiBGQwO (ORCPT + 99 others); Mon, 7 Feb 2022 11:52:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239932AbiBGQmn (ORCPT ); Mon, 7 Feb 2022 11:42:43 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2D09C0401D1; Mon, 7 Feb 2022 08:42:42 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 900B2210E5; Mon, 7 Feb 2022 16:42:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1644252161; 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=6RisJZ8b8EPVQ7pfozdxNwp19nb/lmVtKodGngXI8S8=; b=F58l/veJoWTL2z72iEyV6iGWuis9mwljKYfdl5pqHuW+DwbsWiE4SI395AXfh9vGVbCzM7 8M5Mb+Jnv2ESGaoe2F9Ervxpzl+XyCgYwXQYSWZBdrPWnQb7L2610+hNdnhfbwctNcAoFw SBALq/bNzIaV1N4eCb4cInJqRpUoKmM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1644252161; 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=6RisJZ8b8EPVQ7pfozdxNwp19nb/lmVtKodGngXI8S8=; b=0iZkcePax3j41qylhopB4xFUEZuGe2YtQARUujCYmoxn6WqLpYGYfzNbgqupMsUzOqvtJj /DtnVQQc+3aydtDQ== Received: from quack3.suse.cz (unknown [10.100.224.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 8281BA3B84; Mon, 7 Feb 2022 16:42:41 +0000 (UTC) Received: by quack3.suse.cz (Postfix, from userid 1000) id 2AEBDA05BB; Mon, 7 Feb 2022 17:42:41 +0100 (CET) Date: Mon, 7 Feb 2022 17:42:41 +0100 From: Jan Kara To: Ritesh Harjani Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, Theodore Ts'o , Jan Kara , Harshad Shirwadkar Subject: Re: [PATCHv1 7/9] ext4: Add ext4_sb_block_valid() refactored out of ext4_inode_block_valid() Message-ID: <20220207164241.voulrwcz4ib2ujoz@quack3.lan> References: <1c5fae30be49b5116e4e5604e6224b33b778feaf.1644062450.git.riteshh@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1c5fae30be49b5116e4e5604e6224b33b778feaf.1644062450.git.riteshh@linux.ibm.com> X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,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 Sat 05-02-22 19:39:56, Ritesh Harjani wrote: > This API will be needed at places where we don't have an inode > for e.g. while freeing blocks in ext4_group_add_blocks() > > Suggested-by: Jan Kara > Signed-off-by: Ritesh Harjani ... > @@ -329,7 +324,8 @@ int ext4_inode_block_valid(struct inode *inode, ext4_fsblk_t start_blk, > else if (start_blk >= (entry->start_blk + entry->count)) > n = n->rb_right; > else { > - ret = (entry->ino == inode->i_ino); > + if (inode) > + ret = (entry->ino == inode->i_ino); > break; In case inode is not passed, we must not overlap any entry in the rbtree. So we should return 0, not 1. Honza -- Jan Kara SUSE Labs, CR