All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Matthew Wilcox <willy@infradead.org>, Jan Kara <jack@suse.cz>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-ext4@vger.kernel.org, Al Viro <viro@zeniv.linux.org.uk>,
	Phillip Potter <phil@philpotter.co.uk>,
	Amir Goldstein <amir73il@gmail.com>
Subject: Re: [GIT PULL] dtype handling cleanup for v4.21-rc1
Date: Wed, 16 Jan 2019 13:07:54 +0100	[thread overview]
Message-ID: <20190116120754.GF26069@quack2.suse.cz> (raw)
In-Reply-To: <CAHk-=whor678X0A4Mz95KSoG2f0O_F8a5PEQNXLqPxDehs+7Fg@mail.gmail.com>

[Added Phillip and Amir to CC (authors)]

On Wed 16-01-19 07:25:01, Linus Torvalds wrote:
> On Wed, Jan 16, 2019 at 6:01 AM Matthew Wilcox <willy@infradead.org> wrote:
> >
> > The ext2/ext4 patches don't show much improvement.  The other patches show
> > more:
> >
> >  fs/nilfs2/dir.c                    | 52 ++++++++++--------------------
> >  include/uapi/linux/nilfs2_ondisk.h |  1 +
> >  2 files changed, 18 insertions(+), 35 deletions(-)
> >
> > (for example).
> >
> > UFS ends up benefiting the most.  You can see the whole diffstat here:
> >
> > https://lore.kernel.org/lkml/20181023201952.GA15676@pathfinder/
> 
> Well, even with _all_ the filesystems converted, you actually have
> more lines added than removed by this "cleanup".
> 
> Sharing code just isn't a win here.
> 
> That said, it's not really the number of lines per se that make me
> question this, I think that's really more of a symptom than the root
> cause. The root cause for the newly adde lines is that this whole
> approach requires that all the numbers are in sync, but then they have
> different *names*.
> 
> Honestly, my gut feel is that I should not pull this in this form.
> 
> I have a suggestion: if people want to do this, and actually share the
> transformation, then the filesystems that use this common code should
> simply *NOT* have their own private names for the enumerations. They
> should actually use those standard names.
> 
> So if the patch for ext2 (for example) were to entirely get rid of the
> whole EXT2_FT_DIR define entirely, and ext2 would just use the actual
> FT_DIR define, than I'd be ok with it. At that point you don't add a
> pointless and expensive abstraction. At that point you say "ext2 uses
> the standard values, so ext2 can just use the standard #defines
> directly".

OK, I'm fine with that. We just have to have a big fat warning at FT_
definitions that these are on-disk values for several filesystems and thus
cannot ever change. As Amir mentioned in another email, the original
motivation for this is that quite a few filesystems copy-pasted ext2 code
and that is slightly buggy. So I still do think there's value in this
cleanup excercise.

> See my argument?
> 
> I think it is completely disgsting to have stuff like this:
> 
> + BUILD_BUG_ON(EXT2_FT_UNKNOWN != FT_UNKNOWN);
> + BUILD_BUG_ON(EXT2_FT_REG_FILE != FT_REG_FILE);
> + BUILD_BUG_ON(EXT2_FT_DIR != FT_DIR);
> + BUILD_BUG_ON(EXT2_FT_CHRDEV != FT_CHRDEV);
> + BUILD_BUG_ON(EXT2_FT_BLKDEV != FT_BLKDEV);
> + BUILD_BUG_ON(EXT2_FT_FIFO != FT_FIFO);
> + BUILD_BUG_ON(EXT2_FT_SOCK != FT_SOCK);
> + BUILD_BUG_ON(EXT2_FT_SYMLINK != FT_SYMLINK);
> + BUILD_BUG_ON(EXT2_FT_MAX != FT_MAX);
> 
> the above is just *garbage*.
> 
> If you fundamentally need the values to be the same, then you simply
> shouldn't have two different set of #defines.
> 
> Get rid of the EXT2_FT_xyz enumeration entirely, and the whole
> craziness goes away.
> 
> > We'd see a lot more improvement in line count if Philip weren't quite
> > so paranoid about checking FOOFS_FT_* == FT_* at build time; eg for btrfs:
> 
> Exact same issue.
> 
> So the more I look at this, the less I like it.
> 
> But if people are actually willing to use *truly* shared code, instead
> of using their own values and then having the crazy "they need to
> match", then it would be a different issue. As it is, I think the
> patch series adds complexity rather than helping anything.
> 
> More complexity and more lines of code? There is absolutely zero upside.

OK, understood. Phillip, could you please rework the patches as Linus
suggests? Thanks!

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2019-01-16 12:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-02 17:47 [GIT PULL] dtype handling cleanup for v4.21-rc1 Jan Kara
2019-01-08 10:05 ` Jan Kara
2019-01-15  9:24   ` Jan Kara
2019-01-15 17:36     ` Linus Torvalds
2019-01-15 18:01       ` Matthew Wilcox
2019-01-15 19:25         ` Linus Torvalds
2019-01-16 12:07           ` Jan Kara [this message]
2019-01-16 16:34             ` Phillip Potter
2019-01-16 16:51               ` Jan Kara
2019-01-16 16:56                 ` Amir Goldstein
2019-01-17  9:35                   ` Jan Kara
2019-01-17 11:17                     ` Amir Goldstein
2019-01-16  6:22       ` Amir Goldstein

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=20190116120754.GF26069@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=amir73il@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=phil@philpotter.co.uk \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.