linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfs-utils mount: recover the lost EBUSY
@ 2018-09-17 11:38 jiyin
  2018-09-25 15:40 ` Steve Dickson
  0 siblings, 1 reply; 4+ messages in thread
From: jiyin @ 2018-09-17 11:38 UTC (permalink / raw)
  To: steved; +Cc: linux-nfs, Jianhong.Yin

From: "Jianhong.Yin" <yin-jianhong@163.com>

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.

Signed-off-by: Jianhong Yin <yin-jianhong@163.com>
---
 utils/mount/stropts.c | 9 ---------
 1 file changed, 9 deletions(-)

diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index 4d2e37e..ca5bc7f 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -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;
 
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] nfs-utils mount: recover the lost EBUSY
  2018-09-17 11:38 [PATCH] nfs-utils mount: recover the lost EBUSY jiyin
@ 2018-09-25 15:40 ` Steve Dickson
  2018-09-26  2:21   ` Jianhong Yin
  0 siblings, 1 reply; 4+ messages in thread
From: Steve Dickson @ 2018-09-25 15:40 UTC (permalink / raw)
  To: jiyin; +Cc: linux-nfs, Jianhong.Yin



On 9/17/18 7:38 AM, jiyin@redhat.com wrote:
> From: "Jianhong.Yin" <yin-jianhong@163.com>
> 
> 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.
> 
> Signed-off-by: Jianhong Yin <yin-jianhong@163.com>
> ---
>  utils/mount/stropts.c | 9 ---------
>  1 file changed, 9 deletions(-)
> 
> diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
> index 4d2e37e..ca5bc7f 100644
> --- a/utils/mount/stropts.c
> +++ b/utils/mount/stropts.c
> @@ -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;
>  
> 
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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nfs-utils mount: recover the lost EBUSY
  2018-09-25 15:40 ` Steve Dickson
@ 2018-09-26  2:21   ` Jianhong Yin
  2018-09-26 18:09     ` Steve Dickson
  0 siblings, 1 reply; 4+ messages in thread
From: Jianhong Yin @ 2018-09-26  2:21 UTC (permalink / raw)
  To: Steve Dickson; +Cc: linux-nfs, Jianhong.Yin


----- 原始邮件 -----
> 发件人: "Steve Dickson" <SteveD@RedHat.com>
> 收件人: jiyin@redhat.com
> 抄送: linux-nfs@vger.kernel.org, "Jianhong.Yin" <yin-jianhong@163.com>
> 发送时间: 星期二, 2018年 9 月 25日 下午 11:40:03
> 主题: Re: [PATCH] nfs-utils mount: recover the lost EBUSY
> 
> 
> 
> On 9/17/18 7:38 AM, jiyin@redhat.com wrote:
> > From: "Jianhong.Yin" <yin-jianhong@163.com>
> > 
> > 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.
> > 
> > Signed-off-by: Jianhong Yin <yin-jianhong@163.com>
> > ---
> >  utils/mount/stropts.c | 9 ---------
> >  1 file changed, 9 deletions(-)
> > 
> > diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
> > index 4d2e37e..ca5bc7f 100644
> > --- a/utils/mount/stropts.c
> > +++ b/utils/mount/stropts.c
> > @@ -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;
> >  
> > 
> 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

> 
> steved.
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] nfs-utils mount: recover the lost EBUSY
  2018-09-26  2:21   ` Jianhong Yin
@ 2018-09-26 18:09     ` Steve Dickson
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2018-09-26 18:09 UTC (permalink / raw)
  To: Jianhong Yin; +Cc: linux-nfs, Jianhong.Yin



On 9/25/18 10:21 PM, Jianhong Yin wrote:
> 
> ----- 原始邮件 -----
>> 发件人: "Steve Dickson" <SteveD@RedHat.com>
>> 收件人: jiyin@redhat.com
>> 抄送: linux-nfs@vger.kernel.org, "Jianhong.Yin" <yin-jianhong@163.com>
>> 发送时间: 星期二, 2018年 9 月 25日 下午 11:40:03
>> 主题: Re: [PATCH] nfs-utils mount: recover the lost EBUSY
>>
>>
>>
>> On 9/17/18 7:38 AM, jiyin@redhat.com wrote:
>>> From: "Jianhong.Yin" <yin-jianhong@163.com>
>>>
>>> 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.
>>>
>>> Signed-off-by: Jianhong Yin <yin-jianhong@163.com>
>>> ---
>>>  utils/mount/stropts.c | 9 ---------
>>>  1 file changed, 9 deletions(-)
>>>
>>> diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
>>> index 4d2e37e..ca5bc7f 100644
>>> --- a/utils/mount/stropts.c
>>> +++ b/utils/mount/stropts.c
>>> @@ -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;
>>>  
>>>
>> 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
Propose on to see where it goes... 

steved.

> 
>>
>> steved.
>>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-27  0:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-17 11:38 [PATCH] nfs-utils mount: recover the lost EBUSY jiyin
2018-09-25 15:40 ` Steve Dickson
2018-09-26  2:21   ` Jianhong Yin
2018-09-26 18:09     ` Steve Dickson

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).