umount -l when a loop devices is involved may be problematic

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13924 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2012-10-01 19:52:10 +00:00
parent 1ea24371ca
commit f23561573c

View File

@ -101,7 +101,8 @@ sub process_request {
if (system("mount $mntopts '$file' /mnt/xcat")) {
eval { $callback->({error=>"copycds was unable to mount $file to /mnt/xcat.",errorcode=>[1]}) };
system("umount -l /mnt/xcat");
chdir("/");
system("umount /mnt/xcat");
return;
}
eval {
@ -146,7 +147,8 @@ sub process_request {
chdir($existdir);
while (wait() > 0) { yield(); } #Make sure all children exit before trying umount
};
system("umount -l /mnt/xcat");
chdir("/");
system("umount /mnt/xcat");
unless ($identified) {
$callback->({error=>["copycds could not identify the ISO supplied, you may wish to try -n <osver>"],errorcode=>[1]});
}