Bug 74721 - Exporting jfs over nfs creates kernel BUG and corrupted files
Summary: Exporting jfs over nfs creates kernel BUG and corrupted files
Status: RESOLVED PATCH_ALREADY_AVAILABLE
Alias: None
Product: File System
Classification: Unclassified
Component: NFS (show other bugs)
Hardware: All Linux
: P1 high
Assignee: bfields
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-24 09:42 UTC by Marco Munderloh
Modified: 2016-03-20 11:40 UTC (History)
4 users (show)

See Also:
Kernel Version: 3.14.1
Subsystem:
Regression: No
Bisected commit-id:


Attachments
kernel BUG report (5.86 KB, text/plain)
2014-04-24 09:42 UTC, Marco Munderloh
Details
tmpfs: Fix simple_set_acl() (1.19 KB, patch)
2014-04-25 13:37 UTC, Chuck Lever
Details | Diff
kernel NULL pointer dereference with patch applied (5.88 KB, text/plain)
2014-04-28 12:38 UTC, Marco Munderloh
Details
Possible patch for bug (450 bytes, patch)
2014-04-28 15:32 UTC, Marco Munderloh
Details | Diff

Description Marco Munderloh 2014-04-24 09:42:15 UTC
Created attachment 133551 [details]
kernel BUG report

This bug is JFS and NFS related.

If a jfs filesystem is exported by the kernel 3.14 nfsd, mounting the filesystem on a different computer yields to a kernel bug crashing the nfsd. The nfsd totally hangs afterwards and prevents a clean unmount. Either of the former yields to corrupted files on the jfs.

It seems to me that all files written after the crash are corrupted but I'm not sure about that. In my case, .viminfo and the saved gnome-session got mostly corrupted. Maybe more - don't know yet.

The Bug is always reproducible under 3.14 and 3.14.1.
Comment 1 Chuck Lever 2014-04-25 13:37:39 UTC
Created attachment 133731 [details]
tmpfs: Fix simple_set_acl()
Comment 2 Chuck Lever 2014-04-25 13:37:49 UTC
Any file system that uses simple_set_acl() is likely to suffer from this issue.
Comment 3 Marco Munderloh 2014-04-27 14:16:05 UTC
I can confirm that the proposed patch fixes the problem for me.
Comment 4 Marco Munderloh 2014-04-28 12:35:51 UTC
I have to revert my previous comment. Bug is still there, behavior is unchanged.
See attached kernel BUG report with the above mentioned patch applied.
Comment 5 Marco Munderloh 2014-04-28 12:38:06 UTC
Created attachment 134041 [details]
kernel NULL pointer dereference with patch applied

kernel still reports a NULL pointer dereference when accessing jfs over nfs3.
Comment 6 Chuck Lever 2014-04-28 14:33:44 UTC
__jfs_set_acl() has the same bug as simple_set_acl(), possibly introduced by commit 2cc6a5a0.
Comment 7 Marco Munderloh 2014-04-28 15:32:53 UTC
Created attachment 134051 [details]
Possible patch for bug

I'm not very familiar with linux kernel fs.
If acl is NULL, is it still necessary to set the inode->i_ctime, flag the inode dirty and write the xattrs like in the attached patch or should I simply return from the function immediately?
Comment 8 Chuck Lever 2014-04-29 13:12:58 UTC
(In reply to Marco Munderloh from comment #7)
> If acl is NULL, is it still necessary to set the inode->i_ctime, flag the
> inode dirty and write the xattrs like in the attached patch or should I
> simply return from the function immediately?

You can look at other .set_acl functions under fs/ , and post your patch to linux-fsdevel@vger.kernel.org for review.
Comment 9 Marco Munderloh 2016-03-20 11:40:13 UTC
I think this issue was fixed in the kernel sources at some point as I don't see any problems with later kernels anymore.

Note You need to log in before you can comment on or make changes to this bug.