@@ -273,6 +273,18 @@ _overlay_mount()
local dir=$1
local mnt=$2
shift 2
+
+ if [ "$(df --output=fstype $dir | tail -1)" == "xfs" ] && \
+ ! xfs_info $dir | grep -q "ftype=1" ; then
+ _notrun "upper fs needs to support d_type"
+ fi
+
+ if [[ "$(df --output=fstype $dir | tail -1)" =~ ext ]] && \
+ ! tune2fs -l $(df --output=source $dir | tail -1) | \
+ grep -q filetype ; then
+ _notrun "upper fs needs to support d_type"
+ fi
+
mkdir -p $dir/$OVERLAY_UPPER_DIR
mkdir -p $dir/$OVERLAY_LOWER_DIR
mkdir -p $dir/$OVERLAY_WORK_DIR
Overlayfs whiteout can be visible if underlying upper fs does not support d_type. Kernel commit 45aebea (ovl: Ensure upper filesystem supports d_type) prevents mounting overlayfs like this since v4.6-rc1. Check upper fs before mounting overlay, mark as not run if needs. Signed-off-by: Xiong Zhou <xzhou@redhat.com> --- common/rc | 12 ++++++++++++ 1 file changed, 12 insertions(+)