All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: "Misono, Tomohiro" <misono.tomohiro@jp.fujitsu.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: remove BTRFS_FS_QUOTA_DISABLING flag
Date: Wed, 13 Sep 2017 19:13:07 +0200	[thread overview]
Message-ID: <20170913171307.GR29043@twin.jikos.cz> (raw)
In-Reply-To: <f624acec-ac1b-61ca-19c9-e7683fc0b4e2@jp.fujitsu.com>

On Wed, Aug 30, 2017 at 04:33:16PM +0900, Misono, Tomohiro wrote:
> Currently, "btrfs quota enable" would fail after "btrfs quota disable" on
> the first time with syslog output "qgroup_rescan_init failed with -22", but
> it would succeed on the second time.
> 
> When "quota disable" is called, BTRFS_FS_QUOTA_DISABLING flag bit will be
> set in fs_info->flags in btrfs_quota_disable(), but it will not be droppd
> in btrfs_run_qgroups() (which is called in btrfs_commit_transaction())
> because quota_root has already been freed. If "quota enable" is called
> after that, both BTRFS_FS_QUOTA_DISABLING and BTRFS_FS_QUOTA_ENABLED flag
> would be dropped in the btrfs_run_qgroups() since quota_root is not NULL.
> This leads to the failure of "quota enable" on the first time.
> 
> BTRFS_FS_QUOTA_DISABLING flag is not used outside of "quota disable"
> context and is equivalent to whether quota_root is NULL or not.
> btrfs_run_qgroups() checks whether quota_root is NULL or not in the first
> place. 
> 
> So, let's remove BTRFS_FS_QUOTA_DISABLING flag.

The state bits and transitions are messy and keeping them consistent
could lead to the problmes you observe. By the analysis above it looks
correct to me to remove the 'disabling' bit.

Reviewed-by: David Sterba <dsterba@suse.com>

  parent reply	other threads:[~2017-09-13 17:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-30  7:33 [PATCH] btrfs: remove BTRFS_FS_QUOTA_DISABLING flag Misono, Tomohiro
2017-09-12  1:07 ` Fwd: " Misono, Tomohiro
2017-09-13 17:13 ` David Sterba [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-08-30  1:51 Misono, Tomohiro
2017-08-30  6:55 ` Misono, Tomohiro

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=20170913171307.GR29043@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=misono.tomohiro@jp.fujitsu.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.