From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa1-f44.google.com (mail-oa1-f44.google.com [209.85.160.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A4A848BD5A for ; Tue, 9 Jun 2026 15:15:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781018158; cv=none; b=dDaTbeDln0Ptsf/yO6Yis0kJYTx94kfNVOobsBU7Y6o4mZLeoWAVkYew/5jrA/XmjlUi/O/ymq8AXJiYx27/LORjqKh0C4Jgdo/CRAlZc+AJ0JKdUI4cC8ZFdmetDNkJP3MXH/3N79j5AkVD6eGi7lUSsjObWlKY1QdRg8K9sRo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781018158; c=relaxed/simple; bh=HuLHp86v1RUr7xjBoPFKpQYBOKic6qIYiMlmz9/8JXY=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=T4rec0WrTGnztYeFRwqfQrdr3NAy23yv7rzZQbBw4mI1HUoF1M3kXRihonQBB1/dv6wTe6p6Tr8nA5zNLhLmOOJBlYq602AMlo18BxEa8Rd1f2NJZ+Kc/YQ32Qc5p9gbVDo7Ll6KCfiwGlf/oskNtfBgVaeqUsC9SSkCKOzFodU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=rOHI9eJf; arc=none smtp.client-ip=209.85.160.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rOHI9eJf" Received: by mail-oa1-f44.google.com with SMTP id 586e51a60fabf-43cce8288c7so2995489fac.3 for ; Tue, 09 Jun 2026 08:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781018156; x=1781622956; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=eaTjUthpYgTG7VsflD9ULVjQdtweGWmL2crswhON7oM=; b=rOHI9eJflBYuFCen9oWjUOk+dFQkOpvV+YVvvPaDzuqG7HRv6kJ0mdWTmuPBNBgE8+ T8LYxkiKXug5S8MtMlzeVS7RL2sv/9q97Ld2BmEc+cMbCSPlxOTww6J/KV8SMlNQieuH TofRbTyc/QIGU+lLcxKw8O+DTNbTUzEpILQ2v0GxZW5+bLQLZEh63pDQ7InjKKt3g/aS HuM3MpmBB6tkaeVAgHwPyREhSGtJzkBhdJddb9yLPdtij60JIaYiIYyUka3ECx6gGB7i 5geC7JwXC8dMjP3fLiWcZPv3S8QRa2Q0JkOfcYZOKpIIbzm4dgLDUzk+NWc+cKcvq0w2 JqYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781018156; x=1781622956; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=eaTjUthpYgTG7VsflD9ULVjQdtweGWmL2crswhON7oM=; b=fMNxIZQEEf14Cae0SU0punWbCuD4wdHhsKCK2gklSOHPUpp2n7XPPwEdc9jy8O3XlP Cf0xxMauk2rm/4CN9jI1rfLwTu62nrSWoWjWHnS4kY6NoOXZ6b7KznQZL96ohFDV7Jo9 HCSSy7TRz0I/3jcYwfrPzceumhTFmKcbULfAKU1GEdgt7/Bd+dHWDE6h4X6Q5XNPIaOB eI1hCphIitimjYnAyhvK3xVIvEbXCv5dHW69XQr2F4qpNJbt9cDPYNcUGpVRHWYmRY+J /GaXaxZQfo1cycW+TrBMf49fcudiwCev+tM8p04CK60S0GzQv6SrMCS/5spZW3LsS4WW BUHA== X-Forwarded-Encrypted: i=1; AFNElJ+PL/Xtgv+nCvaSiQNXzrlpptROurnj4u5WX3sqOw4AhQ4oM5R3q3rmT6J7tXlZBl3f+aSAbqeD/bBHc+8=@vger.kernel.org X-Gm-Message-State: AOJu0YwNBJ3spUmaZKjD3BIMy6xPGv7jeNxfGzIHKoOhptwwr+xRKp1s G+htvhhulRytOqteQcnPSuT64lT9FoHjhCmt6BYewP7feKJKxkZBJG9C X-Gm-Gg: Acq92OEikd2rHKRi04PQzmNAQq/Wzr7JNARFcDetrBMSL3JSCfVHqtfV/d7fvcpFGgI dOS0I06IK0zhMJgHLs8e+estDmSfOrkqJstHdIKByL8NJAy2Pn/GlWYi7CffVJ13EtXi6Y3pTaG OSbrcHahBW0cpWGFmAQBkyP1hzyFdL3cggsZr/DzaSPTIG57PM+MTfpt4dSibEQoka+lyzQaRDT ypPFMP9bCus5u1Uv0gmPwb9svQ9uonsjTjiWVdhKC+jsKB7O0PvRVx1nOIba2/RD+oc3ZESY8gc La8GV9oU6cEj4era9r2n1Gn73qDIcaow7EkdsxmeFWxRJ17bP1ejrlLZi5yOsY+TgL5qj7VYVvq bnkH+NJpuHMS/k3NQ0rT/c3RjRcY5qkXiLX8WUjzJSVSS3NTh0ndTpnqVjlDmQZqrzdvLueO5nf hUci/OmAw0SC8voGXiy47dTIfkedUdadj2+vj+enlnHJ3YdZ1e0i/TIMdCFpdX6Aw= X-Received: by 2002:a05:6870:b009:b0:43b:5048:2401 with SMTP id 586e51a60fabf-4413d32931fmr11874832fac.6.1781018156135; Tue, 09 Jun 2026 08:15:56 -0700 (PDT) Received: from linuxescape (23-88-128-2.fttp.usinternet.com. [23.88.128.2]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-440d8295b38sm18623875fac.10.2026.06.09.08.15.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jun 2026 08:15:55 -0700 (PDT) Date: Tue, 9 Jun 2026 10:15:53 -0500 From: Maxwell Doose To: Jan Kara Cc: Christian Brauner , Al Viro , Jeff Layton , Kees Cook , Mateusz Guzik , open list Subject: Re: [PATCH] fs: efs: namei: Use __free() over manual resource management Message-ID: <20260609101553.3e679b6f@linuxescape> In-Reply-To: References: <20260606181905.241793-1-m32285159@gmail.com> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, 9 Jun 2026 11:58:40 +0200 Jan Kara wrote: > On Sat 06-06-26 21:58:15, Maxwell Doose wrote: > > On Sat, Jun 6, 2026 at 1:20=E2=80=AFPM Maxwell Doose wrote: =20 > > > > > > Define a __free() for brelse() called brelease. > > > > > > The current code uses manual management of the file buffer heads. Rem= ove > > > manual brelse statements and initialize bh with __free(brelease) > > > which removes and modernizes code. > > > > > > Signed-off-by: Maxwell Doose > > > --- > > > fs/efs/namei.c | 10 ++++------ > > > 1 file changed, 4 insertions(+), 6 deletions(-) > > > > > > diff --git a/fs/efs/namei.c b/fs/efs/namei.c > > > index 38961ee1d1af..ce7794d55e47 100644 > > > --- a/fs/efs/namei.c > > > +++ b/fs/efs/namei.c > > > @@ -8,15 +8,15 @@ > > > */ > > > > > > #include > > > +#include > > > #include > > > #include > > > #include "efs.h" > > > > > > +DEFINE_FREE(brelease, struct buffer_head *, if (_T) brelse(_T)) > > > > > > static efs_ino_t efs_find_entry(struct inode *inode, const char *nam= e, int len) > > > { > > > - struct buffer_head *bh; > > > - > > > int slot, namelen; > > > char *nameptr; > > > struct efs_dir *dirblock; > > > @@ -30,7 +30,8 @@ static efs_ino_t efs_find_entry(struct inode *inode= , const char *name, int len) > > > > > > for(block =3D 0; block < inode->i_blocks; block++) { > > > > > > - bh =3D sb_bread(inode->i_sb, efs_bmap(inode, block)); > > > + struct buffer_head *bh __free(brelease) =3D sb_bread(= inode->i_sb, > > > + bf= s_bmap(inode, block)); =20 > >=20 > > Made a mistake here while moving :( should be efs_bmap(). Can send a > > v2 if preferred. =20 >=20 > Well, that happens but that also shows you didn't even try to compile the > thing before sending the patch. This is not how the kernel development > should work, let alone maintenance... Please test your changes before > sending them. > I did and added the fix for it but I think I forgot to amend my commit :( > > Separate thing is that I don't think changes like this to a dead filesyst= em > as EFS are really useful. So as others have suggested the most useful > action you could do for EFS would be to add deprecation notice on kconfig > and print deprecation message on mount (like we did with other filesystems > we removed). Set the removal date to the end of 2026 and see if some user > pops up. Because I suspect nobody used this code for years. >=20 Alright then. If that's the consensus then I can do that. --=20 best regards, max