From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A51ACD13DA for ; Mon, 18 Sep 2023 15:33:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229554AbjIRPcm (ORCPT ); Mon, 18 Sep 2023 11:32:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229658AbjIRPc3 (ORCPT ); Mon, 18 Sep 2023 11:32:29 -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 AF88C1A4 for ; Mon, 18 Sep 2023 08:30:29 -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 E11A021D7D; Mon, 18 Sep 2023 14:51:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1695048670; 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=HeG7t4jPjVdwTATY9Lqi6Oc/lm1AxloZs65Tey4YBHQ=; b=whyWmOm9kzZ3bTqA+X1QwRDVRdZEmu/zVW5fi8P+z8Wy42gCLYZpsoOsmR68xQNtkSI4Nm ELhE7HC3kCKsT1Ynmu6m37B1BkP7FfPlJeQq3l2gTF4+HALwTL1rQb+75e7ZtnoYp51+ON 2igznxrpBV09GDmNqFVqOsVTNltKQBA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1695048670; 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=HeG7t4jPjVdwTATY9Lqi6Oc/lm1AxloZs65Tey4YBHQ=; b=z3qryaUwbIkEylkxO2rFZJ8ojxYGHJwLJnoMFzOsZsHcvYA9O7bb6V96UFjf0UvW2LXB55 ND/M4x0k+u6lwaCw== 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 D476D1358A; Mon, 18 Sep 2023 14:51:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jQzTM95jCGXWRQAAMHmgww (envelope-from ); Mon, 18 Sep 2023 14:51:10 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 55A6EA0759; Mon, 18 Sep 2023 16:51:10 +0200 (CEST) Date: Mon, 18 Sep 2023 16:51:10 +0200 From: Jan Kara To: Wang Jianjian Cc: linux-ext4@vger.kernel.org Subject: Re: [PATCH] ext4: Fix incorrect offset Message-ID: <20230918145110.nzma56rirpw3hpg7@quack3> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu 24-08-23 23:23:24, Wang Jianjian wrote: > The last argumen of ext4_check_dir_entry is dentry offset ^^^ argument > int the file. ^^ in the directory Maybe you could also add to the changelog: Luckily this error only results in the wrong offset being printed in the eventual error message. > Signed-off-by: Wang Jianjian Otherwise the fix looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/ext4/namei.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c > index 94608b7df7e8..33ebd35025bf 100644 > --- a/fs/ext4/namei.c > +++ b/fs/ext4/namei.c > @@ -2261,8 +2261,7 @@ static int make_indexed_dir(handle_t *handle, struct ext4_filename *fname, > top = data2 + len; > while ((char *)(de2 = ext4_next_entry(de, blocksize)) < top) { > if (ext4_check_dir_entry(dir, NULL, de, bh2, data2, len, > - (data2 + (blocksize - csum_size) - > - (char *) de))) { > + (char *)de - data2)) { > brelse(bh2); > brelse(bh); > return -EFSCORRUPTED; > -- > 2.34.3 > -- Jan Kara SUSE Labs, CR