Whamcloud - gitweb
ext2fs: check if Lustre filesystem is mounted
authorAndreas Dilger <andreas.dilger@intel.com>
Fri, 13 Apr 2012 08:16:24 +0000 (02:16 -0600)
committerLi Dongyang <dongyangli@ddn.com>
Wed, 21 Apr 2021 06:34:03 +0000 (16:34 +1000)
commitdd936ff06dd22ba8d64a2a814441e53375d529b4
treea6bcb21114c640fc7ae84832e1a347dff0c80a48
parent1ef93745227af455da045cdf4a48ec1ae38c518c
ext2fs: check if Lustre filesystem is mounted

Add a check to ext2fs_check_mount_point() to loo in /proc/fs/lustre/*
to see if Lustre is mounted, since st_rdev of the mountpoint does not
match st_rdev of the block device itself, which confuses libext2fs.

  LU-6093 ext2fs: don't confuse mke2fs by Lustre zfs mount

  check_if_lustre_mounted() by efb735 will mistakenly report the
  device is mounted when there is a ZFS-based Lustre mount.

  This patch fix it by parsing the real device name from the pool
  name exported in Lustre proc file with "zpool" command.

  It also includes a typo fix in check_if_lustre_mounted() and a
  few other code cleanups.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
  Change-Id: I43dabbcd6fa721c569cd9cc0f4a6de93ab761392
  Reviewed-on: http://review.whamcloud.com/14223
Reviewed-by: John L. Hammond <john.hammond@intel.com>
  LU-12641 libext2fs: memory leak of check_if_lustre_mounted

  check_if_lustre_mounted() doesn't free the allocated memory
  if failure.

  Change-Id: I36b5c1e981ca4f1db8c9515be29dd98c074d14dc
Signed-off-by: Li Xi <lixi@ddn.com>
  Reviewed-on: https://review.whamcloud.com/35729
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
lib/ext2fs/ismounted.c