Re: [PATCH v2 1/3] common/rc: add scratch shutdown support for overlayfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 7, 2017 at 4:22 AM, Chengguang Xu <cgxu519@xxxxxxxxxx> wrote:
> Signed-off-by: Chengguang Xu <cgxu519@xxxxxxxxxx>
> ---
>
> Changes since v1:
> _scratch_shutdown() does not call notrun.
>
>  common/rc | 24 ++++++++++++++++++++++--
>  1 file changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/common/rc b/common/rc
> index 4c053a5..911dba3 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -382,6 +382,15 @@ _scratch_cycle_mount()
>      _scratch_mount "$opts"
>  }
>
> +_scratch_shutdown()
> +{
> +       if [ $FSTYP = "overlay" ]; then

You need the OVL_BASE_SCRATCH_DEV protection here as well.
Yes, test SHOULD have _require_scratch_shutdown() before calling
_scratch_shutdown(), but if test is not compliant worst case is that
test "fails" instead of "not run", but NOT that host fs is shutdown.

> +               src/godown -f $OVL_BASE_SCRATCH_MNT
> +       else
> +               src/godown -f $SCRATCH_MNT
> +       fi
> +}
> +
>  _test_mount()
>  {
>      if [ "$FSTYP" == "overlay" ]; then
> @@ -2908,8 +2917,19 @@ _require_scratch_shutdown()
>
>         _scratch_mkfs > /dev/null 2>&1
>         _scratch_mount
> -       src/godown -f $SCRATCH_MNT 2>&1 \
> -               || _notrun "$FSTYP does not support shutdown"
> +
> +       if [ $FSTYP = "overlay" ]; then
> +               if [ -z $OVL_BASE_SCRATCH_DEV ]; then
> +                       _notrun "$SCRATCH_DEV is not a block device"
> +               else
> +                       src/godown -f $OVL_BASE_SCRATCH_MNT 2>&1 \
> +                       || _notrun "Underlying filesystem does not support shutdown"
> +               fi
> +       else
> +               src/godown -f $SCRATCH_MNT 2>&1 \
> +                       || _notrun "$FSTYP does not support shutdown"
> +       fi
> +
>         _scratch_unmount
>  }
>
> --
> 1.8.3.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-unionfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems Devel]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux