-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
ZFS invalid mode 0x7 and SPL PANIC in zfs_inode_set_ops() #2228
Comments
@owahlberg Please apply this patch:
and then run As much as I hate to say it, I've got a filesystem laying around with a handful of these problems but haven't yet had enough time to analyze it. I'm concerned there may be a concurrent access issue with the mode that causes some of the bits to be cleared. In one of my own examples, I've got a file/dir with a mode of 070 which is also rather legitimate looking for the lower bits. |
@dweeezil thanks for the suggestion.
Due to the patch the above does not cause an SPL PANIC and does yield the inode number of the offender in the kernel log:
Inode 4 seems to be the root directory of this dataset:
I can confirm that those are the top level directories in this dataset so at least some of the references remain correct... |
Correct, object 4 will always be the root directory in the current ZFS implementation. The SA is totally screwed up, it's not just the mode that's bad. It would appear that every single field is bogus: the links should be 6 rather than 8, the pflags are bogus, the parent should be 4, the size should likely not be 5185 and I suspect the timestamps are all bogus. Defaulting it to be a directory is not likely to help matters too much. The question is how did this happen? There are a couple of other issues open right now that have got messed up SAs but without a reliable way to reproduce the problem, it's going to be very difficult to fix. Do you know how much stuff was supposed to be in the root directory? Are the 5 items listed in the microzap the whole contents or were there supposed to be a lot more things there? I just realized you mentioned ACLs. Are there POSIX ACLs on them? Is there supposed to be one on the root directory? Do you have xattr=sa set? This could be another manifestation of #2214. |
I noticed that the timestamps where all messed up, but did not have enough knowledge to comment on anything else. In all honesty, if there's nothing obvious that stands out from this data it will be next to impossible to trace the problem from my pool. My pool has a long and sordid history. At this point I will keep the dataset around if anybody feels like digging in to it, but I will likely write it off as lost. |
I am in the process of trying to get Illumos to work in a KVM guest. If I get that to work I'll pass through the drives. |
@owahlberg Can you run |
I have been unable to get Illumos running well in a VM, but have a 50Mb worth of zdb -dddd output from FreeBSD... Any preference on how to provide access if you have time to take a look? |
In the case where a variable-sized SA overlaps the spill block pointer and a new variable-sized SA is being added, the header size was improperly calculated to include the to-be-moved SA. This problem could be reproduced when xattr=sa enabled as follows: ln -s $(perl -e 'print "x" x 120') blah setfattr -n security.selinux -v blahblah -h blah The symlink is large enough to interfere with the spill block pointer and has a typical SA registration as follows (shown in modified "zdb -dddd" <SA attr layout obj> format): [ ... ZPL_DACL_COUNT ZPL_DACL_ACES ZPL_SYMLINK ] Adding the SA xattr will attempt to extend the registration to: [ ... ZPL_DACL_COUNT ZPL_DACL_ACES ZPL_SYMLINK ZPL_DXATTR ] but since the ZPL_SYMLINK SA interferes with the spill block pointer, it must also be moved to the spill block which will have a registration of: [ ZPL_SYMLINK ZPL_DXATTR ] This commit updates extra_hdrsize when this condition occurs, allowing hdrsize to be subsequently decreased appropriately. Signed-off-by: Tim Chase <tim@chase2k.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ned Bass <bass6@llnl.gov> Issue #2214 Issue #2228 Issue #2316 Issue #2343
A potential fix for this has been merged. Please let us know if you're able to recreate this issue using a pool created from the latest master source which includes commit 83021b4. |
In the case where a variable-sized SA overlaps the spill block pointer and a new variable-sized SA is being added, the header size was improperly calculated to include the to-be-moved SA. This problem could be reproduced when xattr=sa enabled as follows: ln -s $(perl -e 'print "x" x 120') blah setfattr -n security.selinux -v blahblah -h blah The symlink is large enough to interfere with the spill block pointer and has a typical SA registration as follows (shown in modified "zdb -dddd" <SA attr layout obj> format): [ ... ZPL_DACL_COUNT ZPL_DACL_ACES ZPL_SYMLINK ] Adding the SA xattr will attempt to extend the registration to: [ ... ZPL_DACL_COUNT ZPL_DACL_ACES ZPL_SYMLINK ZPL_DXATTR ] but since the ZPL_SYMLINK SA interferes with the spill block pointer, it must also be moved to the spill block which will have a registration of: [ ZPL_SYMLINK ZPL_DXATTR ] This commit updates extra_hdrsize when this condition occurs, allowing hdrsize to be subsequently decreased appropriately. Signed-off-by: Tim Chase <tim@chase2k.com> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ned Bass <bass6@llnl.gov> Issue openzfs#2214 Issue openzfs#2228 Issue openzfs#2316 Issue openzfs#2343
Upgraded to 0.6.3 and retried importing the original fs.
Unfortunately I don't have an easy way to reproduce the problem on a newly created pool. console log also displays the following
|
@owahlberg If you're seeing "Inode 4 has Invalid mode", your kernel module is not stock 0.6.3 but must have some sort of a patch on it. That said, keep in mind that if you've got any corrupted dnodes, a 0.6.3 upgrade will not fix them. The only recourse (without extreme measures) to deal with corrupted dnodes is to re-create the filesystem on which the corruption exists. |
Good catch, I should have triggered on that myself since it's from the patch I was using on 0.6.2. With 0.6.3 it prints a SPLError/SPL_PANIC and a call trace when trying to import the pool with corrupt data. At this point I'm going to toss my old damaged data and hope the original bug got fixed in 83021b4. |
Closing the root cause here was addressed. |
I have 2 out of 10+ file systems in an otherwise healthy pool that cause an SPL PANIC on mount.
I can mount all other file systems by hand and 8TB mirrored pool scrubs fine.
The server is running with Ubuntu Precise and ZoL from zfs-native/stable PPA.
All packages are up-to-date.
Trying to mount either of the two file systems cause the same oops:
[ 2683.054010] ZFS: Invalid mode: 0x7
[ 2683.054018] VERIFY(0) failed
[ 2683.054089] SPLError: 21787:0:(zfs_znode.c:340:zfs_inode_set_ops()) SPL PANIC
[ 2683.054203] SPL: Showing stack for process 21787
[ 2683.054212] Pid: 21787, comm: mount.zfs Tainted: P O 3.2.0-23-generic #36-Ubuntu
[ 2683.054218] Call Trace:
[ 2683.054259] [] spl_debug_dumpstack+0x27/0x40 [spl]
[ 2683.054281] [] spl_debug_bug+0x82/0xe0 [spl]
[ 2683.054385] [] zfs_znode_alloc+0x336/0x540 [zfs]
[ 2683.054465] [] zfs_zget+0x168/0x200 [zfs]
[ 2683.054543] [] zfs_root+0x83/0xc0 [zfs]
[ 2683.054620] [] zfs_domount+0x1f2/0x270 [zfs]
[ 2683.054632] [] ? sget+0x1c5/0x240
[ 2683.054640] [] ? get_anon_bdev+0x110/0x110
[ 2683.054714] [] ? zpl_mount+0x30/0x30 [zfs]
[ 2683.054789] [] zpl_fill_super+0xe/0x20 [zfs]
[ 2683.054798] [] mount_nodev+0x5d/0xc0
[ 2683.054874] [] zpl_mount+0x25/0x30 [zfs]
[ 2683.054883] [] mount_fs+0x43/0x1b0
[ 2683.054895] [] vfs_kern_mount+0x6a/0xc0
[ 2683.054905] [] do_kern_mount+0x54/0x110
[ 2683.054914] [] do_mount+0x1a4/0x260
[ 2683.054923] [] sys_mount+0x90/0xe0
[ 2683.054932] [] system_call_fastpath+0x16/0x1b
[ 2881.612107] INFO: task mount.zfs:21787 blocked for more than 120 seconds.
[ 2881.612238] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 2881.612362] mount.zfs D ffffffff81806240 0 21787 21786 0x00000000
[ 2881.612377] ffff88031562d9e8 0000000000000086 000000000000000a ffff88031563c000
[ 2881.612389] ffff88031562dfd8 ffff88031562dfd8 ffff88031562dfd8 0000000000013780
[ 2881.612400] ffff8805e85696f0 ffff88032c4fade0 ffffffff81c0f6c7 0000000000000000
[ 2881.612410] Call Trace:
[ 2881.612425] [] schedule+0x3f/0x60
[ 2881.612466] [] spl_debug_bug+0xb5/0xe0 [spl]
[ 2881.612564] [] zfs_znode_alloc+0x336/0x540 [zfs]
[ 2881.612644] [] zfs_zget+0x168/0x200 [zfs]
[ 2881.612722] [] zfs_root+0x83/0xc0 [zfs]
[ 2881.612799] [] zfs_domount+0x1f2/0x270 [zfs]
[ 2881.612810] [] ? sget+0x1c5/0x240
[ 2881.612817] [] ? get_anon_bdev+0x110/0x110
[ 2881.612892] [] ? zpl_mount+0x30/0x30 [zfs]
[ 2881.612967] [] zpl_fill_super+0xe/0x20 [zfs]
[ 2881.612976] [] mount_nodev+0x5d/0xc0
[ 2881.613053] [] zpl_mount+0x25/0x30 [zfs]
[ 2881.613062] [] mount_fs+0x43/0x1b0
[ 2881.613074] [] vfs_kern_mount+0x6a/0xc0
[ 2881.613084] [] do_kern_mount+0x54/0x110
[ 2881.613093] [] do_mount+0x1a4/0x260
[ 2881.613101] [] sys_mount+0x90/0xe0
[ 2881.613110] [] system_call_fastpath+0x16/0x1b
This is the second time I have run into this issue in the last 3 months.
Last time I recovered by rolling back to a previous snapshot.
This time I am unable to do so on one of the two affected file systems as it no longer has any snapshots.
These file systems have had ACL's on them, but I think what has triggered this at two separate times has been extensive use of snapshots through zfs-auto-snapshot.
I have tried defaulting the offending inode to a directory type and a file type as in #709, but neither gets me any further.
I am going to have to rollback the big dataset (~3TB) to a working snapshot tonight, but I have saved a copy of the smaller dataset of 70Gb that I cannot manage to get access to and I would really appreciate if someone has an idea suggestions/tips on how I could recover that data as well.
The text was updated successfully, but these errors were encountered: