linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zheng Liu <gnehzuil.liu@gmail.com>
To: Ian Nartowicz <ian@nartowicz.co.uk>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>,
	Andreas Dilger <adilger@dilger.ca>, Theodore Ts'o <tytso@mit.edu>,
	"linux-ext4@vger.kernel.org" <linux-ext4@vger.kernel.org>,
	Ian Nartowicz <claws@nartowicz.co.uk>, Tao Ma <tm@tao.ma>,
	Andreas Dilger <adilger.kernel@dilger.ca>,
	Zheng Liu <wenqing.lz@taobao.com>
Subject: Re: [RFC][PATCH] ext4: handle fast symlink properly with inline_data
Date: Mon, 2 Jun 2014 19:54:44 +0800	[thread overview]
Message-ID: <20140602115444.GA27610@gmail.com> (raw)
In-Reply-To: <20140602120635.6d49ba12@crunchbang>

On Mon, Jun 02, 2014 at 12:06:35PM +0100, Ian Nartowicz wrote:
> On Mon, 2 Jun 2014 14:42:51 +0800
> Zheng Liu <gnehzuil.liu@gmail.com> wrote:
> 
> >Hi all,
> >
> >On Fri, May 30, 2014 at 04:26:33PM -0700, Darrick J. Wong wrote:
> >> On Tue, Feb 18, 2014 at 11:07:24AM -0800, Andreas Dilger wrote:
> >> > I suspect that the stats for symlinks > 60 but < ~150 chars is only a very
> >> > small fraction of files. If the code complexity of handling this is very
> >> > small (i.e. it is just handled as a natural consequence of writing "data" 
> >> > of this size) then I would be OK with it. 
> >> > 
> >> > Otherwise, I expect the code and maintenance overhead of supporting
> >> > the 0.01% (?) of symlinks that are this size is probably lot worth it. 
> >> > 
> >> > People could check what the actual usage is via the "fsstats" tool at:
> >> > 
> >> > http://www.pdsi-scidac.org/fsstats/
> >> > 
> >> > There is also data there already that reports stats on symlink length, but
> >> > it is mostly HPC filesystems and it might be better to redo this with a
> >> > desktop-type workload. 
> >> 
> >> I think we should either put in this kernel patch so that we can read inline
> >> data fast symlinks, or remove the ability to write inline data fast symlinks.
> >> It's a bit surprising that I can do:
> >> 
> >> # mke2fs -t ext4 -O inline_data /dev/sdb         
> >> # mount /dev/sdb /mnt/
> >> # ln -s "Fuzzy Wuzzy was a bear. Fuzzy Wuzzy had no hair. I guess he wasn't
> >> fuzzy, was he?" /mnt/biglink # readlink /mnt/biglink
> >> Fuzzy Wuzzy was a bear. Fuzzy Wuzzy had no hair. I guess he wasn't fuzzy,
> >> was he? # umount /mnt
> >> # mount /dev/sdb /mnt/
> >> # readlink /mnt/biglink
> >> Fuzzy Wuzzy was a bear. Fuzzy Wuzzy had no hair. I guess he
> >> 
> >> What happened to the punchline of the limerick? ------------^^^^^^^ ???? :)
> >
> >Do *not* apply this patch, please.  I revise this patch and I think it
> >is not right solution, although it can fix the bug.
> >
> >The root cause is in ext4_inode_is_fast_symlink() function that it
> >doesn't check whether or not an inode has inline data.  After creating
> >a normal symlink, the symlink will be stored in ->i_block and extra
> >space if the length of symlink is greater than 60 bytes and less than
> >extra space in inline data.  In the mean time, this inode has inline
> >data flag.  If the file system is remounted, ext4_inode_is_fast_symlink
> >thinks this inode is a fast symlink, and the data in ->i_block is copied
> >to user.  I will send a new patch to fix this bug.
> >
> >> 
> >> e2fsck still seems to think that you can't have inline_data fast symlinks.  I
> >> don't see a downside to continuing to allow them.
> >
> >Meanwhile another patch for e2fsck also will be sent out soon in order
> >to handle symlink properly with inline data in e2fsck.
> >
> >Regards,
> >                                                - Zheng
> 
> fsstats on root on my desktop, percentage of symlink targets 64 - 150
> characters long is 22%, almost all in the 64-71 char bucket.  Lots of them are
> theme icons and python packages, some shared library objects, nothing that
> many people won't have.

Hi Ian,

Thanks for sharing this with us.  It is useful for us to determine
whether or not we should support symlink with inline data feature, and
according to your report, we'd better support it. :-)

Regards,
                                                - Zheng

      reply	other threads:[~2014-06-02 11:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13  7:07 [RFC][PATCH] ext4: handle fast symlink properly with inline_data Zheng Liu
2014-02-13 17:05 ` Ian Nartowicz
2014-02-18  1:52 ` Theodore Ts'o
2014-02-18 19:07   ` Andreas Dilger
2014-05-30 23:26     ` Darrick J. Wong
2014-06-02  6:42       ` Zheng Liu
2014-06-02 11:06         ` Ian Nartowicz
2014-06-02 11:54           ` Zheng Liu [this message]

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=20140602115444.GA27610@gmail.com \
    --to=gnehzuil.liu@gmail.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=adilger@dilger.ca \
    --cc=claws@nartowicz.co.uk \
    --cc=darrick.wong@oracle.com \
    --cc=ian@nartowicz.co.uk \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tm@tao.ma \
    --cc=tytso@mit.edu \
    --cc=wenqing.lz@taobao.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;
as well as URLs for NNTP newsgroup(s).