All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/4] btrfs: match device by dev_t
@ 2022-01-12  5:05 Anand Jain
  2022-01-12  5:05 ` [PATCH v5 1/4] btrfs: harden identification of the stale device Anand Jain
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Anand Jain @ 2022-01-12  5:05 UTC (permalink / raw)
  To: linux-btrfs; +Cc: josef, dsterba, nborisov, l, kreijack

v5: Patch 1/4 device_matched() to return bool; absorb errors in it to false.
     Move if (!device->name) into device_matched().
    Patch 2/4 fix the commit title and add a comment.
    Patch 3/4 add more comment about btrfs_device::devt.
    
v4: Return 1 for device matched in device_matched()
    Use scnprintf() instead of sprintf() in device_matched()
    Change log updated drop commit id
    Use str[0] instead of strlen()
    Change logic from !lookup_bdev() to lookup_bdev == 0

v3: Added patch 3/4 saves and uses dev_t in btrfs_device and
    thus patch 4/4 removes the function device_matched().
    fstests btrfs passed with no new regressions.

v2: Fix 
     sparse: warning: incorrect type in argument 1 (different address spaces)
     For using device->name->str

    Fix Josef suggestion to pass dev_t instead of device-path in the
     patch 2/2.

--- original cover letter -----
Patch 1 is the actual bug fix and should go to stable 5.4 as well.
On 5.4 patch1 conflicts (outside of the changes in the patch),
so not yet marked for the stable.

Patch 2 simplifies calling lookup_bdev() in the device_matched()
by moving the same to the parent function two levels up.

Patch 2 is not merged with 1 because to keep the patch 1 changes local
to a function so that it can be easily backported to 5.4 and 5.10.

We should save the dev_t in struct btrfs_device with that may be
we could clean up a few more things, including fixing the below sparse
warning.

  sparse: sparse: incorrect type in argument 1 (different address spaces)

For using without rcu:

  error = lookup_bdev(device->name->str, &dev_old); 


Anand Jain (4):
  btrfs: harden identification of the stale device
  btrfs: redeclare btrfs_free_stale_devices arg1 to dev_t
  btrfs: add device major-minor info in the struct btrfs_device
  btrfs: use dev_t to match device in device_matched

 fs/btrfs/dev-replace.c |  3 ++
 fs/btrfs/super.c       |  8 ++++-
 fs/btrfs/volumes.c     | 67 +++++++++++++++++-------------------------
 fs/btrfs/volumes.h     |  7 ++++-
 4 files changed, 43 insertions(+), 42 deletions(-)

-- 
2.33.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-01-18 15:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12  5:05 [PATCH v5 0/4] btrfs: match device by dev_t Anand Jain
2022-01-12  5:05 ` [PATCH v5 1/4] btrfs: harden identification of the stale device Anand Jain
2022-01-12  5:06 ` [PATCH v5 2/4] btrfs: redeclare btrfs_free_stale_devices arg1 to dev_t Anand Jain
2022-01-12  5:06 ` [PATCH v5 3/4] btrfs: add device major-minor info in the struct btrfs_device Anand Jain
2022-01-12  5:06 ` [PATCH v5 4/4] btrfs: use dev_t to match device in device_matched Anand Jain
2022-01-18  2:02 ` [PATCH v5 0/4] btrfs: match device by dev_t Anand Jain
2022-01-18 15:31 ` David Sterba

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.