All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Tso <tytso@mit.edu>
To: Jan Kara <jack@suse.cz>
Cc: linux-ext4@vger.kernel.org
Subject: Re: ext2_discard_prealloc() called on each iput?
Date: Mon, 28 May 2007 12:10:59 -0400	[thread overview]
Message-ID: <20070528161059.GC16941@thunk.org> (raw)
In-Reply-To: <20070528160420.GD21509@duck.suse.cz>

On Mon, May 28, 2007 at 06:04:20PM +0200, Jan Kara wrote:
>   OK, but then you could move the code to drop_inode() which is called at
> exactly that moment... I've been thinking more about it when fixing UDF.
> Discarding prealloc at drop_inode() has the disadvantage that
> symlinks/directories will keep their preallocated blocks until inodes are
> evicted from memory. Which is probably why ext2 discards prealloc on
> iput().

We should never be preallocating for symlinks (it just doesn't make
any sense), and for directories, it usually doesn't make sense,
either.  I don't recall that ext2 did preallocation for
symlinks/directories; I seem to recall it was only for normal files.
If it isn't, I'd argue that's a bug that should be fixed.

In either case, discarding on iput() doesn't help since we don't hold
a reference count on the inode, but rather the dentry .

>   OK, but still we could use e.g. i_writecount to check that we drop the
> last descriptor for writing...

That would be better, yes.

						- Ted

  reply	other threads:[~2007-05-28 16:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-22 16:11 ext2_discard_prealloc() called on each iput? Jan Kara
2007-05-23 12:37 ` Theodore Tso
2007-05-28 16:04   ` Jan Kara
2007-05-28 16:10     ` Theodore Tso [this message]
2007-05-29 21:10     ` Mingming Cao
2007-05-30  9:02       ` Jan Kara
2007-05-29 10:25   ` Jan Kara
2007-05-29 13:16     ` Theodore Tso

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=20070528161059.GC16941@thunk.org \
    --to=tytso@mit.edu \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.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.