linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <esandeen@redhat.com>
To: "bo.li.liu@oracle.com" <bo.li.liu@oracle.com>
Cc: Zach Brown <zab@redhat.com>, Eric Sandeen <sandeen@redhat.com>,
	linux-btrfs <linux-btrfs@vger.kernel.org>,
	Jeff Mahoney <jeffm@suse.com>
Subject: Re: [PATCH] btrfs: add delayed_iput list head to btrfs inode
Date: Wed, 6 Feb 2013 09:14:39 -0500 (EST)	[thread overview]
Message-ID: <C6207F92-AD17-4059-8442-2D0499095828@redhat.com> (raw)
In-Reply-To: <20130206020854.GA2278@liubo.jp.oracle.com>

On Feb 5, 2013, at 8:11 PM, Liu Bo <bo.li.liu@oracle.com> wrote:

> On Tue, Feb 05, 2013 at 03:14:05PM -0800, Zach Brown wrote:
>>> +    struct btrfs_inode *b_inode = BTRFS_I(inode);
>>> +    struct btrfs_fs_info *fs_info = b_inode->root->fs_info;
>>> 
>>>    if (atomic_add_unless(&inode->i_count, -1, 1))
>>>        return;
>>> 
>>> -    delayed = kmalloc(sizeof(*delayed), GFP_NOFS | __GFP_NOFAIL);
>>> -    delayed->inode = inode;
>>> -
>>>    spin_lock(&fs_info->delayed_iput_lock);
>>> -    list_add_tail(&delayed->list, &fs_info->delayed_iputs);
>>> +    list_add_tail(&b_inode->delayed_iput, &fs_info->delayed_iputs);
>>>    spin_unlock(&fs_info->delayed_iput_lock);
>>> }
>> 
>> Hmm.  I'm not great with inode life cycles, but isn't this only safe if
>> someone else can't get an i_count reference while this is in flight?  It
>> looks like the final iput does the unhashing, and so on, so couldn't an
>> iget/iput race with this and try to add the inode's list_head twice?
> 
> Yeah, same concern here.  Basically this will result in inodes still being
> in use on unmount.
> 
> Actually I did a similar one, here is some disscussion:
> 
> https://patchwork.kernel.org/patch/1824711/
> 
Ok, thanks all.  We should remove Jeff's comment then, it sure sounded like a good idea...

Eric

> thanks,
> liubo
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2013-02-06 14:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-05 22:00 [PATCH] btrfs: add delayed_iput list head to btrfs inode Eric Sandeen
2013-02-05 23:14 ` Zach Brown
2013-02-06  2:08   ` Liu Bo
2013-02-06 14:14     ` Eric Sandeen [this message]
2013-02-06 15:53     ` Eric Sandeen
2013-02-06 16:02       ` Liu Bo
2013-02-12  7:34         ` Jeff Mahoney

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=C6207F92-AD17-4059-8442-2D0499095828@redhat.com \
    --to=esandeen@redhat.com \
    --cc=bo.li.liu@oracle.com \
    --cc=jeffm@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=zab@redhat.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).