rgmanager: Treat exit status 16 from umount as success
PATCH 4/5 rgmanager: Treat exit status 16 from umount as success
When the filesystem /etc lives on is completely full, umount will exit with exit status 16 if the umount syscall succeeded but it was unable to write a new mtab file because the disk is full. umount won't exit with status 16 under any other circumstances.
This patch changes the fs.sh, clusterfs.sh, and netfs.sh resource agents to check treat both exit status 0 and exit status 16 as success.
Resolves: rhbz#819595
--- rgmanager/src/resources/clusterfs.sh | 3 ++- rgmanager/src/resources/fs.sh | 3 ++- rgmanager/src/resources/netfs.sh | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-)
rgmanager/src/resources/clusterfs.sh +2 -1
@@ -793,7 +793,8 @@ stop: Could not match $OCF_RESKEY_device with a real device" ocf_log info "unmounting $dev ($mp)" umount $mp - if [ $? -eq 0 ]; then + retval=$? + if [ $retval -eq 0 -o $retval -eq 16 ]; then umount_failed= done=$YES continue
rgmanager/src/resources/fs.sh +2 -1
@@ -1103,7 +1103,8 @@ stop: Could not match $OCF_RESKEY_device with a real device" ocf_log info "unmounting $mp" umount $mp - if [ $? -eq 0 ]; then + retval=$? + if [ $retval -eq 0 -o $retval -eq 16 ]; then umount_failed= done=$YES continue
rgmanager/src/resources/netfs.sh +2 -1
@@ -560,7 +560,8 @@ stopNFSFilesystem() { ocf_log info "unmounting $mp" umount $umount_flag $mp - if [ $? -eq 0 ]; then + retval=$? + if [ $retval -eq 0 -o $retval -eq 16 ]; then umount_failed= done=$YES continue
Signature · 1 line
1.7.10.2
PATCH 4/5 rgmanager: Treat exit status 16 from umount as success
Hi,
Quoted 9 lines
When the filesystem /etc lives on is completely full, umount will exit with exit status 16 if the umount syscall succeeded but it was unable to write a new mtab file because the disk is full. umount won't exit with status 16 under any other circumstances.
This patch changes the
fs.sh,clusterfs.sh, andnetfs.shresource agents to check treat both exit status 0 and exit status 16 as success.Resolves: rhbz#819595
I'm afraid of forgetting the meaning of 16 when I have to read this code as part of my job. git may help me but repository will be moved to somewhere in such case:-P
How do you think do like:
readonly fail_to_update_mtab=16
...
if [ $retval -eq 0 -o $retval -eq ${fail_to_update_mtab} ]; thenMasatake YAMATO
Quoted 52 lines
Signed-off-by Ryan McCabe <[email protected]>--- rgmanager/src/resources/clusterfs.sh | 3 ++- rgmanager/src/resources/fs.sh | 3 ++- rgmanager/src/resources/netfs.sh | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-)rgmanager/src/resources/clusterfs.sh +2
-1@@ -793,7 +793,8 @@ stop: Could not match $OCF_RESKEY_device with a real device" ocf_log info "unmounting $dev ($mp)" umount $mp - if [ $? -eq 0 ]; then + retval=$? + if [ $retval -eq 0 -o $retval -eq 16 ]; then umount_failed= done=$YES continuergmanager/src/resources/fs.sh +2
-1@@ -1103,7 +1103,8 @@ stop: Could not match $OCF_RESKEY_device with a real device" ocf_log info "unmounting $mp" umount $mp - if [ $? -eq 0 ]; then + retval=$? + if [ $retval -eq 0 -o $retval -eq 16 ]; then umount_failed= done=$YES continuergmanager/src/resources/netfs.sh +2
-1@@ -560,7 +560,8 @@ stopNFSFilesystem() { ocf_log info "unmounting $mp" umount $umount_flag $mp - if [ $? -eq 0 ]; then + retval=$? + if [ $retval -eq 0 -o $retval -eq 16 ]; then umount_failed= done=$YES continueSignature · 1 line
1.7.10.2
PATCH 4/5 rgmanager: Treat exit status 16 from umount as success
In reply to Ryan McCabeACK, but please add Masatake YAMATO suggestion to the final patch.
Fabio
Quoted 60 lines · Ryan McCabe
When the filesystem /etc lives on is completely full, umount will exit with exit status 16 if the umount syscall succeeded but it was unable to write a new mtab file because the disk is full. umount won't exit with status 16 under any other circumstances.
This patch changes the
fs.sh,clusterfs.sh, andnetfs.shresource agents to check treat both exit status 0 and exit status 16 as success.Resolves: rhbz#819595
Signed-off-by Ryan McCabe <[email protected]>--- rgmanager/src/resources/clusterfs.sh | 3 ++- rgmanager/src/resources/fs.sh | 3 ++- rgmanager/src/resources/netfs.sh | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-)rgmanager/src/resources/clusterfs.sh +2
-1@@ -793,7 +793,8 @@ stop: Could not match $OCF_RESKEY_device with a real device" ocf_log info "unmounting $dev ($mp)" umount $mp - if [ $? -eq 0 ]; then + retval=$? + if [ $retval -eq 0 -o $retval -eq 16 ]; then umount_failed= done=$YES continuergmanager/src/resources/fs.sh +2
-1@@ -1103,7 +1103,8 @@ stop: Could not match $OCF_RESKEY_device with a real device" ocf_log info "unmounting $mp" umount $mp - if [ $? -eq 0 ]; then + retval=$? + if [ $retval -eq 0 -o $retval -eq 16 ]; then umount_failed= done=$YES continuergmanager/src/resources/netfs.sh +2
-1@@ -560,7 +560,8 @@ stopNFSFilesystem() { ocf_log info "unmounting $mp" umount $umount_flag $mp - if [ $? -eq 0 ]; then + retval=$? + if [ $retval -eq 0 -o $retval -eq 16 ]; then umount_failed= done=$YES continue