Skip to contentSkip to conversation

Bug#443591: nfs-kernel-server: Unexporting directories no longer working

DISCUSSION Steinar H. Gunderson 3 participants 6 messages Sep 23, 2007 – Oct 24, 2007 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 11 lines · David Liontooth

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.

/* Steinar */

Signature · 9 lines
Homepage: http://www.sesse.net/

-------------------------------------------------------------------------
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
#2 lore raw
Quoted 8 lines · On Sunday September 23, [email protected] wrote:
Quoted 7 lines · David Liontooth

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.

Quoted 7 lines
Quoted 4 lines

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

#3 lore raw

Hi Neil,

Thanks for looking.

Quoted 20 lines · Neil Brown
Quoted 9 lines · On Sunday September 23, [email protected] wrote:
Quoted 7 lines · David Liontooth

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.

Quoted 8 lines
Quoted 5 lines

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.

Quoted 9 lines

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.

Quoted 8 lines

The obvious answer would be

    /tv01  (some,flags,here)

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

Maybe you have:

Quoted 8 lines

/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!)

Quoted 6 lines

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

#4 lore raw

Re: Bug#443591: Bug#443591: nfs-kernel-server: Unexporting directories no longer working

Quoted 3 lines · David Liontooth

Hi Neil,

Thanks for looking.

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

/* Steinar */

Signature · 10 lines
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
#5 lore raw
Quoted 4 lines · Steinar H. Gunderson
Quoted 2 lines · David Liontooth

Hi Neil,

Quoted 8 lines
Quoted 2 lines

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

#6 lore raw
In reply to David Liontooth
Quoted 36 lines · On Monday September 24, [email protected] wrote:

Hi Neil,

Thanks for looking.

Quoted 20 lines · Neil Brown
Quoted 9 lines · On Sunday September 23, [email protected] wrote:
Quoted 7 lines · David Liontooth

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.

Quoted 8 lines
Quoted 5 lines

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.

Quoted 9 lines

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?

Quoted 8 lines
/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

Quoted 12 lines

Several other drives have similar entries.

Quoted 10 lines

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)

Quoted 8 lines
Quoted 6 lines

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.

Quoted 4 lines

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.

Quoted 9 lines
Quoted 7 lines

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.

Quoted 2 lines

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