All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Anand Jain <anand.jain@oracle.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: track exclusive filesystem operation in flags
Date: Wed, 29 Mar 2017 15:21:23 +0200	[thread overview]
Message-ID: <20170329132122.GD4781@suse.cz> (raw)
In-Reply-To: <ac95c9c4-ed2b-3a9f-f763-697bd63db56f@oracle.com>

On Wed, Mar 29, 2017 at 06:01:37PM +0800, Anand Jain wrote:
> 
> 
> On 03/28/2017 08:44 PM, David Sterba wrote:
> > There are several operations, usually started from ioctls, that cannot
> > run concurrently. The status is tracked in
> > mutually_exclusive_operation_running as an atomic_t. We can easily track
> > the status as one of the per-filesystem flag bits with same
> > synchronization guarantees.
> >
> > The conversion replaces:
> >
> > * atomic_xchg(..., 1)    ->   test_and_set_bit(FLAG, ...)
> > * atomic_set(..., 0)     ->   clear_bit(FLAG, ...)
> 
> 
>     Makes sense.
> 
>    Reviewed-by: Anand Jain <anand.jain@oracle.com>
> 
>     However in the long term do you think its better to have
>     BTRFS_FS_EXCL_OP flag in the struct btrfs_fs_devices
>     rather than in struct btrfs_fs_info ? because we don't have
>     fs_info until device is mounted and in the long term we could
>     have a feature where volume can be maintained just after the
>     device scan without device being mounted.

I can't think of an example where it would be useful to move it out of
fs_info, so I'd need to know more details about the usecase. But the
flag makes sense only after the filesystem is mounted and all devices
are known, so what you suggest would be probably tracked by other flag
if necessary.

      reply	other threads:[~2017-03-29 13:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-28 12:44 [PATCH] btrfs: track exclusive filesystem operation in flags David Sterba
2017-03-29 10:01 ` Anand Jain
2017-03-29 13:21   ` David Sterba [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=20170329132122.GD4781@suse.cz \
    --to=dsterba@suse.cz \
    --cc=anand.jain@oracle.com \
    --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.