Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp226641rdb; Mon, 18 Sep 2023 13:08:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IElBRLMpcNpj6MOWH13j4lVTTe5TkCeOsLDCIS4nhmwgknhuqjOQJGw1pl3oUQBBnbLFtH+ X-Received: by 2002:a05:6a21:a588:b0:140:6d68:ce07 with SMTP id gd8-20020a056a21a58800b001406d68ce07mr14712040pzc.52.1695067692401; Mon, 18 Sep 2023 13:08:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695067692; cv=none; d=google.com; s=arc-20160816; b=ypi8CFna0NGBrXYjyGpiuNtnWaBQRw3G/9C99u6h7e24VZ3MAkHBR/ElXtZEXHny6J 0AGuDHsSbUpG2tCMIONTlqBCxL/VqQ47qNewibHn5P2AYXdyC0Qn/2W8EOOPI1Z2lRuh DR3+Y1B2GGZfbyUZq/oxbJEe4cZ0CBJgzX77YLvnmbDPm+OfNx6b0H+rFKFzbjVft5sX EA8BLxXEFDLPSUD7GerP82T1SJdHSAEu4vivoRn6A8H/RTKMzJh0KS+22mj35P6fqkHC VZZ37c2AnZedLadlJEtpU+C1eZNbgNRrEDBUExVoxDAUT01PT6Qw+ozYeS7HN76e6HEk nG+Q== 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=HeG7t4jPjVdwTATY9Lqi6Oc/lm1AxloZs65Tey4YBHQ=; fh=0/C3+2TrUSeLoozJV7CGHvb6kH5PmLUS8jpw68kCEOE=; b=A3Uh0TVvmz5OXP+pFt6MChjyU0LStQkJQXdh9kUD3HGQMf2SinvgbSuCcORorK2IQ4 0pAZJIAM4W33ZHYng0uNf3g2aQA+JLkwLIYA+th8X0DkjjwoMhPBpO08A1Tg46QVmL6Y duvjZGrnVKslnLRO0LyLbTbGvTWF2Bt6cRAUHOwPax6djArSGXtfwG1405xCZ/yZJUdA crkLT1I+iplNNaC16Imy9zppElOV/CkaCnaApO6vb5FCWzMaZXcwQGwWkzbc0vpFe2lM tcmpH6e1DGFA5/kv/dOOxZ/C2jN71Yadt5q0n3VRFE4hVsvqbZxYBTipzf4/v7FpCEp+ l8iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=whyWmOm9; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id s8-20020a656448000000b00543eeb76c52si8245300pgv.756.2023.09.18.13.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:08:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=whyWmOm9; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id F2382813CDAB; Mon, 18 Sep 2023 08:33:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229445AbjIRPcl (ORCPT + 99 others); Mon, 18 Sep 2023 11:32:41 -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: 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_BLOCKED, 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 18 Sep 2023 08:33:07 -0700 (PDT) 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