Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to access snapshots #3295

Closed
durdanovic opened this issue Apr 14, 2015 · 3 comments
Closed

Unable to access snapshots #3295

durdanovic opened this issue Apr 14, 2015 · 3 comments
Milestone

Comments

@durdanovic
Copy link

Custom build linux kernel 3-18.0

dmesg:
[   10.639297] SPL: Loaded module v0.6.4-1
[   10.740637] ZFS: Loaded module v0.6.4-1, ZFS pool version 5000, ZFS filesystem version 5

pts/5#> ls -al /home/.zfs/snapshot/
total 0
dr-xr-xr-x 2 root root 2 Apr 14 05:00 .
dr-xr-xr-x 1 root root 0 Apr 13 13:47 ..
dr-xr-xr-x 1 root root 0 Apr 14 18:10 d.2015.04.14

pts/5#> ls -al /home/.zfs/snapshot/d.2015.04.14/
ls: cannot access /home/.zfs/snapshot/d.2015.04.14/.: Input/output error
ls: cannot access /home/.zfs/snapshot/d.2015.04.14/..: Input/output error
total 0
d????????? ? ? ? ?            ? .
d????????? ? ? ? ?            ? ..

in dmesg:
[102424.419644] ZFS: Unable to automount rpool/home@d.2015.04.14 at /home/.zfs/snapshot/d.2015.04.14: 512
[102424.441683] ZFS: Unable to automount rpool/home@d.2015.04.14 at /home/.zfs/snapshot/d.2015.04.14: 512
[102424.463590] ZFS: Unable to automount rpool/home@d.2015.04.14 at /home/.zfs/snapshot/d.2015.04.14: 512
[102424.475132] ZFS: Unable to automount rpool/home@d.2015.04.14 at /home/.zfs/snapshot/d.2015.04.14: 512

The same error was present in the 0.6.3 version too.
When 0.6.4 came out I destroyed the pool and created it fresh, yet still the same problem.

Anybody has any idea how to find out what is going on?

Some more info if it helps:

pts/5#> zpool status
  pool: rpool
 state: ONLINE
  scan: scrub repaired 0 in 65h28m with 0 errors on Mon Apr 13 14:36:19 2015
config:

        NAME                                                  STATE     READ WRITE CKSUM
        rpool                                                 ONLINE       0     0     0
          raidz2-0                                            ONLINE       0     0     0
            ata-ST4000NM0033-9ZM170_Z1Z078Q8-part6            ONLINE       0     0     0
            ata-ST4000NM0033-9ZM170_Z1Z08BCY-part6            ONLINE       0     0     0
            ata-ST4000NM0033-9ZM170_Z1Z0883D-part6            ONLINE       0     0     0
            ata-ST4000NM0033-9ZM170_Z1Z08B0Q-part6            ONLINE       0     0     0
            ata-ST4000NM0033-9ZM170_Z1Z077HT-part6            ONLINE       0     0     0
            ata-WDC_WD4000F9YZ-09N20L0_WD-WMC1F0248398-part6  ONLINE       0     0     0

errors: No known data errors
pts/5#> zfs list
NAME           USED  AVAIL  REFER  MOUNTPOINT
rpool         1.25T  12.5T   192K  none
rpool/backup   141M  12.5T   141M  /backup
rpool/data    1.24T  12.5T  1.24T  /data
rpool/home    5.99G  12.5T  5.47G  /home

Thanks, Igor

@Bronek
Copy link

Bronek commented Apr 15, 2015

This is the same as #3030

@behlendorf
Copy link
Contributor

I've proposed a patch in issue #3344 to address this.

@behlendorf behlendorf added this to the 0.6.5 milestone Aug 30, 2015
behlendorf added a commit to behlendorf/zfs that referenced this issue Aug 30, 2015
Re-factor the .zfs/snapshot auto-mouting code to take in to account
changes made to the upstream kernels.  And to lay the groundwork for
enabling access to .zfs snapshots via NFS clients.  This patch makes
the following core improvements.

* All actively auto-mounted snapshots are now tracked in two global
trees which are indexed by snapshot name and objset id respectively.
This allows for fast lookups of any auto-mounted snapshot regardless
without needing access to the parent dataset.

* Snapshot entries are added to the tree in zfsctl_snapshot_mount().
However, they are now removed from the tree in the context of the
unmount process.  This eliminates the need complicated error logic
in zfsctl_snapshot_unmount() to handle unmount failures.

* References are now taken on the snapshot entries in the tree to
ensure they always remain valid while a task is outstanding.

* The MNT_SHRINKABLE flag is set on the snapshot vfsmount_t right
after the auto-mount succeeds.  This allows to kernel to unmount
idle auto-mounted snapshots if needed removing the need for the
zfsctl_unmount_snapshots() function.

* Snapshots in active use will not be automatically unmounted.  As
long as at least one dentry is revalidated every zfs_expire_snapshot/2
seconds the auto-unmount expiration timer will be extended.

* Commit torvalds/linux@bafc9b7 caused snapshots auto-mounted by ZFS
to be immediately unmounted when the dentry was revalidated.  This
was a consequence of ZFS invaliding all snapdir dentries to ensure that
negative dentries didn't mask new snapshots.  This patch modifies the
behavior such that only negative dentries are invalidated.  This solves
the issue and may result in a performance improvement.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue openzfs#3589
Issue openzfs#3344
Issue openzfs#3295
Issue openzfs#3257
Issue openzfs#3243
Issue openzfs#3030
Issue openzfs#2841
@Bronek
Copy link

Bronek commented Aug 31, 2015

@durdanovic try #3718

behlendorf added a commit to behlendorf/zfs that referenced this issue Aug 31, 2015
Re-factor the .zfs/snapshot auto-mouting code to take in to account
changes made to the upstream kernels.  And to lay the groundwork for
enabling access to .zfs snapshots via NFS clients.  This patch makes
the following core improvements.

* All actively auto-mounted snapshots are now tracked in two global
trees which are indexed by snapshot name and objset id respectively.
This allows for fast lookups of any auto-mounted snapshot regardless
without needing access to the parent dataset.

* Snapshot entries are added to the tree in zfsctl_snapshot_mount().
However, they are now removed from the tree in the context of the
unmount process.  This eliminates the need complicated error logic
in zfsctl_snapshot_unmount() to handle unmount failures.

* References are now taken on the snapshot entries in the tree to
ensure they always remain valid while a task is outstanding.

* The MNT_SHRINKABLE flag is set on the snapshot vfsmount_t right
after the auto-mount succeeds.  This allows to kernel to unmount
idle auto-mounted snapshots if needed removing the need for the
zfsctl_unmount_snapshots() function.

* Snapshots in active use will not be automatically unmounted.  As
long as at least one dentry is revalidated every zfs_expire_snapshot/2
seconds the auto-unmount expiration timer will be extended.

* Commit torvalds/linux@bafc9b7 caused snapshots auto-mounted by ZFS
to be immediately unmounted when the dentry was revalidated.  This
was a consequence of ZFS invaliding all snapdir dentries to ensure that
negative dentries didn't mask new snapshots.  This patch modifies the
behavior such that only negative dentries are invalidated.  This solves
the issue and may result in a performance improvement.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#3589
Closes openzfs#3344
Closes openzfs#3295
Closes openzfs#3257
Closes openzfs#3243
Closes openzfs#3030
Closes openzfs#2841
behlendorf added a commit to behlendorf/zfs that referenced this issue Aug 31, 2015
Re-factor the .zfs/snapshot auto-mouting code to take in to account
changes made to the upstream kernels.  And to lay the groundwork for
enabling access to .zfs snapshots via NFS clients.  This patch makes
the following core improvements.

* All actively auto-mounted snapshots are now tracked in two global
trees which are indexed by snapshot name and objset id respectively.
This allows for fast lookups of any auto-mounted snapshot regardless
without needing access to the parent dataset.

* Snapshot entries are added to the tree in zfsctl_snapshot_mount().
However, they are now removed from the tree in the context of the
unmount process.  This eliminates the need complicated error logic
in zfsctl_snapshot_unmount() to handle unmount failures.

* References are now taken on the snapshot entries in the tree to
ensure they always remain valid while a task is outstanding.

* The MNT_SHRINKABLE flag is set on the snapshot vfsmount_t right
after the auto-mount succeeds.  This allows to kernel to unmount
idle auto-mounted snapshots if needed removing the need for the
zfsctl_unmount_snapshots() function.

* Snapshots in active use will not be automatically unmounted.  As
long as at least one dentry is revalidated every zfs_expire_snapshot/2
seconds the auto-unmount expiration timer will be extended.

* Commit torvalds/linux@bafc9b7 caused snapshots auto-mounted by ZFS
to be immediately unmounted when the dentry was revalidated.  This
was a consequence of ZFS invaliding all snapdir dentries to ensure that
negative dentries didn't mask new snapshots.  This patch modifies the
behavior such that only negative dentries are invalidated.  This solves
the issue and may result in a performance improvement.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#3589
Closes openzfs#3344
Closes openzfs#3295
Closes openzfs#3257
Closes openzfs#3243
Closes openzfs#3030
Closes openzfs#2841
tomgarcia pushed a commit to tomgarcia/zfs that referenced this issue Sep 11, 2015
Re-factor the .zfs/snapshot auto-mouting code to take in to account
changes made to the upstream kernels.  And to lay the groundwork for
enabling access to .zfs snapshots via NFS clients.  This patch makes
the following core improvements.

* All actively auto-mounted snapshots are now tracked in two global
trees which are indexed by snapshot name and objset id respectively.
This allows for fast lookups of any auto-mounted snapshot regardless
without needing access to the parent dataset.

* Snapshot entries are added to the tree in zfsctl_snapshot_mount().
However, they are now removed from the tree in the context of the
unmount process.  This eliminates the need complicated error logic
in zfsctl_snapshot_unmount() to handle unmount failures.

* References are now taken on the snapshot entries in the tree to
ensure they always remain valid while a task is outstanding.

* The MNT_SHRINKABLE flag is set on the snapshot vfsmount_t right
after the auto-mount succeeds.  This allows to kernel to unmount
idle auto-mounted snapshots if needed removing the need for the
zfsctl_unmount_snapshots() function.

* Snapshots in active use will not be automatically unmounted.  As
long as at least one dentry is revalidated every zfs_expire_snapshot/2
seconds the auto-unmount expiration timer will be extended.

* Commit torvalds/linux@bafc9b7 caused snapshots auto-mounted by ZFS
to be immediately unmounted when the dentry was revalidated.  This
was a consequence of ZFS invaliding all snapdir dentries to ensure that
negative dentries didn't mask new snapshots.  This patch modifies the
behavior such that only negative dentries are invalidated.  This solves
the issue and may result in a performance improvement.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#3589
Closes openzfs#3344
Closes openzfs#3295
Closes openzfs#3257
Closes openzfs#3243
Closes openzfs#3030
Closes openzfs#2841
JKDingwall pushed a commit to JKDingwall/zfs that referenced this issue Aug 11, 2016
Re-factor the .zfs/snapshot auto-mouting code to take in to account
changes made to the upstream kernels.  And to lay the groundwork for
enabling access to .zfs snapshots via NFS clients.  This patch makes
the following core improvements.

* All actively auto-mounted snapshots are now tracked in two global
trees which are indexed by snapshot name and objset id respectively.
This allows for fast lookups of any auto-mounted snapshot regardless
without needing access to the parent dataset.

* Snapshot entries are added to the tree in zfsctl_snapshot_mount().
However, they are now removed from the tree in the context of the
unmount process.  This eliminates the need complicated error logic
in zfsctl_snapshot_unmount() to handle unmount failures.

* References are now taken on the snapshot entries in the tree to
ensure they always remain valid while a task is outstanding.

* The MNT_SHRINKABLE flag is set on the snapshot vfsmount_t right
after the auto-mount succeeds.  This allows to kernel to unmount
idle auto-mounted snapshots if needed removing the need for the
zfsctl_unmount_snapshots() function.

* Snapshots in active use will not be automatically unmounted.  As
long as at least one dentry is revalidated every zfs_expire_snapshot/2
seconds the auto-unmount expiration timer will be extended.

* Commit torvalds/linux@bafc9b7 caused snapshots auto-mounted by ZFS
to be immediately unmounted when the dentry was revalidated.  This
was a consequence of ZFS invaliding all snapdir dentries to ensure that
negative dentries didn't mask new snapshots.  This patch modifies the
behavior such that only negative dentries are invalidated.  This solves
the issue and may result in a performance improvement.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#3589
Closes openzfs#3344
Closes openzfs#3295
Closes openzfs#3257
Closes openzfs#3243
Closes openzfs#3030
Closes openzfs#2841

Conflicts:
	config/kernel.m4
	module/zfs/zfs_ctldir.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants