linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v4 3/3] btrfs: free alien device due to device add
Date: Wed, 6 May 2020 07:40:56 +0800	[thread overview]
Message-ID: <bb507bb4-09a6-e9e5-db84-df4140447be9@oracle.com> (raw)
In-Reply-To: <20200505193431.GV18421@twin.jikos.cz>




>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>> Reviewed-by: Josef Bacik <josef@toxicpanda.com>
> 
> So I'm not sure how much the review holds when the code changes between
> iterations. The right way is to drop the rev-by and CC the person for
> any non-trivial or maybe for all changes.
> 

  only thing that changed is use of helper function
  btrfs_forget_devices() instead of the open-code, so I kept the rev-by.
  Yeah I kind of noticed late that cc list added during git format-patch
  didn't actually add cc in the git send <patch-file>


>> --- a/fs/btrfs/volumes.c
>> +++ b/fs/btrfs/volumes.c
>> @@ -2664,6 +2664,15 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
>>   
>>   	/* Update ctime/mtime for libblkid */
>>   	update_dev_time(device_path);
>> +
>> +	/*
>> +	 * Now that we have written a new sb into this device, check all other
>> +	 * fs_devices list if device_path alienates any other scanned device.
>> +	 * Ignore the return as we are successfull in the core task - add
>> +	 * the device.
>> +	 */
>> +	btrfs_forget_devices(device_path);
> 
> Actually this should go before update_dev_time, as this is the point
> when the file change could be detected by udev and rescanned, which
> increases the window between commit and removal from fs_devices.
> 

  You are right, theoretically btrfs_forget_devices() should be before
  update_dev_time()


Noted and agreed on rest of the stuffs.

Thanks, Anand

  reply	other threads:[~2020-05-05 22:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 15:22 [PATCH v3 REBASED 0/3] btrfs: fix issues due to alien device Anand Jain
2020-04-28 15:22 ` [PATCH 1/3] btrfs: drop useless goto in open_fs_devices Anand Jain
2020-04-30 14:09   ` David Sterba
2020-04-28 15:22 ` [PATCH 2/3] btrfs: include non-missing as a qualifier for the latest_bdev Anand Jain
2020-04-30 13:46   ` David Sterba
2020-05-01 22:54     ` Anand Jain
2020-04-28 15:22 ` [PATCH 3/3] btrfs: free alien device due to device add Anand Jain
2020-04-30 13:31   ` David Sterba
2020-05-01 20:01     ` Anand Jain
2020-05-05 17:02       ` David Sterba
2020-05-04 18:58   ` [PATCH v4 2/3] btrfs: include non-missing as a qualifier for the latest_bdev Anand Jain
2020-05-04 18:58   ` [PATCH v4 3/3] btrfs: free alien device due to device add Anand Jain
2020-05-05 19:34     ` David Sterba
2020-05-05 23:40       ` Anand Jain [this message]
2020-04-30  6:05 ` [PATCH v3 REBASED 0/3] btrfs: fix issues due to alien device Nikolay Borisov
2020-04-30 17:54   ` Anand Jain
2020-04-30 10:28     ` Nikolay Borisov
2020-05-01 19:45       ` Anand Jain

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=bb507bb4-09a6-e9e5-db84-df4140447be9@oracle.com \
    --to=anand.jain@oracle.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 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).