All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs: additional fix for mount cleanup
@ 2018-01-17  8:36 Misono, Tomohiro
  2018-01-17  8:37 ` [PATCH 1/2] btrfs: fix the bug of device scan/ready for mounted, filesystem Misono, Tomohiro
  2018-01-17  8:38 ` [PATCH 2/2] btrfs: remove unused arg from parse_subvol_options() Misono, Tomohiro
  0 siblings, 2 replies; 6+ messages in thread
From: Misono, Tomohiro @ 2018-01-17  8:36 UTC (permalink / raw)
  To: linux-btrfs; +Cc: dsterba, Anand Jain

This is based on the following branch:
https://github.com/kdave/btrfs-devel/tree/misc-next

And this is the additional fix for mount cleanup patch.
(https://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg71148.html

1st patch fixes the problem "device scan/ready" fails for mounted
filesystem.
2nd patch drops unused argument.

Sorry for messing things up.
Regards,
Tomohiro Misono

*** BLURB HERE ***

Tomohiro Misono (2):
  btrfs: fix the bug of device scan/ready for mounted filesystem
  btrfs: remove unused arg from parse_subvol_options()

 fs/btrfs/super.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.14.3


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

* [PATCH 1/2] btrfs: fix the bug of device scan/ready for mounted, filesystem
  2018-01-17  8:36 [PATCH 0/2] btrfs: additional fix for mount cleanup Misono, Tomohiro
@ 2018-01-17  8:37 ` Misono, Tomohiro
  2018-01-18  6:57   ` Anand Jain
  2018-01-18 15:09   ` David Sterba
  2018-01-17  8:38 ` [PATCH 2/2] btrfs: remove unused arg from parse_subvol_options() Misono, Tomohiro
  1 sibling, 2 replies; 6+ messages in thread
From: Misono, Tomohiro @ 2018-01-17  8:37 UTC (permalink / raw)
  To: linux-btrfs; +Cc: dsterba, Anand Jain

commit ae3acc5fc0bf ("btrfs: cleanup btrfs_mount() using
btrfs_mount_root()") introduces a bug that "btrfs device scan/ready" for
mounted filesystem fails.

This is because fs_info->bdev_holder has been changed to hold
btrfs_root_fs_type instead of btrfs_fs_type by this commit, but ioctl
for device scan/ready still uses btrfs_fs_type to call
btrfs_scan_one_device(). This leads to failiure of blkdev_get_by_path()
for mounted filesystem because of different holder type.

Fix this by specifying btrfs_root_fs_type for btrfs_scan_one_device() in
the path of device ready/scan ioctl.

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
---
 fs/btrfs/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 9438d32c4267..6ff13948b655 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -2231,11 +2231,11 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
 	switch (cmd) {
 	case BTRFS_IOC_SCAN_DEV:
 		ret = btrfs_scan_one_device(vol->name, FMODE_READ,
-					    &btrfs_fs_type, &fs_devices);
+					    &btrfs_root_fs_type, &fs_devices);
 		break;
 	case BTRFS_IOC_DEVICES_READY:
 		ret = btrfs_scan_one_device(vol->name, FMODE_READ,
-					    &btrfs_fs_type, &fs_devices);
+					    &btrfs_root_fs_type, &fs_devices);
 		if (ret)
 			break;
 		ret = !(fs_devices->num_devices == fs_devices->total_devices);
-- 
2.14.3


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

* [PATCH 2/2] btrfs: remove unused arg from parse_subvol_options()
  2018-01-17  8:36 [PATCH 0/2] btrfs: additional fix for mount cleanup Misono, Tomohiro
  2018-01-17  8:37 ` [PATCH 1/2] btrfs: fix the bug of device scan/ready for mounted, filesystem Misono, Tomohiro
@ 2018-01-17  8:38 ` Misono, Tomohiro
  2018-01-18 15:15   ` David Sterba
  1 sibling, 1 reply; 6+ messages in thread
From: Misono, Tomohiro @ 2018-01-17  8:38 UTC (permalink / raw)
  To: linux-btrfs; +Cc: dsterba, Anand Jain

Remove unused arg 'holder' from parse_subvol_options(), which has been
forgotten to be cleaned in the commit b99beb110e2d ("btrfs: split
parse_early_options() in two").

Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
---
 fs/btrfs/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 6ff13948b655..36fcdaf904b3 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -926,7 +926,7 @@ static int btrfs_parse_early_options(const char *options, fmode_t flags,
  * The value is later passed to mount_subvol()
  */
 static int btrfs_parse_subvol_options(const char *options, fmode_t flags,
-		void *holder, char **subvol_name, u64 *subvol_objectid)
+		char **subvol_name, u64 *subvol_objectid)
 {
 	substring_t args[MAX_OPT_ARGS];
 	char *opts, *orig, *p;
@@ -1644,7 +1644,7 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
 	if (!(flags & SB_RDONLY))
 		mode |= FMODE_WRITE;
 
-	error = btrfs_parse_subvol_options(data, mode, fs_type,
+	error = btrfs_parse_subvol_options(data, mode,
 					  &subvol_name, &subvol_objectid);
 	if (error) {
 		kfree(subvol_name);
-- 
2.14.3


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

* Re: [PATCH 1/2] btrfs: fix the bug of device scan/ready for mounted, filesystem
  2018-01-17  8:37 ` [PATCH 1/2] btrfs: fix the bug of device scan/ready for mounted, filesystem Misono, Tomohiro
@ 2018-01-18  6:57   ` Anand Jain
  2018-01-18 15:09   ` David Sterba
  1 sibling, 0 replies; 6+ messages in thread
From: Anand Jain @ 2018-01-18  6:57 UTC (permalink / raw)
  To: Misono, Tomohiro, linux-btrfs; +Cc: dsterba



On 01/17/2018 04:37 PM, Misono, Tomohiro wrote:
> commit ae3acc5fc0bf ("btrfs: cleanup btrfs_mount() using
> btrfs_mount_root()") introduces a bug that "btrfs device scan/ready" for
> mounted filesystem fails.
> 
> This is because fs_info->bdev_holder has been changed to hold
> btrfs_root_fs_type instead of btrfs_fs_type by this commit, but ioctl
> for device scan/ready still uses btrfs_fs_type to call
> btrfs_scan_one_device(). This leads to failiure of blkdev_get_by_path()
> for mounted filesystem because of different holder type.
> 
> Fix this by specifying btrfs_root_fs_type for btrfs_scan_one_device() in
> the path of device ready/scan ioctl.


   Reviewed-by: Anand Jain <Anand.Jain@oracle.com>

Thanks, Anand

> Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
> ---
>   fs/btrfs/super.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 9438d32c4267..6ff13948b655 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -2231,11 +2231,11 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
>   	switch (cmd) {
>   	case BTRFS_IOC_SCAN_DEV:
>   		ret = btrfs_scan_one_device(vol->name, FMODE_READ,
> -					    &btrfs_fs_type, &fs_devices);
> +					    &btrfs_root_fs_type, &fs_devices);
>   		break;
>   	case BTRFS_IOC_DEVICES_READY:
>   		ret = btrfs_scan_one_device(vol->name, FMODE_READ,
> -					    &btrfs_fs_type, &fs_devices);
> +					    &btrfs_root_fs_type, &fs_devices);
>   		if (ret)
>   			break;
>   		ret = !(fs_devices->num_devices == fs_devices->total_devices);
> 

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

* Re: [PATCH 1/2] btrfs: fix the bug of device scan/ready for mounted, filesystem
  2018-01-17  8:37 ` [PATCH 1/2] btrfs: fix the bug of device scan/ready for mounted, filesystem Misono, Tomohiro
  2018-01-18  6:57   ` Anand Jain
@ 2018-01-18 15:09   ` David Sterba
  1 sibling, 0 replies; 6+ messages in thread
From: David Sterba @ 2018-01-18 15:09 UTC (permalink / raw)
  To: Misono, Tomohiro; +Cc: linux-btrfs, dsterba, Anand Jain

On Wed, Jan 17, 2018 at 05:37:39PM +0900, Misono, Tomohiro wrote:
> commit ae3acc5fc0bf ("btrfs: cleanup btrfs_mount() using
> btrfs_mount_root()") introduces a bug that "btrfs device scan/ready" for
> mounted filesystem fails.
> 
> This is because fs_info->bdev_holder has been changed to hold
> btrfs_root_fs_type instead of btrfs_fs_type by this commit, but ioctl
> for device scan/ready still uses btrfs_fs_type to call
> btrfs_scan_one_device(). This leads to failiure of blkdev_get_by_path()
> for mounted filesystem because of different holder type.
> 
> Fix this by specifying btrfs_root_fs_type for btrfs_scan_one_device() in
> the path of device ready/scan ioctl.
> 
> Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>

Thanks. I'd rather fold that in to "btrfs: cleanup btrfs_mount() using
btrfs_mount_root()" where the semantics of holder actually changes.

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

* Re: [PATCH 2/2] btrfs: remove unused arg from parse_subvol_options()
  2018-01-17  8:38 ` [PATCH 2/2] btrfs: remove unused arg from parse_subvol_options() Misono, Tomohiro
@ 2018-01-18 15:15   ` David Sterba
  0 siblings, 0 replies; 6+ messages in thread
From: David Sterba @ 2018-01-18 15:15 UTC (permalink / raw)
  To: Misono, Tomohiro; +Cc: linux-btrfs, dsterba, Anand Jain

On Wed, Jan 17, 2018 at 05:38:31PM +0900, Misono, Tomohiro wrote:
> Remove unused arg 'holder' from parse_subvol_options(), which has been
> forgotten to be cleaned in the commit b99beb110e2d ("btrfs: split
> parse_early_options() in two").
> 
> Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>

Thanks, added to the rest of mount patches.

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-17  8:36 [PATCH 0/2] btrfs: additional fix for mount cleanup Misono, Tomohiro
2018-01-17  8:37 ` [PATCH 1/2] btrfs: fix the bug of device scan/ready for mounted, filesystem Misono, Tomohiro
2018-01-18  6:57   ` Anand Jain
2018-01-18 15:09   ` David Sterba
2018-01-17  8:38 ` [PATCH 2/2] btrfs: remove unused arg from parse_subvol_options() Misono, Tomohiro
2018-01-18 15:15   ` 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.