2007-09-24 06:58:51

by NeilBrown

[permalink] [raw]
Subject: Re: Bug#443591: nfs-kernel-server: Unexporting directories no longer working

On Sunday September 23, [email protected] wrote:
> On Sat, Sep 22, 2007 at 10:42:31AM -0700, David Liontooth wrote:
> > Package: nfs-kernel-server
> > Version: 1:1.1.0-13
> > Severity: normal
> >
> >
> > The command to unexport a directory appears to no longer have any effect.
> >
> > I issue "exportfs -u :/tv01" and "exportfs" shows /tv01 still exported; consequently, I cannot unmount it.
> > In contrast, removing /tv01 from /etc/exports and then running exportfs -ra successfully removes the export.
> >
> > This used to work fine.
>
> Sending this on to upstream, as I cannot see any good reason offhand why it
> should not work.

Some simple testing and code review suggests that this works as
expected. However it is possible that I am expecting something
different to you, or testing something different.

You say you:
exportfs -u :/tv01

What exactly is in your /etc/exports that this is expected to revert?
The obvious answer would be

/tv01 (some,flags,here)

however "exportfs" will complain about that, so I suspect not.

Maybe you have:

/tv01 somehost(someflags) otherhost(otherflags)

and you expect
exportfs -u :/tv01

to unexport /tv01 to all hosts? I would agree that doesn't work. Did
it ever? What version?

As an aside, you can always:
exportfs -f
and then unmount filesystems. They will be free to be unmounted until
the next NFS access request arrives. Maybe that will server your
needs?

NeilBrown

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs


2007-09-24 23:29:14

by David Liontooth

[permalink] [raw]
Subject: Re: Bug#443591: nfs-kernel-server: Unexporting directories no longer working


Hi Neil,

Thanks for looking.

Neil Brown wrote:
> On Sunday September 23, [email protected] wrote:
>
>> On Sat, Sep 22, 2007 at 10:42:31AM -0700, David Liontooth wrote:
>>
>>> Package: nfs-kernel-server
>>> Version: 1:1.1.0-13
>>> Severity: normal
>>>
>>>
>>> The command to unexport a directory appears to no longer have any effect.
>>>
>>> I issue "exportfs -u :/tv01" and "exportfs" shows /tv01 still exported; consequently, I cannot unmount it.
>>> In contrast, removing /tv01 from /etc/exports and then running exportfs -ra successfully removes the export.
>>>
>>> This used to work fine.
>>>
>> Sending this on to upstream, as I cannot see any good reason offhand why it
>> should not work.
>>
>
> Some simple testing and code review suggests that this works as
> expected. However it is possible that I am expecting something
> different to you, or testing something different.
>
> You say you:
> exportfs -u :/tv01
>
> What exactly is in your /etc/exports that this is expected to revert?
>

/tv01 \
134.32.443.30(ro,no_subtree_check,async) \
134.32.443.32(ro,no_subtree_check,async) \
134.32.443.33(ro,no_subtree_check,async) \
134.32.443.34(ro,no_subtree_check,async) \
134.32.443.35(ro,no_subtree_check,async) \
134.32.443.36(ro,no_subtree_check,async) \
134.32.443.37(ro,no_subtree_check,async)

Several other drives have similar entries.
> The obvious answer would be
>
> /tv01 (some,flags,here)
>
> however "exportfs" will complain about that, so I suspect not.
>
> Maybe you have:
>
> /tv01 somehost(someflags) otherhost(otherflags)
>
> and you expect
> exportfs -u :/tv01
>
> to unexport /tv01 to all hosts? I would agree that doesn't work. Did
> it ever? What version?
>

I see. So that would unexport only the first one?

Can I unexport only /tv01 to all hosts?
(If it's just a matter of my being uninformed, let's close the bug --
but I'd appreciate an answer!)

> As an aside, you can always:
> exportfs -f
> and then unmount filesystems. They will be free to be unmounted until
> the next NFS access request arrives. Maybe that will serve your
> needs?
>
I see -- that may be helpful -- but what if someone is accessing one of
the drives right then?
I would prefer to have individual control; I export a dozen other drives
to several different machines, and they should not be unexported.

Dave





-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2007-10-24 00:09:47

by David Liontooth

[permalink] [raw]
Subject: Bug#443591: nfs-kernel-server: Unexporting directories no longer working

Steinar H. Gunderson wrote:
> On Mon, Sep 24, 2007 at 04:29:02PM -0700, David Liontooth wrote:
>
>> Hi Neil,
>>
>> Thanks for looking.
>>
>
> I didn't see an answer to this mail; was the problem forgotten, or was it
> resolved?
>
> /* Steinar */
>
I didn't hear back from Neil, but the issue should be considered
resolved. I mistakenly believed it was possible to unexport a particular
resource to several hosts, without unexporting other resources.

For instance, I have

/tv01 \
134.32.443.30(ro,no_subtree_check,async) \
134.32.443.32(ro,no_subtree_check,async) \
134.32.443.33(ro,no_subtree_check,async) \
134.32.443.34(ro,no_subtree_check,async) \
134.32.443.35(ro,no_subtree_check,async) \
134.32.443.36(ro,no_subtree_check,async) \
134.32.443.37(ro,no_subtree_check,async)

Several other drives have similar entries.

If I understand Neil correctly, it's not possible to unexport /tv01 to
all of these hosts by issuing

exportfs -u :/tv01

man exportfs says, "To remove individual export entries, one can
specify a host:/path pair. This deletes the specified entry from xtab
and removes the corresponding kernel entry (if any)." The man page may
be assuming the resource has only been exported to one host, but it
doesn't state that limitation. Apparently there's no command for
unexporting a resource to all or a subset of hosts; the command works
only if there's a single host.

We could leave the report in place but downgrade it to wishlist. If I've
described the situation correctly, the man page could do with a
revision, for instance using this language:

To remove an export to a host, specify a host:/path pair. This deletes
the specified entry from xtab and removes the corresponding kernel entry
(if any). To remove one or more exports to several hosts, use exportfs -ua.

David

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2007-10-12 20:00:09

by Steinar H. Gunderson

[permalink] [raw]
Subject: Re: Bug#443591: Bug#443591: nfs-kernel-server: Unexporting directories no longer working

On Mon, Sep 24, 2007 at 04:29:02PM -0700, David Liontooth wrote:
> Hi Neil,
>
> Thanks for looking.

I didn't see an answer to this mail; was the problem forgotten, or was it
resolved?

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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs

2007-10-15 00:02:08

by NeilBrown

[permalink] [raw]
Subject: Re: Bug#443591: nfs-kernel-server: Unexporting directories no longer working

On Monday September 24, [email protected] wrote:
>
> Hi Neil,
>
> Thanks for looking.
>
> Neil Brown wrote:
> > On Sunday September 23, [email protected] wrote:
> >
> >> On Sat, Sep 22, 2007 at 10:42:31AM -0700, David Liontooth wrote:
> >>
> >>> Package: nfs-kernel-server
> >>> Version: 1:1.1.0-13
> >>> Severity: normal
> >>>
> >>>
> >>> The command to unexport a directory appears to no longer have any effect.
> >>>
> >>> I issue "exportfs -u :/tv01" and "exportfs" shows /tv01 still exported; consequently, I cannot unmount it.
> >>> In contrast, removing /tv01 from /etc/exports and then running exportfs -ra successfully removes the export.
> >>>
> >>> This used to work fine.
> >>>
> >> Sending this on to upstream, as I cannot see any good reason offhand why it
> >> should not work.
> >>
> >
> > Some simple testing and code review suggests that this works as
> > expected. However it is possible that I am expecting something
> > different to you, or testing something different.
> >
> > You say you:
> > exportfs -u :/tv01
> >
> > What exactly is in your /etc/exports that this is expected to revert?
> >
>
> /tv01 \
> 134.32.443.30(ro,no_subtree_check,async) \
> 134.32.443.32(ro,no_subtree_check,async) \
> 134.32.443.33(ro,no_subtree_check,async) \
> 134.32.443.34(ro,no_subtree_check,async) \
> 134.32.443.35(ro,no_subtree_check,async) \
> 134.32.443.36(ro,no_subtree_check,async) \
> 134.32.443.37(ro,no_subtree_check,async)

To unexport /tv01, you would need to individually unexport each of
those export. Or edit /etc/exports to remove those lines and
exportfs -r

>
> Several other drives have similar entries.
> > The obvious answer would be
> >
> > /tv01 (some,flags,here)
> >
> > however "exportfs" will complain about that, so I suspect not.
> >
> > Maybe you have:
> >
> > /tv01 somehost(someflags) otherhost(otherflags)
> >
> > and you expect
> > exportfs -u :/tv01
> >
> > to unexport /tv01 to all hosts? I would agree that doesn't work. Did
> > it ever? What version?
> >
>
> I see. So that would unexport only the first one?

No, it would not export anything as that is asking to stop exporting
it to the wildcard host (matches anything) and it is not currently
exported to the wildcard host.

>
> Can I unexport only /tv01 to all hosts?
> (If it's just a matter of my being uninformed, let's close the bug --
> but I'd appreciate an answer!)

No. You cannot currently export a filesystem. You can only unexport
an 'export' which is a host:filesystem combination.

>
> > As an aside, you can always:
> > exportfs -f
> > and then unmount filesystems. They will be free to be unmounted until
> > the next NFS access request arrives. Maybe that will serve your
> > needs?
> >
> I see -- that may be helpful -- but what if someone is accessing one of
> the drives right then?

If you
exportfs -f ; umount /tv01
there is a chance that a request will arrive between the two, so the
umount will fail.
You could instead
umount -l /tv01 ; exportfs -f

which will avoid the race and be just as effective.


> I would prefer to have individual control; I export a dozen other drives
> to several different machines, and they should not be unexported.

"exportfs -f" will not exactly unexport them. It just removes cached
information from the kernel so that it has to ask mountd again.
So the most you will notice is a slight pause, and you probably won't
notice that unless the system is very busy and there are lots of
mounts - or hostname/netgroup lookup is very slow.

NeilBrown

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
NFS maillist - [email protected]
https://lists.sourceforge.net/lists/listinfo/nfs