umount.nfs shouldn't remove a busy file system from /etc/mtab, and should
report and return an error. I also added an extra "goto" to make the flow
of control more clear, and to reduce the chance that a future change in
this logic will break it.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Neil Brown <neilb@suse.de>
} else
res = umount (node);
- if (res < 0 && remount && errno == EBUSY && spec) {
- res = try_remount(spec, node);
- if (!res)
+ if (res < 0) {
+ if (remount && errno == EBUSY && spec) {
+ res = try_remount(spec, node);
+ if (res)
+ goto writemtab;
return 0;
+ } else
+ umnt_err = errno;
}
if (res >= 0) {