diff options
author | Richard Sharpe <[email protected]> | 2015-12-27 16:08:05 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2016-01-08 11:05:07 -0800 |
commit | c5d0287011679d76288c2617c409252245172a32 (patch) | |
tree | 756e4dac4ca8f871bcaab9879ca3c3c29606fad0 /cmd/zdb | |
parent | 7cf2ffa02065fe0cbec13bfb7bf4fcfaabb3d40a (diff) |
Fix casesensitivity=insensitive deadlock
When casesensitivity=insensitive is set for the
file system, we can deadlock in a rename if the user uses different case
for each path. For example rename("A/some-file.txt", "a/some-file.txt").
The simple test for this is:
1. mkdir some-dir in a ZFS file system
2. touch some-dir/some-file.txt
3. mv Some-dir/some-file.txt some-dir/some-other-file.txt
This last request deadlocks trying to relock the i_mutex on the inode for
the parent directory.
The solution is to use d_add_ci in zpl_lookup if we are on a file system
that has the casesensitivity=insensitive attribute set.
This patch checks if we are working on a case insensitive file system and if
so, allocates storage for the case insensitive name and passes it to
zfs_lookup and then calls d_add_ci instead of d_splice_alias.
The performance impact seems to be minimal even though we have introduced a
kmalloc and kfree in the lookup path.
The problem was found when running Microsoft's FSCT against Samba on top of
ZFS On Linux.
Signed-off-by: Richard Sharpe <[email protected]>
Signed-off-by: Brian Behlendorf <[email protected]>
Closes #4136
Diffstat (limited to 'cmd/zdb')
0 files changed, 0 insertions, 0 deletions