From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F49238AC8C for ; Fri, 3 Apr 2026 09:08:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.132 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775207294; cv=none; b=jub9cl5lLKjE3E/Ve/VAmpRa4fQZagnRfm6dssaG0yWq+9t8QiWkV2s/4hMs4xRJz9Qf+CKWtNsbIUIQAB6ygSNIOlYs8L6fPZSWy159dQTOdkEks802gEaYhx+NYzEw9TvNgPrd7aRdiLahVW8HV4ub9lJJdRaRjuFChYjtahA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775207294; c=relaxed/simple; bh=9kuk44SM25nMs/1+zgEYpPfIKfNAvjiTqEybT+vzrXU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UYf1a0+UMprBfLyv3/ArMRuwF2c0/SLTtHlx5+7VdwOFFalnCfhODB8EukcM2wZIRXpfbSu5FHnN6AjlVfq4K80r8AZS6CVmlEB9Ird7utKJTBAYBOf8LOYZUMGkyGCBT2Bd/ZZk0OWW3FPFlNPL/i3Z8b06afmz3P0rtioF86s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=NApkv7vP; arc=none smtp.client-ip=115.124.30.132 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="NApkv7vP" DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1775207289; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=9u4i4CuYLhmblA3aqm/e9wXf2wX7ubkTsct3lQ7y2BQ=; b=NApkv7vPupscJMZt6A3ZMVK7jiZyd5RSTD9y+VE8g0w6qI5CqH5Kg0R9EoklP91SYVRpNyT0qYEDKLmvmqE2oUbY7yYRsvaJxnTBFb3ol9HxwYwSG0FFnbeepY9sjfCaq83tqtF9S06ojVaPwsrtWrCPXqcX1n1DpndZwWHhRNI= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R641e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037009110;MF=joseph.qi@linux.alibaba.com;NM=1;PH=DS;RN=5;SR=0;TI=SMTPD_---0X0JsYHD_1775207287; Received: from localhost(mailfrom:joseph.qi@linux.alibaba.com fp:SMTPD_---0X0JsYHD_1775207287 cluster:ay36) by smtp.aliyun-inc.com; Fri, 03 Apr 2026 17:08:08 +0800 From: Joseph Qi To: Andrew Morton , Heming Zhao , ZhengYuan Huang Cc: ocfs2-devel@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] ocfs2: remove redundant l_next_free_rec check in __ocfs2_find_path() Date: Fri, 3 Apr 2026 17:08:03 +0800 Message-Id: <20260403090803.3860971-5-joseph.qi@linux.alibaba.com> X-Mailer: git-send-email 2.39.3 In-Reply-To: <20260403090803.3860971-1-joseph.qi@linux.alibaba.com> References: <20260403090803.3860971-1-joseph.qi@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The l_next_free_rec > l_count check after ocfs2_read_extent_block() in __ocfs2_find_path() is now redundant, as ocfs2_validate_extent_block() already performs this validation at block read time. Remove the duplicate check to avoid maintaining the same validation in two places. Signed-off-by: Joseph Qi --- fs/ocfs2/alloc.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 8639806bcbb8..08e137928080 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -1878,18 +1878,6 @@ static int __ocfs2_find_path(struct ocfs2_caching_info *ci, eb = (struct ocfs2_extent_block *) bh->b_data; el = &eb->h_list; - if (le16_to_cpu(el->l_next_free_rec) > - le16_to_cpu(el->l_count)) { - ocfs2_error(ocfs2_metadata_cache_get_super(ci), - "Owner %llu has bad count in extent list at block %llu (next free=%u, count=%u)\n", - (unsigned long long)ocfs2_metadata_cache_owner(ci), - (unsigned long long)bh->b_blocknr, - le16_to_cpu(el->l_next_free_rec), - le16_to_cpu(el->l_count)); - ret = -EROFS; - goto out; - } - if (func) func(data, bh); } -- 2.39.3