* [Cluster-devel] [PATCH 4/5] rgmanager: Treat exit status 16 from umount as success
@ 2012-06-28 19:57 Ryan McCabe
2012-06-28 20:59 ` Masatake YAMATO
2012-07-04 11:08 ` Fabio M. Di Nitto
0 siblings, 2 replies; 3+ messages in thread
From: Ryan McCabe @ 2012-06-28 19:57 UTC (permalink / raw)
To: cluster-devel.redhat.com
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
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
---
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(-)
diff --git a/rgmanager/src/resources/clusterfs.sh b/rgmanager/src/resources/clusterfs.sh
index 49eb724..eae1ee0 100755
--- a/rgmanager/src/resources/clusterfs.sh
+++ b/rgmanager/src/resources/clusterfs.sh
@@ -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
diff --git a/rgmanager/src/resources/fs.sh b/rgmanager/src/resources/fs.sh
index a98cddc..5d6bc1b 100755
--- a/rgmanager/src/resources/fs.sh
+++ b/rgmanager/src/resources/fs.sh
@@ -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
diff --git a/rgmanager/src/resources/netfs.sh b/rgmanager/src/resources/netfs.sh
index 837a4c4..9f0daa4 100755
--- a/rgmanager/src/resources/netfs.sh
+++ b/rgmanager/src/resources/netfs.sh
@@ -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
--
1.7.10.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Cluster-devel] [PATCH 4/5] rgmanager: Treat exit status 16 from umount as success
2012-06-28 19:57 [Cluster-devel] [PATCH 4/5] rgmanager: Treat exit status 16 from umount as success Ryan McCabe
@ 2012-06-28 20:59 ` Masatake YAMATO
2012-07-04 11:08 ` Fabio M. Di Nitto
1 sibling, 0 replies; 3+ messages in thread
From: Masatake YAMATO @ 2012-06-28 20:59 UTC (permalink / raw)
To: cluster-devel.redhat.com
Hi,
> 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
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} ]; then
Masatake YAMATO
> Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
> ---
> 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(-)
>
> diff --git a/rgmanager/src/resources/clusterfs.sh b/rgmanager/src/resources/clusterfs.sh
> index 49eb724..eae1ee0 100755
> --- a/rgmanager/src/resources/clusterfs.sh
> +++ b/rgmanager/src/resources/clusterfs.sh
> @@ -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
> diff --git a/rgmanager/src/resources/fs.sh b/rgmanager/src/resources/fs.sh
> index a98cddc..5d6bc1b 100755
> --- a/rgmanager/src/resources/fs.sh
> +++ b/rgmanager/src/resources/fs.sh
> @@ -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
> diff --git a/rgmanager/src/resources/netfs.sh b/rgmanager/src/resources/netfs.sh
> index 837a4c4..9f0daa4 100755
> --- a/rgmanager/src/resources/netfs.sh
> +++ b/rgmanager/src/resources/netfs.sh
> @@ -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
> --
> 1.7.10.2
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Cluster-devel] [PATCH 4/5] rgmanager: Treat exit status 16 from umount as success
2012-06-28 19:57 [Cluster-devel] [PATCH 4/5] rgmanager: Treat exit status 16 from umount as success Ryan McCabe
2012-06-28 20:59 ` Masatake YAMATO
@ 2012-07-04 11:08 ` Fabio M. Di Nitto
1 sibling, 0 replies; 3+ messages in thread
From: Fabio M. Di Nitto @ 2012-07-04 11:08 UTC (permalink / raw)
To: cluster-devel.redhat.com
ACK, but please add Masatake YAMATO suggestion to the final patch.
Fabio
On 6/28/2012 9:57 PM, Ryan McCabe wrote:
> 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
>
> Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
> ---
> 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(-)
>
> diff --git a/rgmanager/src/resources/clusterfs.sh b/rgmanager/src/resources/clusterfs.sh
> index 49eb724..eae1ee0 100755
> --- a/rgmanager/src/resources/clusterfs.sh
> +++ b/rgmanager/src/resources/clusterfs.sh
> @@ -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
> diff --git a/rgmanager/src/resources/fs.sh b/rgmanager/src/resources/fs.sh
> index a98cddc..5d6bc1b 100755
> --- a/rgmanager/src/resources/fs.sh
> +++ b/rgmanager/src/resources/fs.sh
> @@ -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
> diff --git a/rgmanager/src/resources/netfs.sh b/rgmanager/src/resources/netfs.sh
> index 837a4c4..9f0daa4 100755
> --- a/rgmanager/src/resources/netfs.sh
> +++ b/rgmanager/src/resources/netfs.sh
> @@ -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
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-07-04 11:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-28 19:57 [Cluster-devel] [PATCH 4/5] rgmanager: Treat exit status 16 from umount as success Ryan McCabe
2012-06-28 20:59 ` Masatake YAMATO
2012-07-04 11:08 ` Fabio M. Di Nitto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).