2008-04-25 08:05:37

by Steinar H. Gunderson

[permalink] [raw]
Subject: retry= is additive with the text-based mount interface

Hi,

(Via a user bug report)

It seems retry= is now additive with the text-based mount interface. In
particular, "mount -o retry=0" still gives a two-minute timeout. Is this
intentional?

/* Steinar */
--
Homepage: http://www.sesse.net/


2008-04-25 16:21:12

by Chuck Lever

[permalink] [raw]
Subject: Re: retry= is additive with the text-based mount interface



--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com


Attachments:
fix-retry-option (2.89 kB)

2008-04-25 16:35:01

by Steinar H. Gunderson

[permalink] [raw]
Subject: Re: retry= is additive with the text-based mount interface

On Fri, Apr 25, 2008 at 12:20:19PM -0400, Chuck Lever wrote:
>> It seems retry= is now additive with the text-based mount interface. In
>> particular, "mount -o retry=0" still gives a two-minute timeout. Is this
>> intentional?
> No, it's broken. Can you test the attached patch?

It seems it creates rather odd behavior:


fugl:~# mount -t nfs -v -o retry=0 10.0.0.11:/foo /mnt
mount.nfs: timeout set for Thu Jan 1 14:40:25 1970
mount.nfs: text-based options: 'retry=0,addr=10.0.0.11'

fugl:~# mount -t nfs -v -o retry=0 10.0.0.11:/foo /mnt
mount.nfs: timeout set for Sat Jan 10 17:07:36 1970
mount.nfs: text-based options: 'retry=0,addr=10.0.0.11'

/* Steinar */
--
Homepage: http://www.sesse.net/

2008-04-25 16:48:21

by Chuck Lever

[permalink] [raw]
Subject: Re: retry= is additive with the text-based mount interface

On Apr 25, 2008, at 12:34 PM, Steinar H. Gunderson wrote:
> On Fri, Apr 25, 2008 at 12:20:19PM -0400, Chuck Lever wrote:
>>> It seems retry= is now additive with the text-based mount
>>> interface. In
>>> particular, "mount -o retry=0" still gives a two-minute timeout.
>>> Is this
>>> intentional?
>> No, it's broken. Can you test the attached patch?
>
> It seems it creates rather odd behavior:
>
>
> fugl:~# mount -t nfs -v -o retry=0 10.0.0.11:/foo /mnt
> mount.nfs: timeout set for Thu Jan 1 14:40:25 1970
> mount.nfs: text-based options: 'retry=0,addr=10.0.0.11'

On my test system (Fedora 7) I get correct behavior with both /bin/
mount and when using /sbin/mount.nfs directly.

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

2008-04-25 16:59:23

by Steinar H. Gunderson

[permalink] [raw]
Subject: Re: retry= is additive with the text-based mount interface

On Fri, Apr 25, 2008 at 12:45:36PM -0400, Chuck Lever wrote:
>> fugl:~# mount -t nfs -v -o retry=0 10.0.0.11:/foo /mnt
>> mount.nfs: timeout set for Thu Jan 1 14:40:25 1970
>> mount.nfs: text-based options: 'retry=0,addr=10.0.0.11'
> On my test system (Fedora 7) I get correct behavior with both /bin/mount
> and when using /sbin/mount.nfs directly.

It seems the patch has an issue:

+ if (!parse_retry_option(&timeout, options, NFS_DEF_FG_TIMEOUT_MINUTES))

where parse_retry_option() _adds_ to timeout. But timeout is not initialized :-)

/* Steinar */
--
Homepage: http://www.sesse.net/

2008-04-25 17:05:07

by Trond Myklebust

[permalink] [raw]
Subject: Re: retry= is additive with the text-based mount interface


On Fri, 2008-04-25 at 18:59 +0200, Steinar H. Gunderson wrote:
> On Fri, Apr 25, 2008 at 12:45:36PM -0400, Chuck Lever wrote:
> >> fugl:~# mount -t nfs -v -o retry=0 10.0.0.11:/foo /mnt
> >> mount.nfs: timeout set for Thu Jan 1 14:40:25 1970
> >> mount.nfs: text-based options: 'retry=0,addr=10.0.0.11'
> > On my test system (Fedora 7) I get correct behavior with both /bin/mount
> > and when using /sbin/mount.nfs directly.
>
> It seems the patch has an issue:
>
> + if (!parse_retry_option(&timeout, options, NFS_DEF_FG_TIMEOUT_MINUTES))
>
> where parse_retry_option() _adds_ to timeout. But timeout is not initialized :-)

Why would we ever want to do anything other than just set the timeout
here, Chuck?

Trond


2008-04-25 17:19:20

by Chuck Lever

[permalink] [raw]
Subject: Re: retry= is additive with the text-based mount interface

On Apr 25, 2008, at 12:59 PM, Steinar H. Gunderson wrote:
> On Fri, Apr 25, 2008 at 12:45:36PM -0400, Chuck Lever wrote:
>>> fugl:~# mount -t nfs -v -o retry=0 10.0.0.11:/foo /mnt
>>> mount.nfs: timeout set for Thu Jan 1 14:40:25 1970
>>> mount.nfs: text-based options: 'retry=0,addr=10.0.0.11'
>> On my test system (Fedora 7) I get correct behavior with both /bin/
>> mount
>> and when using /sbin/mount.nfs directly.
>
> It seems the patch has an issue:
>
> + if (!parse_retry_option(&timeout, options,
> NFS_DEF_FG_TIMEOUT_MINUTES))
>
> where parse_retry_option() _adds_ to timeout. But timeout is not
> initialized :-)

Just change "*timeout +=" to "*timeout =" in parse_retry_option().

That was the bug I was trying to fix in the first place. Sigh.

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com

2008-04-25 17:38:36

by Steinar H. Gunderson

[permalink] [raw]
Subject: Re: retry= is additive with the text-based mount interface

On Fri, Apr 25, 2008 at 01:11:02PM -0400, Chuck Lever wrote:
> Just change "*timeout +=" to "*timeout =" in parse_retry_option().
>
> That was the bug I was trying to fix in the first place. Sigh.

That fixes it -- thanks!

/* Steinar */
--
Homepage: http://www.sesse.net/

2008-04-25 20:38:47

by Chuck Lever

[permalink] [raw]
Subject: Re: retry= is additive with the text-based mount interface

On Apr 25, 2008, at 1:38 PM, Steinar H. Gunderson wrote:
> On Fri, Apr 25, 2008 at 01:11:02PM -0400, Chuck Lever wrote:
>> Just change "*timeout +=" to "*timeout =" in parse_retry_option().
>>
>> That was the bug I was trying to fix in the first place. Sigh.
>
> That fixes it -- thanks!

Thanks for testing. I'll post a corrected patch to Mr. Dickson in a
bit.

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com