Bug 204093 - [zfs] Overflowing the max path for ZFS snapshot automount leaves the zfs in an busy state
Summary: [zfs] Overflowing the max path for ZFS snapshot automount leaves the zfs in a...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.2-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-fs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-28 15:26 UTC by Matthew Seaman
Modified: 2015-10-28 15:44 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthew Seaman freebsd_committer freebsd_triage 2015-10-28 15:26:01 UTC
To reproduce, set up a zfs with snapshots like so:

{{{
# zfs list -t all -r tank/.......1
NAME                    USED  AVAIL  REFER  MOUNTPOINT
tank/.......1
                     19K   769G    19K  /.......1
tank/.......1@....3.........4.........5.........6.........7.........8........
                     0      -    19K  -
tank/.......1@....3.........4.........5.........6.........7.........8.........
                     0      -    19K  -
tank/.......1@....3.........4.........5.........6.........7.........8.........9.........0
                     0      -    19K  -
}}}

These names are carefully calculated to hit or exceed the 88 character limit on mountpoint path lengths when
the snapshots are automounted

Now, doing something that would cause the snapshots to automount leads to the expected 'name too long' errors:

{{{
# find /.......1/.zfs/snapshot
/.......1/.zfs/snapshot
find:
/.......1/.zfs/snapshot/....3.........4.........5.........6.........7.........8.........:
File name too long
/.......1/.zfs/snapshot/....3.........4.........5.........6.........7.........8........
/.......1/.zfs/snapshot/....3.........4.........5.........6.........7.........8......../aaa
/.......1/.zfs/snapshot/....3.........4.........5.........6.........7.........8......../aaa/bbb
/.......1/.zfs/snapshot/....3.........4.........5.........6.........7.........8......../aaa/bbb/ccc
find:
/.......1/.zfs/snapshot/....3.........4.........5.........6.........7.........8.........9.........0:
File name too long
}}}

This is all as expected.  Problem is that now the tank/.......1 zfs is left in a busy state:

{{{
# zfs destroy -r tank/.......1
cannot unmount '/.......1': Device busy
}}}

Needs a forced unmount to do anything with it:
{{{
# zfs umount -f /.......1
}}}

I'd expect that other than an error message there wouldn't be any side effects of failing to automount
a snapshot due to overflowing the maximum allowed path length.