diff mbox series

[1/6] common/quota: allow removing quota options entirely in _qmount_option

Message ID 20210712111146.82734-2-hch@lst.de (mailing list archive)
State New, archived
Headers show
Series [1/6] common/quota: allow removing quota options entirely in _qmount_option | expand

Commit Message

Christoph Hellwig July 12, 2021, 11:11 a.m. UTC
Add support for dropping all quota related options instead of only
overriding them with new ones to _qmount_option.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 common/quota | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Darrick J. Wong July 14, 2021, 11:35 p.m. UTC | #1
On Mon, Jul 12, 2021 at 01:11:41PM +0200, Christoph Hellwig wrote:
> Add support for dropping all quota related options instead of only
> overriding them with new ones to _qmount_option.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
>  common/quota | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/common/quota b/common/quota
> index 883a28a2..7fa1a61a 100644
> --- a/common/quota
> +++ b/common/quota
> @@ -263,7 +263,9 @@ _qmount_option()
>  			-e 's/prjquota/quota/g'`
>  	fi
>  	# Ensure we have the given quota option - duplicates are fine
> -	export MOUNT_OPTIONS="$MOUNT_OPTIONS -o $OPTS"
> +	if [ -n "$OPTS" ]; then
> +		export MOUNT_OPTIONS="$MOUNT_OPTIONS -o $OPTS"
> +	fi

/me finds it a little weird and gross that repeated calls to
_qmount_option lead to a really ugly $MOUNT_OPTIONS, but disentangling
/that/ mess is probably best left for another time...

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

>  	echo "MOUNT_OPTIONS = $MOUNT_OPTIONS" >>$seqres.full
>  }
>  
> -- 
> 2.30.2
>
diff mbox series

Patch

diff --git a/common/quota b/common/quota
index 883a28a2..7fa1a61a 100644
--- a/common/quota
+++ b/common/quota
@@ -263,7 +263,9 @@  _qmount_option()
 			-e 's/prjquota/quota/g'`
 	fi
 	# Ensure we have the given quota option - duplicates are fine
-	export MOUNT_OPTIONS="$MOUNT_OPTIONS -o $OPTS"
+	if [ -n "$OPTS" ]; then
+		export MOUNT_OPTIONS="$MOUNT_OPTIONS -o $OPTS"
+	fi
 	echo "MOUNT_OPTIONS = $MOUNT_OPTIONS" >>$seqres.full
 }