Skip to contentSkip to conversation

nfs-utils mount: recover the lost EBUSY

PATCH In review [email protected] 2 participants 4 messages Sep 17, 2018 – Sep 27, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs-utils mount: recover the lost EBUSY

From: "Jianhong.Yin" <[email protected]>

see: https://bugzilla.redhat.com/show_bug.cgi?id=1629705
[nfs-utils] mount -osharecache failure but return 'true'

mount.nfs4 -o context=system_u:object_r:user_home_dir_t:s0,sharecache $serv:$expdir $nfsmp mount.nfs4 -o context=system_u:object_r:xferlog_t:s0,sharecache $serv:$expdir $nfsmp2 ^^^ here mount fail, but return true. it confuse user!

Anyway, we should not hide the failure and pretend that it does not exist.

---
 utils/mount/stropts.c | 9 ---------
 1 file changed, 9 deletions(-)
utils/mount/stropts.c +0 -9
index 4d2e37e..ca5bc7f 100644
@@ -1078,15 +1078,6 @@ static int nfsmount_fg(struct nfsmount_info *mi)
 		if (nfs_try_mount(mi))
 			return EX_SUCCESS;
 
-		if (errno == EBUSY)
-			/* The only cause of EBUSY is if exactly the desired
-			 * filesystem is already mounted.  That can arguably
-			 * be seen as success.  "mount -a" tries to optimise
-			 * out this case but sometimes fails.  Help it out
-			 * by pretending everything is rosy
-			 */
-			return EX_SUCCESS;
-
 		if (nfs_is_permanent_error(errno))
 			break;
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 28 lines · On 9/17/18 7:38 AM, [email protected] wrote:

From: "Jianhong.Yin" <[email protected]>

see: https://bugzilla.redhat.com/show_bug.cgi?id=1629705
[nfs-utils] mount -osharecache failure but return 'true'

mount.nfs4 -o context=system_u:object_r:user_home_dir_t:s0,sharecache $serv:$expdir $nfsmp mount.nfs4 -o context=system_u:object_r:xferlog_t:s0,sharecache $serv:$expdir $nfsmp2 ^^^ here mount fail, but return true. it confuse user!

Anyway, we should not hide the failure and pretend that it does not exist.

---
 utils/mount/stropts.c | 9 ---------
 1 file changed, 9 deletions(-)
utils/mount/stropts.c +0 -2
index 4d2e37e..ca5bc7f 100644
@@ -1078,15 +1078,6 @@ static int nfsmount_fg(struct nfsmount_info *mi)
 		if (nfs_try_mount(mi))
 			return EX_SUCCESS;
 
-		if (errno == EBUSY)
-			/* The only cause of EBUSY is if exactly the desired

utils/mount/stropts.c static int nfsmount_fg(struct nfsmount_info *mi) · line 1083

Quoted 10 lines
utils/mount/stropts.c +0 -7
-			 * filesystem is already mounted.  That can arguably
-			 * be seen as success.  "mount -a" tries to optimise
-			 * out this case but sometimes fails.  Help it out
-			 * by pretending everything is rosy
-			 */
-			return EX_SUCCESS;
-
 		if (nfs_is_permanent_error(errno))
 			break;
 

It code is here because of commit 3904d8102 which argues the re-mounting of a filesystem that is already mounted is not an error... which I tend to agree with...

steved.

#2 lore raw

----- 原始邮件 -----

Quoted 36 lines

发件人: "Steve Dickson" <[email protected]>
收件人: [email protected]
抄送: [email protected], "Jianhong.Yin" <[email protected]> 发送时间: 星期二, 2018年 9 月 25日 下午 11:40:03
主题: Re: [PATCH] nfs-utils mount: recover the lost EBUSY

Quoted 27 lines · On 9/17/18 7:38 AM, [email protected] wrote:

From: "Jianhong.Yin" <[email protected]>

see: https://bugzilla.redhat.com/show_bug.cgi?id=1629705
[nfs-utils] mount -osharecache failure but return 'true'

mount.nfs4 -o context=system_u:object_r:user_home_dir_t:s0,sharecache $serv:$expdir $nfsmp
mount.nfs4 -o context=system_u:object_r:xferlog_t:s0,sharecache $serv:$expdir $nfsmp2
^^^ here mount fail, but return true. it confuse user!

Anyway, we should not hide the failure and pretend that it does not exist.

---
 utils/mount/stropts.c | 9 ---------
 1 file changed, 9 deletions(-)
utils/mount/stropts.c +0 -0
index 4d2e37e..ca5bc7f 100644
@@ -1078,15 +1078,6 @@ static int nfsmount_fg(struct nfsmount_info *mi)
 		if (nfs_try_mount(mi))
 			return EX_SUCCESS;
 
Quoted 16 lines

utils/mount/stropts.c static int nfsmount_fg(struct nfsmount_info *mi) · line 1083

Quoted 13 lines
utils/mount/stropts.c +0 -9
-		if (errno == EBUSY)
-			/* The only cause of EBUSY is if exactly the desired
-			 * filesystem is already mounted.  That can arguably
-			 * be seen as success.  "mount -a" tries to optimise
-			 * out this case but sometimes fails.  Help it out
-			 * by pretending everything is rosy
-			 */
-			return EX_SUCCESS;
-
 		if (nfs_is_permanent_error(errno))
 			break;
 

It code is here because of commit 3904d8102 which argues the re-mounting of a filesystem that is already mounted is not an error... which I tend to agree with...

Got it.

how about : change in kernel if (re-mounting && busy) return TRUE from syscall->mount

Quoted 3 lines

steved.

#3 lore raw
Quoted 54 lines · Jianhong Yin

----- 原始邮件 -----

Quoted 36 lines

发件人: "Steve Dickson" <[email protected]>
收件人: [email protected]
抄送: [email protected], "Jianhong.Yin" <[email protected]> 发送时间: 星期二, 2018年 9 月 25日 下午 11:40:03
主题: Re: [PATCH] nfs-utils mount: recover the lost EBUSY

Quoted 27 lines · On 9/17/18 7:38 AM, [email protected] wrote:

From: "Jianhong.Yin" <[email protected]>

see: https://bugzilla.redhat.com/show_bug.cgi?id=1629705
[nfs-utils] mount -osharecache failure but return 'true'

mount.nfs4 -o context=system_u:object_r:user_home_dir_t:s0,sharecache $serv:$expdir $nfsmp
mount.nfs4 -o context=system_u:object_r:xferlog_t:s0,sharecache $serv:$expdir $nfsmp2
^^^ here mount fail, but return true. it confuse user!

Anyway, we should not hide the failure and pretend that it does not exist.

---
 utils/mount/stropts.c | 9 ---------
 1 file changed, 9 deletions(-)
utils/mount/stropts.c +0 -0
index 4d2e37e..ca5bc7f 100644
@@ -1078,15 +1078,6 @@ static int nfsmount_fg(struct nfsmount_info *mi)
 		if (nfs_try_mount(mi))
 			return EX_SUCCESS;
 
Quoted 16 lines

utils/mount/stropts.c static int nfsmount_fg(struct nfsmount_info *mi) · line 1083

Quoted 13 lines
utils/mount/stropts.c +0 -9
-		if (errno == EBUSY)
-			/* The only cause of EBUSY is if exactly the desired
-			 * filesystem is already mounted.  That can arguably
-			 * be seen as success.  "mount -a" tries to optimise
-			 * out this case but sometimes fails.  Help it out
-			 * by pretending everything is rosy
-			 */
-			return EX_SUCCESS;
-
 		if (nfs_is_permanent_error(errno))
 			break;
 

It code is here because of commit 3904d8102 which argues the re-mounting of a filesystem that is already mounted is not an error... which I tend to agree with...

Quoted 3 lines

Got it.

how about : change in kernel if (re-mounting && busy) return TRUE from syscall->mount

Propose on to see where it goes...

steved.

Quoted 4 lines
Quoted 4 lines

steved.