Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Nikolay Borisov <nborisov@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: wqu@suse.com, misono.tomohiro@jp.fujitsu.com
Subject: Re: [PATCH v2] btrfs: qgroups: Move transaction management inside btrfs_quota_enable/disable
Date: Thu, 5 Jul 2018 14:53:03 +0300	[thread overview]
Message-ID: <d4c2f2d7-f640-514b-37ce-f699243ce0f2@suse.com> (raw)
In-Reply-To: <1530791448-12743-1-git-send-email-nborisov@suse.com>



On  5.07.2018 14:50, Nikolay Borisov wrote:
> Commit 5d23515be669 ("btrfs: Move qgroup rescan on quota enable to
> btrfs_quota_enable") not only resulted in an easier to follow code but
> it also introduced a subtle bug. It changed the timing when the initial
> transaction rescan was happening - before the commit it would happen
> after transaction commit had occured but after the commit it might happen
> before the transaction was committed. This results in failure to
> correctly rescan the quota since there could be data which is still not
> committed on disk.
> 
> This patch aims to fix this by movign the transaction creation/commit
> inside btrfs_quota_enable, which allows to schedule the quota commit
> after the transaction has been committed.
> 
> Fixes: 5d23515be669 ("btrfs: Move qgroup rescan on quota enable to btrfs_quota_enable")
> Reported-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
> Link: https://marc.info/?l=linux-btrfs&m=152999289017582
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>
> ---
> 
> Hello, 
> 
> One open-ended question this patch puts is how many items should be reserved
> to guarantee successful qgroup disable. Before this patch quota disable was 
> always using the arbitrary reservation of 2 items. Since this patch makes the 
> the transaction for enable/disable independent we have a chance to actually 
> set appropriate values for both transactions. In any case this patch doesn't 
> make things worse than before. 
> 
>  fs/btrfs/ioctl.c  | 15 ++--------
>  fs/btrfs/qgroup.c | 86 ++++++++++++++++++++++++++++++++++++++++++++++---------
>  fs/btrfs/qgroup.h |  6 ++--
>  3 files changed, 76 insertions(+), 31 deletions(-)
>

Changes since v2:

* Actually implemented proper transaction unwiding in both functions.

  reply	other threads:[~2018-07-05 11:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-05 11:50 [PATCH v2] btrfs: qgroups: Move transaction management inside btrfs_quota_enable/disable Nikolay Borisov
2018-07-05 11:53 ` Nikolay Borisov [this message]
2018-07-05 14:29 ` David Sterba
2018-07-05 14:39 ` 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=d4c2f2d7-f640-514b-37ce-f699243ce0f2@suse.com \
    --to=nborisov@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=misono.tomohiro@jp.fujitsu.com \
    --cc=wqu@suse.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