linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/4] btrfs: match device by dev_t
@ 2022-01-10 13:23 Anand Jain
  2022-01-10 13:23 ` [PATCH v4 1/4] btrfs: harden identification of the stale device Anand Jain
                   ` (3 more replies)
  0 siblings, 4 replies; 19+ messages in thread
From: Anand Jain @ 2022-01-10 13:23 UTC (permalink / raw)
  To: linux-btrfs; +Cc: josef, dsterba, nborisov, l

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_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     | 68 ++++++++++++++++++------------------------
 fs/btrfs/volumes.h     |  4 ++-
 4 files changed, 42 insertions(+), 41 deletions(-)

-- 
2.33.1


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

end of thread, other threads:[~2022-01-13  6:09 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-10 13:23 [PATCH v4 0/4] btrfs: match device by dev_t Anand Jain
2022-01-10 13:23 ` [PATCH v4 1/4] btrfs: harden identification of the stale device Anand Jain
2022-01-10 14:41   ` Nikolay Borisov
2022-01-11  4:50     ` [External] : " Anand Jain
2022-01-10 13:23 ` [PATCH v4 2/4] btrfs: redeclare btrfs_stale_devices arg1 to dev_t Anand Jain
2022-01-10 15:20   ` Nikolay Borisov
2022-01-11  4:51     ` [External] : " Anand Jain
2022-01-11  8:30       ` Nikolay Borisov
2022-01-11 12:36         ` Anand Jain
2022-01-11 12:49           ` Nikolay Borisov
2022-01-11 13:58             ` Nikolay Borisov
2022-01-12  4:13               ` Anand Jain
2022-01-10 13:23 ` [PATCH v4 3/4] btrfs: add device major-minor info in the struct btrfs_device Anand Jain
2022-01-10 20:13   ` Goffredo Baroncelli
2022-01-11  5:27     ` Anand Jain
2022-01-11 17:18       ` Goffredo Baroncelli
2022-01-12  3:17         ` Anand Jain
2022-01-13  6:09           ` Goffredo Baroncelli
2022-01-10 13:23 ` [PATCH v4 4/4] btrfs: use dev_t to match device in device_matched Anand Jain

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).