Message ID | 69a45acb12680df22a7c7052e788450e7f780d91.1690792823.git.anand.jain@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | metadata_uuid misc cleanup and fixes part2 | expand |
On Mon, Jul 31, 2023 at 07:16:38PM +0800, Anand Jain wrote: > Signed-off-by: Anand Jain <anand.jain@oracle.com> > --- > fs/btrfs/volumes.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c > index 661dc69543eb..316839d2aecc 100644 > --- a/fs/btrfs/volumes.c > +++ b/fs/btrfs/volumes.c > @@ -821,7 +821,7 @@ static noinline struct btrfs_device *device_list_add(const char *path, > > if (!fs_devices) { > fs_devices = alloc_fs_devices(disk_super->fsid, > - has_metadata_uuid ? disk_super->metadata_uuid : NULL); > + btrfs_sb_metadata_uuid_or_null(disk_super)); This is the only place that passes a non-NULL pointer to alloc_fs_devices, so it might be better to drop the 2nd argument completely and just set the metadata_uuid here, which is basically copying fsid to metadata_uuid.
On 11/08/2023 23:42, David Sterba wrote: > On Mon, Jul 31, 2023 at 07:16:38PM +0800, Anand Jain wrote: >> Signed-off-by: Anand Jain <anand.jain@oracle.com> >> --- >> fs/btrfs/volumes.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c >> index 661dc69543eb..316839d2aecc 100644 >> --- a/fs/btrfs/volumes.c >> +++ b/fs/btrfs/volumes.c >> @@ -821,7 +821,7 @@ static noinline struct btrfs_device *device_list_add(const char *path, >> >> if (!fs_devices) { >> fs_devices = alloc_fs_devices(disk_super->fsid, >> - has_metadata_uuid ? disk_super->metadata_uuid : NULL); >> + btrfs_sb_metadata_uuid_or_null(disk_super)); > > This is the only place that passes a non-NULL pointer to > alloc_fs_devices, so it might be better to drop the 2nd argument > completely and just set the metadata_uuid here, which is basically > copying fsid to metadata_uuid. Oh right. I am sending v2. Thanks.
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 661dc69543eb..316839d2aecc 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -821,7 +821,7 @@ static noinline struct btrfs_device *device_list_add(const char *path, if (!fs_devices) { fs_devices = alloc_fs_devices(disk_super->fsid, - has_metadata_uuid ? disk_super->metadata_uuid : NULL); + btrfs_sb_metadata_uuid_or_null(disk_super)); if (IS_ERR(fs_devices)) return ERR_CAST(fs_devices);
Signed-off-by: Anand Jain <anand.jain@oracle.com> --- fs/btrfs/volumes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)