File 0005-Medium-exportfs-don-t-increment-fsid-for-single-dire.patch of Package resource-agents.2497
From 014a87b6ffce6b5b64379371ec5f8689b0fb7bf9 Mon Sep 17 00:00:00 2001
From: Dejan Muhamedagic <dejan@suse.de>
Date: Mon, 21 Dec 2015 15:35:44 +0100
Subject: [PATCH 5/9] Medium: exportfs: don't increment fsid for single
directory
---
heartbeat/exportfs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/heartbeat/exportfs b/heartbeat/exportfs
index c4ec653..4b88fa1 100755
--- a/heartbeat/exportfs
+++ b/heartbeat/exportfs
@@ -201,7 +201,7 @@ forall() {
for dir in $OCF_RESKEY_directory; do
$func $dir "$@"
rc=$(($rc | $?))
- bump_fsid
+ [ $NUMDIRS -gt 1 ] && bump_fsid
[ "$fast_exit" ] && continue
[ $rc -ne 0 ] && return $rc
done
@@ -409,7 +409,7 @@ testdir() {
}
exportfs_validate_all ()
{
- if [ `echo "$OCF_RESKEY_directory" | wc -w` -gt 1 ] &&
+ if [ $NUMDIRS -gt 1 ] &&
! ocf_is_decimal "$OCF_RESKEY_fsid"; then
ocf_exit_reason "use integer fsid when exporting multiple directories"
return $OCF_ERR_CONFIGURED
@@ -428,6 +428,7 @@ if [ -n "$newdir" ]; then
OCF_RESKEY_directory=$newdir
fi
+NUMDIRS=`echo "$OCF_RESKEY_directory" | wc -w`
OCF_REQUIRED_PARAMS="directory fsid clientspec"
OCF_REQUIRED_BINARIES="exportfs"
ocf_rarun $*
--
2.6.2