Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp357997rdb; Tue, 19 Dec 2023 21:25:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IH3XMy3hmCzT93nZj86SgO4mYT1K3rZuN8GsyTFV/Jh7ha9sGfjsRDqP+QXHV05ZqBktoPG X-Received: by 2002:a05:6e02:19cc:b0:35f:aaed:4018 with SMTP id r12-20020a056e0219cc00b0035faaed4018mr8141584ill.99.1703049905509; Tue, 19 Dec 2023 21:25:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703049905; cv=none; d=google.com; s=arc-20160816; b=P43kvqlDFsX19em6L7ralVujavGJ2H6d4BzlYtLlRmRwX3NVu9p8siJSFVO9Bqm6bL rJ0hkPdPTuEyM14mAIQPTWjtFi/67BYNWeH47kWF4OxKYj5ug4ikzuSU2PKxh3NlSKiA roF1k6fazW4EMn0RidPyiPIl1AJnwGHjvnvytI2kvtXJHTkmMzS2SGmXJTFPGR3qmspp DDmhI8Qem80Q+zMUfwe8FOGATcCdl0XBjXnqo2gyz4bugEaDzks2mv/gpxrQi0Kc7I+0 Qk0b7/nXAUJMPOvbSzYJu1jYcZDfQ4JURmPC4QM4Qo0c5tAmhm8Rxqf0t059x0r2zx9H kH8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=aTxmIqx/EoO7e4qwLoDzfnPzeeP6f7RKMsj+EAXwCHw=; fh=He0GXoZllJD17U7LIzj/tUgtEyuR3XF5jpOaZK1mJeU=; b=N39KMDA28fqzwUpmrXIAWW3EaVULnoNJIJ1GL0wvC/Q1jAYX0aLuk4LVVVsWxhS7fO 9AH6IYamccGmP255utkTzkXy9qYxhzQhdNrKl/YGgowIatv4Y4vr5yI6+BNCt/fldXMq y0gAl3hDIWoSoGV0MlfIyp6t0kDuHGbyKd3WzqiS/LwJ1/yEk6PD97eg/sT5gp5Irx/I wWOkx70Js1FUN+Qlr03gpD1fiR13VnA0jiu9l81LVpzDk1mp/zAkUfnsHFkuWiF3JiXw zTYJWj/5lWdZvGaAvU1dDPL5k0ksP7fthFHHqzoDKeYG/v3x1IVXZbAXLGNCvV6bejyV tdow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=VUURBVFN; spf=pass (google.com: domain of linux-ext4+bounces-507-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-507-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id n10-20020a6563ca000000b005c66240925dsi3867158pgv.546.2023.12.19.21.25.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 21:25:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-507-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=VUURBVFN; spf=pass (google.com: domain of linux-ext4+bounces-507-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-ext4+bounces-507-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 87CCD288446 for ; Wed, 20 Dec 2023 05:25:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AFBB3F9FB; Wed, 20 Dec 2023 05:24:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="VUURBVFN" X-Original-To: linux-ext4@vger.kernel.org Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [62.89.141.173]) (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 EBFB0FBE1; Wed, 20 Dec 2023 05:24:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=zeniv.linux.org.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ftp.linux.org.uk DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=aTxmIqx/EoO7e4qwLoDzfnPzeeP6f7RKMsj+EAXwCHw=; b=VUURBVFNhoRoFNjjPWTrrTYZbW AB2yGrBEFYB/GI8AwFJyn1tXiF2BhV2WFNoZB937NoPsei5LH2J+qrAPVsHgm2lU3wyeWUIsomBni sbQCvyMwY4Zzx5vYhyG5I+ajcAzabRqzZ9PhDUYrgibJ8k3krKi+doUN+4dTc1iTQVPKabst8io9E PtOKI/0vjbtp0KDSJdQqi78pXdMuWRc0sCHb2z2x8JcJ5G+O3RGfAW0SUjhdVkV2pSljyj15ZY+Dt yvXXVz1AncI7vi18pnNFH/ZZ5g72l4Dzcm0xr19IWvMLe3Dd2MJsMPJXJvxe392BYC8BIBmJZnfYW 8s07tEOg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1rFp4h-00HJ4N-03; Wed, 20 Dec 2023 05:24:55 +0000 Date: Wed, 20 Dec 2023 05:24:54 +0000 From: Al Viro To: linux-fsdevel@vger.kernel.org Cc: Theodore Ts'o , linux-ext4@vger.kernel.org Subject: [PATCH 12/22] ext4_add_entry(): ->d_name.len is never 0 Message-ID: <20231220052454.GK1674809@ZenIV> References: <20231220051348.GY1674809@ZenIV> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231220051348.GY1674809@ZenIV> Sender: Al Viro That bogosity goes back to the initial merge of ext3. Once upon a time ext2 used to have a similar check; that got taken out during the switch to page cache (June 2001). ext3 got merged into mainline 5 months later, still using buffer cache for directories; removal of the pointless check in ext2 should've been done as a separate patch, but it hadn't been, so that thing got missed... Signed-off-by: Al Viro --- fs/ext4/namei.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index d252935f9c8a..fa8b8dd841b5 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c @@ -2388,8 +2388,6 @@ static int ext4_add_entry(handle_t *handle, struct dentry *dentry, sb = dir->i_sb; blocksize = sb->s_blocksize; - if (!dentry->d_name.len) - return -EINVAL; if (fscrypt_is_nokey_name(dentry)) return -ENOKEY; -- 2.39.2