> > 在 2018年1月3日,下午8:58,Amir Goldstein <amir73il@xxxxxxxxx> 写道: > > On Wed, Jan 3, 2018 at 2:44 PM, Chengguang Xu <cgxu519@xxxxxxxxxx> wrote: >> > [...] >> In order to add overlay support in some requirement checks like _require_metadata_journaling, >> I think it’s better save underlying filesystem type to $OVL_BASE_FSTYP and doing proper check based >> on it. >> >> Currently $OVL_BASE_FSTYP and $FSTYP all set to “overlay”, Is there any specific reason for it? >> > > In _overlay_config_override(): > # Config file may specify base fs type, but we obay -overlay flag > export OVL_BASE_FSTYP="$FSTYP" > export FSTYP=overlay > > So either your setup is wrong or there is a bug. > $OVL_BASE_FSTYP *should* contain the base fs type, > but only if you defined FSTYPE in your config file when running ./check -overlay Yeah, I didn’t specify by hand in config file and just supposed to detect automatically. I didn’t check very carefully but seems just slight modification like below could let it support auto detection. $ git diff diff --git a/check b/check index f8db3cd..e460424 100755 --- a/check +++ b/check @@ -265,7 +265,7 @@ while [ $# -gt 0 ]; do -nfs) FSTYP=nfs ;; -glusterfs) FSTYP=glusterfs ;; -cifs) FSTYP=cifs ;; - -overlay) FSTYP=overlay; export OVERLAY=true ;; + -overlay) export OVERLAY=true ;; -pvfs2) FSTYP=pvfs2 ;; -tmpfs) FSTYP=tmpfs ;; -ubifs) FSTYP=ubifs ;; diff --git a/common/config b/common/config index d0fbfe5..e21d8ee 100644 --- a/common/config +++ b/common/config @@ -530,7 +530,9 @@ _overlay_config_override() [ -b "$TEST_DEV" ] || return 0 # Config file may specify base fs type, but we obay -overlay flag - export OVL_BASE_FSTYP="$FSTYP" + if [ -z $OVL_BASE_FSTYP ]; then + export OVL_BASE_FSTYP="$FSTYP" + fi export FSTYP=overlay # Store original base fs vars @@ -691,13 +693,6 @@ get_next_config() { _check_device SCRATCH_LOGDEV optional $SCRATCH_LOGDEV fi - # Override FSTYP from config when running ./check -overlay - # and maybe override base fs TEST/SCRATCH_DEV with overlay base dirs. - # We need to do this *after* default mount options are set by base FSTYP - # and *after* SCRATCH_DEV is deduced from SCRATCH_DEV_POOL - if [ "$OVERLAY" == "true" -o "$FSTYP" == "overlay" ]; then - _overlay_config_override - fi } if [ -z "$CONFIG_INCLUDED" ]; then @@ -711,6 +706,15 @@ if [ -z "$CONFIG_INCLUDED" ]; then [ ! -z "$TEST_DEV" ]; then FSTYP=`blkid -c /dev/null -s TYPE -o value $TEST_DEV` fi + + # Override FSTYP from config when running ./check -overlay + # and maybe override base fs TEST/SCRATCH_DEV with overlay base dirs. + # We need to do this *after* default mount options are set by base FSTYP + # and *after* SCRATCH_DEV is deduced from SCRATCH_DEV_POOL + if [ "$OVERLAY" == "true" -o "$FSTYP" == "overlay" ]; then + _overlay_config_override + fi + FSTYP=${FSTYP:=xfs} export FSTYP [ -z "$MOUNT_OPTIONS" ] && _mount_opts Thanks, Chengguang. -- 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