The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: "Darrick J. Wong" <djwong@kernel.org>,
	Kemeng Shi <shikemeng@huaweicloud.com>,
	linux-ext4@vger.kernel.org,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/7] ext4: avoid buffer_head leak in ext4_mark_inode_used
Date: Fri, 16 Aug 2024 12:35:22 -0400	[thread overview]
Message-ID: <20240816163522.GB8108@mit.edu> (raw)
In-Reply-To: <a5ddf25d-3bd3-4323-8649-c75b65070d01@web.de>

On Fri, Aug 16, 2024 at 08:56:45AM +0200, Markus Elfring wrote:
> >>>> Release inode_bitmap_bh from ext4_read_inode_bitmap in
> >>>> ext4_mark_inode_used to avoid buffer_head leak.
> >>>> By the way, remove unneeded goto for invalid ino when inode_bitmap_bh
> >>>> is NULL.
> >>>
> >>> 1. I suggest to split such changes into separate update steps.
> >>>    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.11-rc3#n81
> >> It's acceptable to me, but I'm not sure if it worth separate patches
> >> to others. I will do separate in next version if no person is against
> >> this.
> >
> > No, that suggestion is stupid.
> 
> Please reconsider such a view a bit more.

Darrick is absolutely correct; that suggestion is.... ill-considered.

> >                                 There's no reason to generate even more
> > patches for a three line fix, it's very obvious that you're fixing a
> > missing resource release and rearranging the first error out
> > accordingly.
> 
> You would probably like to distinguish the severity for two changes,
> wouldn't you?
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.11-rc3#n168
> 
> Under which circumstances can you accept the separation of development concerns better?

We will sometimes do minor cleanups in the course of fixing a bug.  In
this particular case, the cleanup is so minor, that if someone
suggested it as a stand-alone cleanup patch, I'd reject it as adding
noise, and not being worth the extra commit.

Blindly following rules is a bad idea; that's because software
programming is an engineering discpline, which means we are often
trading off multiple goals, each of which are good in and of
themselves.  For example, extra patch noise, such as fixing
whitespace, or changing a goto errout to a return, makes zero
difference to the generated code, only a very tiny margial improvement
in the readability in the code base; and also increases the chance
that some future bug fix won't backport cleanly to older LTS kernels.

I expect ext4 developers to use their good judgement, and not just
blindly follow rules, even good rules which may make sense 80% or even
95% of the time in the submitting-patches.rst file.

Markus, perhaps you could good "blindly following rules" and read some
of the eassays found from that web search, if you need more
explorations of that topic.

Best regards, 

						- Ted

  reply	other threads:[~2024-08-16 16:38 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13 12:07 [PATCH 0/7] Fixes and cleanups to ext4 ialloc Kemeng Shi
2024-08-13 12:07 ` [PATCH 1/7] ext4: avoid buffer_head leak in ext4_mark_inode_used Kemeng Shi
2024-08-15  9:55   ` Markus Elfring
2024-08-15 13:17     ` Kemeng Shi
2024-08-15 14:49       ` Darrick J. Wong
2024-08-16  6:56         ` Markus Elfring
2024-08-16 16:35           ` Theodore Ts'o [this message]
2024-08-13 12:07 ` [PATCH 2/7] ext4: avoid potential buffer_head leak in __ext4_new_inode Kemeng Shi
2024-08-14  8:48   ` Zhang Yi
2024-08-15  1:36     ` Kemeng Shi
2024-08-13 12:07 ` [PATCH 3/7] ext4: avoid negative min_clusters in find_group_orlov Kemeng Shi
2024-08-13 12:07 ` [PATCH 4/7] ext4: remove dead check in __ext4_new_inode Kemeng Shi
2024-08-13 12:07 ` [PATCH 5/7] ext4: move checksum length calculation of inode bitmap into ext4_inode_bitmap_csum_[verify/set] functions Kemeng Shi
2024-08-13 12:07 ` [PATCH 6/7] ext4: remove unneeded NULL check of buffer_head in ext4_mark_inode_used Kemeng Shi
2024-08-13 12:07 ` [PATCH 7/7] ext4: check buffer_verified in advance to avoid unneeded ext4_get_group_info Kemeng Shi
2024-08-15 11:13   ` Markus Elfring
2024-08-15 13:17     ` Kemeng Shi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240816163522.GB8108@mit.edu \
    --to=tytso@mit.edu \
    --cc=Markus.Elfring@web.de \
    --cc=adilger.kernel@dilger.ca \
    --cc=djwong@kernel.org \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=shikemeng@huaweicloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox