Older kernels don't have /sys/fs/btrfs. btrfs/010 will happily run
until it goes to check its work against sysfs and finds those files
don't exist. This patch introduces a require check to ensure that
the sysfs files are present before running.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
_notrun "Feature $feat not supported by the available btrfs version"
}
+_require_btrfs_fs_sysfs()
+{
+ modprobe btrfs > /dev/null 2>&1
+ [ -e /sys/fs/btrfs/features ] || \
+ _notrun "Sysfs not supported by the available btrfs version"
+
+}
+
_check_btrfs_filesystem()
{
device=$1
_supported_fs btrfs
_supported_os Linux
_require_test
+_require_btrfs_fs_sysfs
# Create 32k extents. All of these extents will be accounted as outstanding and
# reserved.