All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhao Lei <zhaolei@cn.fujitsu.com>
To: <dsterba@suse.cz>
Cc: <linux-btrfs@vger.kernel.org>
Subject: RE: [PATCH 1/1] btrfs: Fix NO_SPACE bug caused by delayed-iput
Date: Fri, 27 Feb 2015 09:21:43 +0800	[thread overview]
Message-ID: <00d101d0522b$befc6df0$3cf549d0$@cn.fujitsu.com> (raw)
In-Reply-To: <20150226222901.GB8720@twin.jikos.cz>

Hi, David Sterba

* From: David Sterba [mailto:dsterba@suse.cz]
> Sent: Friday, February 27, 2015 6:29 AM
> To: Zhaolei
> Cc: linux-btrfs@vger.kernel.org
> Subject: Re: [PATCH 1/1] btrfs: Fix NO_SPACE bug caused by delayed-iput
> 
> On Thu, Feb 26, 2015 at 11:20:23AM +0800, Zhaolei wrote:
> > --- a/fs/btrfs/transaction.c
> > +++ b/fs/btrfs/transaction.c
> > @@ -2068,8 +2068,12 @@ int btrfs_commit_transaction(struct
> > btrfs_trans_handle *trans,
> >
> >  	kmem_cache_free(btrfs_trans_handle_cachep, trans);
> >
> > -	if (current != root->fs_info->transaction_kthread)
> > +	if (current != root->fs_info->transaction_kthread) {
> >  		btrfs_run_delayed_iputs(root);
> 
> Using a mutex for this kind of synchronization is not entirely correct though it
> works.
> 
rw sem is best way I thought which was choosed from 
mutex, rw_sem, and wait_queue, although the function name is not
self documented...
Do you have some suggestion for this kind of synchronization?

Thanks
Zhaolei

> > +		/* make sure that all running delayed iput are done */
> > +		down_write(&root->fs_info->delayed_iput_sem);
> > +		up_write(&root->fs_info->delayed_iput_sem);



  reply	other threads:[~2015-02-27  1:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26  3:20 [PATCH 0/1] btrfs: Fix NO_SPACE bug caused by delayed-iput Zhaolei
2015-02-26  3:20 ` [PATCH 1/1] " Zhaolei
2015-02-26 22:29   ` David Sterba
2015-02-27  1:21     ` Zhao Lei [this message]
2015-03-18 15:59       ` David Sterba

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='00d101d0522b$befc6df0$3cf549d0$@cn.fujitsu.com' \
    --to=zhaolei@cn.fujitsu.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@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.