All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Zhihui Zhang <zzhsuny@gmail.com>
Cc: Chris Mason <clm@fb.com>, Theodore Ts'o <tytso@mit.edu>,
	swhiteho@redhat.com, mfasheh@suse.com,
	linux-fsdevel@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] Remove I_WILL_FREE
Date: Sat, 2 Jan 2016 05:18:11 +0000	[thread overview]
Message-ID: <20160102051810.GI9938@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CADFvMYJuHUv_pK0sk5qSj0QSoaaMQpDGXF_a0XMr8q6Cxayrtg@mail.gmail.com>

[akpm Cc'd]
On Fri, Jan 01, 2016 at 10:12:54PM -0500, Zhihui Zhang wrote:
> You are right, I was thinking from the perspective of I_WILL_FREE.
> 
> However, for the examples in fs-writeback.c and a few in
> ext4/btrfs/inode.c, we can argue that they really should check
> I_WILL_FREE as well. In theory, bad things can happen if they don't
> because as soon as I_WILL_FREE is set, the inode is going to be
> evicted. For example, in fs-writeback.c:
> 
>  471         spin_lock(&inode->i_lock);
>  472         if (inode->i_state & (I_WB_SWITCH | I_FREEING) ||
> 
>                                         <-- Assume I_WILL_FREE is set
> at this point.
> 
>  473             inode_to_wb(inode) == isw->new_wb) {
>  474                 spin_unlock(&inode->i_lock);
>  475                 goto out_free;
>  476         }
>  477         inode->i_state |= I_WB_SWITCH;
>  478         spin_unlock(&inode->i_lock);
>  479
>  480         ihold(inode);    <--  This will cause a warning because of i_count.

Hmm...   That ihold() is actually a lot more recent than original
introduction of I_WILL_FREE, but looking at the state of the tree
back when it was originally introduced...  I'm trying to recall
what made us go for a separate flag, but so far I've got nothing
definite.  Hell knows - it had been 10 years ago, and I have a gap
from late 2004 to September 2005 in mailboxes, so those are no help
either...  I _think_ it got discussed with akpm, maybe he would be
able to help reconstructing what happened.

It looks like you are right regarding the current state of the tree, but
I really wonder if there's something subtle that got missed during
one of rewrites in those ten years...  OTOH, it's quite possible that there
had been no good reason for using a separate flag from the very beginning.

Andrew, do you have any memories of (or, better yet, archived mails relevant
to) that thing?

  reply	other threads:[~2016-01-02  5:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-02  1:52 [PATCH] Remove I_WILL_FREE Zhihui Zhang
2016-01-02  2:31 ` Al Viro
2016-01-02  3:12   ` Zhihui Zhang
2016-01-02  5:18     ` Al Viro [this message]
2016-01-02 15:54       ` Zhihui Zhang
2016-01-05 17:08       ` Jan Kara

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=20160102051810.GI9938@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=clm@fb.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mfasheh@suse.com \
    --cc=swhiteho@redhat.com \
    --cc=tytso@mit.edu \
    --cc=zzhsuny@gmail.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 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.