diff mbox

[09/17] common/dmerror: fix mount option issues

Message ID 146914483353.11762.14647880235199676753.stgit@birch.djwong.org (mailing list archive)
State Not Applicable
Headers show

Commit Message

Darrick J. Wong July 21, 2016, 11:47 p.m. UTC
Calling _mount doesn't work when we want to add mount options
such as realtime devices.  Since it's just a normal scratch device
mount except for the source device, just call _scratch_mount with
SCRATCH_DEV set to the dmerror device.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 common/dmerror |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)



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

Comments

Christoph Hellwig Aug. 1, 2016, 6:28 a.m. UTC | #1
On Thu, Jul 21, 2016 at 04:47:13PM -0700, Darrick J. Wong wrote:
> Calling _mount doesn't work when we want to add mount options
> such as realtime devices.  Since it's just a normal scratch device
> mount except for the source device, just call _scratch_mount with
> SCRATCH_DEV set to the dmerror device.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks fine,

Reviewed-by: Christoph Hellwig <hch@lst.de>
--
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
Eryu Guan Aug. 3, 2016, 10:38 a.m. UTC | #2
On Thu, Jul 21, 2016 at 04:47:13PM -0700, Darrick J. Wong wrote:
> Calling _mount doesn't work when we want to add mount options
> such as realtime devices.  Since it's just a normal scratch device
> mount except for the source device, just call _scratch_mount with
> SCRATCH_DEV set to the dmerror device.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  common/dmerror |    7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> 
> diff --git a/common/dmerror b/common/dmerror
> index 5ad9994..22b9ea9 100644
> --- a/common/dmerror
> +++ b/common/dmerror
> @@ -41,14 +41,9 @@ _dmerror_init()
>  	DMERROR_TABLE="0 $blk_dev_size error $dm_backing_dev 0"
>  }
>  
> -_dmerror_mount_options()
> -{
> -	echo `_common_dev_mount_options $*` $DMERROR_DEV $SCRATCH_MNT
> -}
> -
>  _dmerror_mount()
>  {
> -	_mount -t $FSTYP `_dmerror_mount_options $*`
> +	SCRATCH_DEV=$DMERROR_DEV _scratch_mount $*

Perhaps you can add "_scratch_options mount" to _dmerror_mount then
mount with $SCRATCH_OPTIONS? Like what _mount_delay does in
common/dmdelay.

Thanks,
Eryu

>  }
>  
>  _dmerror_unmount()
> 
--
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
Darrick J. Wong Aug. 3, 2016, 10:14 p.m. UTC | #3
On Wed, Aug 03, 2016 at 06:38:00PM +0800, Eryu Guan wrote:
> On Thu, Jul 21, 2016 at 04:47:13PM -0700, Darrick J. Wong wrote:
> > Calling _mount doesn't work when we want to add mount options
> > such as realtime devices.  Since it's just a normal scratch device
> > mount except for the source device, just call _scratch_mount with
> > SCRATCH_DEV set to the dmerror device.
> > 
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> >  common/dmerror |    7 +------
> >  1 file changed, 1 insertion(+), 6 deletions(-)
> > 
> > 
> > diff --git a/common/dmerror b/common/dmerror
> > index 5ad9994..22b9ea9 100644
> > --- a/common/dmerror
> > +++ b/common/dmerror
> > @@ -41,14 +41,9 @@ _dmerror_init()
> >  	DMERROR_TABLE="0 $blk_dev_size error $dm_backing_dev 0"
> >  }
> >  
> > -_dmerror_mount_options()
> > -{
> > -	echo `_common_dev_mount_options $*` $DMERROR_DEV $SCRATCH_MNT
> > -}
> > -
> >  _dmerror_mount()
> >  {
> > -	_mount -t $FSTYP `_dmerror_mount_options $*`
> > +	SCRATCH_DEV=$DMERROR_DEV _scratch_mount $*
> 
> Perhaps you can add "_scratch_options mount" to _dmerror_mount then
> mount with $SCRATCH_OPTIONS? Like what _mount_delay does in
> common/dmdelay.

Oh, yeah, that makes sense.

--D

> 
> Thanks,
> Eryu
> 
> >  }
> >  
> >  _dmerror_unmount()
> > 
--
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

diff --git a/common/dmerror b/common/dmerror
index 5ad9994..22b9ea9 100644
--- a/common/dmerror
+++ b/common/dmerror
@@ -41,14 +41,9 @@  _dmerror_init()
 	DMERROR_TABLE="0 $blk_dev_size error $dm_backing_dev 0"
 }
 
-_dmerror_mount_options()
-{
-	echo `_common_dev_mount_options $*` $DMERROR_DEV $SCRATCH_MNT
-}
-
 _dmerror_mount()
 {
-	_mount -t $FSTYP `_dmerror_mount_options $*`
+	SCRATCH_DEV=$DMERROR_DEV _scratch_mount $*
 }
 
 _dmerror_unmount()