Whamcloud - gitweb
LU-3682 tunefs: prevent tunefs running on a mounted device
This patch is to check if the given device is already mounted in
the following two situations.
1) Try to get the real path to the given device, in case it is a
symbolic link or dm device for instance, and return EEXIST if it
is already mounted.
2) If the given file is already associated with a mounted loop
device, check_mtab_entry() should return EEXIST to prevent the
following loop setup attemp.
Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Change-Id: I57d9dc443d94057014212cb30d04a2f385b50d7b
Reviewed-on: http://review.whamcloud.com/7433
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>