Skip to content

Commit

Permalink
Merge pull request #1611 from nrwahl2/nrwahl2-rhbz1924363
Browse files Browse the repository at this point in the history
nfsserver: Error-check unbind_tree
  • Loading branch information
oalbrigt committed Feb 16, 2021
2 parents 5a1a994 + dc4fc6f commit 6833192
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions heartbeat/nfsserver
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,20 @@ unbind_tree ()
sleep 1
i=$((i + 1))
done

if mount | grep -q " on $OCF_RESKEY_rpcpipefs_dir "; then
ocf_log err "Failed to unmount $OCF_RESKEY_rpcpipefs_dir"
return $OCF_ERR_GENERIC
fi

if is_bound /var/lib/nfs; then
umount /var/lib/nfs
if ! umount /var/lib/nfs; then
ocf_log err "Failed to unmount /var/lib/nfs"
return $OCF_ERR_GENERIC
fi
fi

return $OCF_SUCCESS
}

binary_status()
Expand Down Expand Up @@ -836,8 +847,14 @@ nfsserver_stop ()
esac

unbind_tree
ocf_log info "NFS server stopped"
return 0
rc=$?
if [ "$rc" -ne $OCF_SUCCESS ]; then
ocf_exit_reason "Failed to unmount a bind mount"
else
ocf_log info "NFS server stopped"
fi

return $rc
}

nfsserver_validate ()
Expand Down

0 comments on commit 6833192

Please sign in to comment.