By mistake, I just exported my test filesystem while it was up and being served via NFS, causing my tar over NFS to start throwing stale file handle errors. Should I file this as a bug, or should I just "not do that" :-> Ko, This message posted from opensolaris.org
Jim Hranicky wrote:> By mistake, I just exported my test filesystem while it was up > and being served via NFS, causing my tar over NFS to start > throwing stale file handle errors.So you had a pool and were sharing filesystems over NFS, NFS clients had active mounts, you removed /etc/zfs/zpool.cache, rebooted the machine, created a new pool with the same name (and same filesystem names)? If so, that''s not a bug, the NFS clients have no knowledge that you''ve re-created the pool. Even though your namespace is the same, the filehandles will be different since your filesystems are different (and have different FSIDs). eric> > Should I file this as a bug, or should I just "not do that" :-> > > Ko, > > > This message posted from opensolaris.org > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss
Jim Hranicky wrote:> By mistake, I just exported my test filesystem while it was up > and being served via NFS, causing my tar over NFS to start > throwing stale file handle errors. > > Should I file this as a bug, or should I just "not do that" :->Don''t do that. The same should happen if you umount a shared UFS file system (or any other file system types). -- richard
On 12/12/2006, at 8:48 AM, Richard Elling wrote:> Jim Hranicky wrote: >> By mistake, I just exported my test filesystem while it was up >> and being served via NFS, causing my tar over NFS to start >> throwing stale file handle errors. Should I file this as a bug, or >> should I just "not do that" :-> > > Don''t do that. The same should happen if you umount a shared UFS > file system (or any other file system types). > -- richardExcept that it doesn''t: # mount /dev/dsk/c1t1d0s0 /mnt # share /mnt # umount /mnt umount: /mnt busy # unshare /mnt # umount /mnt #
Boyd Adamson wrote:> > On 12/12/2006, at 8:48 AM, Richard Elling wrote: > >> Jim Hranicky wrote: >>> By mistake, I just exported my test filesystem while it was up >>> and being served via NFS, causing my tar over NFS to start >>> throwing stale file handle errors. Should I file this as a bug, or >>> should I just "not do that" :-> >> >> Don''t do that. The same should happen if you umount a shared UFS >> file system (or any other file system types). >> -- richard > > Except that it doesn''t: > > # mount /dev/dsk/c1t1d0s0 /mnt > # share /mnt > # umount /mnt > umount: /mnt busy > # unshare /mnt > # umount /mntIf you umount -f it will though! I don''t quite agree that unmounting a UFS filesystem that is exported over NFS is the same as running zpool export on the pool. The equivalent to running umount on the UFS file system is running zfs umount on the ZFS file system in the pool. Running zpool export on the pool is closer to removing (cleanly) the disks or metadevices that the ufs file system is stored on. The system is working as designed, the NFS client did what it was supposed to do. If you brought the pool back in again with zpool import things should have picked up where they left off. Whats more you we probably running as root when you did that so you got what you asked for - there is only so much protection we can give without being annoying! If you look at the RBAC profiles we currently ship for ZFS you will see that there are two distinct profiles, one for ZFS File System Management and one for ZFS Storage Management. The reason they are separate is because they work at quite different layers in the system with different protections. Now having said that I personally wouldn''t have expected that zpool export should have worked as easily as that while there where shared filesystems. I would have expected that exporting the pool should have attempted to unmount all the ZFS filesystems first - which would have failed without a -f flag because they were shared. So IMO it is a bug or at least an RFE. -- Darren J Moffat
For the record, this happened with a new filesystem. I didn''t muck about with an old filesystem while it was still mounted, I created a new one, mounted it and then accidentally exported it.> > Except that it doesn''t: > > > > # mount /dev/dsk/c1t1d0s0 /mnt > > # share /mnt > > # umount /mnt > > umount: /mnt busy > > # unshare /mnt > > # umount /mnt > > If you umount -f it will though!Well, sure, but I was still surprised that it happened anyway.> The system is working as designed, the NFS client did > what it was supposed to do. If you brought the pool back in > again with zpool import things should have picked up where they left off.Yep -- an import/shareall made the FS available again.> Whats more you we probably running as root when you > did that so you got what you asked for - there is only so much protection > we can give without being annoying!Sure, but there are still safeguards in place even when running things as root, such as requiring "umount -f" as above, or warning you when running format on a disk with mounted partitions. Since this appeared to be an operation that may warrant such a safeguard I thought I''d check and see if this was to be expected or if a safeguard should be put in. Annoying isn''t always bad :->> Now having said that I personally wouldn''t have > expected that zpool export should have worked as easily as that while > there where shared filesystems. I would have expected that exporting > the pool should have attempted to unmount all the ZFS filesystems first - > which would have failed without a -f flag because they were shared. > > So IMO it is a bug or at least an RFE.Ok, where should I file an RFE? Jim This message posted from opensolaris.org
Jim Hranicky wrote:>> Now having said that I personally wouldn''t have >> expected that zpool export should have worked as easily as that while >> there where shared filesystems. I would have expected that exporting >> the pool should have attempted to unmount all the ZFS filesystems first - >> which would have failed without a -f flag because they were shared. >> >> So IMO it is a bug or at least an RFE. > > Ok, where should I file an RFE?http://bugs.opensolaris.org/ -- Darren J Moffat