diff mbox

[v2] Btrfs-progs: do not add stale device into fs_devices

Message ID 20171017163820.GB3521@twin.jikos.cz (mailing list archive)
State New, archived
Headers show

Commit Message

David Sterba Oct. 17, 2017, 4:38 p.m. UTC
On Wed, Oct 11, 2017 at 11:57:16AM -0600, Liu Bo wrote:
> If one of btrfs's devices was pulled out and we've replaced it with a
> new one, then they have the same uuid.
> 
> If that device gets reconnected, 'btrfs filesystem show' will show the
> stale one instead of the new one, but on kernel side btrfs has a fix
> to not include the stale one, this could confuse users as people may
> monitor btrfs by running that cli.
> 
> This does the similar thing to what kernel side has done.
> 
> Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
> Reviewed-by: Anand Jain <anand.jain@oracle.com>

Applied with the following diff, thanks.

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/volumes.c
+++ b/volumes.c
@@ -141,11 +141,12 @@  static int device_list_add(const char *path,
                char *name;

                /*
-                * The existing device has newer generation, so this
-                * one could be a stale one, don't add it.
+                * The existing device has newer generation, so this one could
+                * be a stale one, don't add it.
                 */
                if (found_transid < device->generation) {
-                       warning("adding device %s gen %llu but found an existing device %s gen %llu\n",
+                       warning(
+       "adding device %s gen %llu but found an existing device %s gen %llu",
                                path, found_transid, device->name,
                                device->generation);
                        return -EEXIST;