linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sargun Dhillon <sargun@sargun.me>
To: Qu Wenruo <quwenruo@cn.fujitsu.com>
Cc: BTRFS ML <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH 2/8] btrfs: Fail on removing qgroup if del_qgroup_item fails
Date: Sun, 21 May 2017 18:30:59 -0700	[thread overview]
Message-ID: <CAMp4zn-rZzJw5tgMj_fp+TsRu196ObWrkpChPH857+QM_fiwuQ@mail.gmail.com> (raw)
In-Reply-To: <eff06906-08a0-4789-10fa-e0613a4ad848@cn.fujitsu.com>

On Sun, May 21, 2017 at 6:14 PM, Qu Wenruo <quwenruo@cn.fujitsu.com> wrote:
>
>
> At 05/20/2017 04:39 PM, Sargun Dhillon wrote:
>>
>> Previously, we were calling del_qgroup_item, and ignoring the return code
>> resulting in a potential to have divergent in-memory state without an
>> error. Perhaps, it makes sense to handle this error code, and put the
>> filesystem into a read only, or similar state.
>>
>> This patch only adds reporting of the error.
>>
>> Signed-off-by: Sargun Dhillon <sargun@sargun.me>
>> ---
>>   fs/btrfs/qgroup.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
>> index a2add44..7e772ba 100644
>> --- a/fs/btrfs/qgroup.c
>> +++ b/fs/btrfs/qgroup.c
>> @@ -1303,6 +1303,8 @@ static int __btrfs_remove_qgroup(struct
>> btrfs_trans_handle *trans,
>>                 return -EBUSY;
>>         ret = del_qgroup_item(trans, quota_root, qgroupid);
>> +       if (ret)
>> +               goto out;
>
>
> I think we should continue to remove in-memory qgroup relationship even we
> didn't find corresponding qgroup item.
>
> IIRC it's better to catch less severe error like -ENOENT and continue.
>
> Although normally previous find_qgroup_rb() should return -ENOENT before we
> continue to del_qgroup_item(), but catching -ENOENT here could make the code
> more robust.
Agreed. Will fix this. I think it also return ENOMEM.
>
> Thanks,
> Qu
>
>
>>         while (!list_empty(&qgroup->groups)) {
>>                 list = list_first_entry(&qgroup->groups,
>>
>
>

  reply	other threads:[~2017-05-22  1:31 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-20  8:38 [PATCH 0/8] BtrFS: QGroups uapi improvements Sargun Dhillon
2017-05-20  8:38 ` [PATCH 1/8] btrfs: Split up btrfs_remove_qgroup, no logic changes Sargun Dhillon
2017-05-20  8:39 ` [PATCH 2/8] btrfs: Fail on removing qgroup if del_qgroup_item fails Sargun Dhillon
2017-05-22  1:14   ` Qu Wenruo
2017-05-22  1:30     ` Sargun Dhillon [this message]
2017-05-20  8:39 ` [PATCH 3/8] btrfs: Split up btrfs_create_qgroup, no logic changes Sargun Dhillon
2017-05-20  8:39 ` [PATCH 4/8] btrfs: autoremove qgroup by default, and add a mount flag to override Sargun Dhillon
2017-05-20 19:32   ` Sargun Dhillon
2017-05-22  1:20   ` Qu Wenruo
2017-05-22  1:58     ` Sargun Dhillon
2017-05-22  2:03       ` Qu Wenruo
2017-05-22 17:31         ` Sargun Dhillon
2017-05-23  0:48           ` Qu Wenruo
2017-05-20  8:39 ` [PATCH 5/8] btrfs: qgroup.h whitespace change Sargun Dhillon
2017-05-26 19:08   ` David Sterba
2017-05-20  8:39 ` [PATCH 6/8] btrfs: Add code to check if a qgroup's subvol exists Sargun Dhillon
2017-05-22  1:39   ` Qu Wenruo
2017-05-22  3:04     ` Sargun Dhillon
2017-05-22  3:40       ` Qu Wenruo
2017-05-20  8:39 ` [PATCH 7/8] btrfs: Add code to prevent qgroup creation for a non-existent subvol Sargun Dhillon
2017-05-23  4:54   ` kbuild test robot
2017-05-23  6:27   ` kbuild test robot
2017-05-20  8:40 ` [PATCH 8/8] btrfs: Add new ioctl uapis for qgroup creation / removal Sargun Dhillon
2017-05-22  1:51   ` Qu Wenruo

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=CAMp4zn-rZzJw5tgMj_fp+TsRu196ObWrkpChPH857+QM_fiwuQ@mail.gmail.com \
    --to=sargun@sargun.me \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo@cn.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 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).