Richard Sharpe c5d0287011 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 <realrichardsharpe@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4136
2016-01-08 11:05:07 -08:00
..
2014-08-01 14:28:05 -07:00
2015-01-16 14:41:26 -08:00
2015-12-22 10:21:33 -08:00
2015-01-16 14:41:26 -08:00
2015-01-16 14:41:26 -08:00
2015-12-15 16:21:43 -08:00
2015-12-22 10:21:33 -08:00
2013-12-18 16:46:35 -08:00
2015-01-16 14:41:26 -08:00
2015-01-16 14:41:26 -08:00
2015-12-22 10:21:33 -08:00
2015-01-16 14:41:26 -08:00
2015-12-30 13:20:12 -08:00
2010-08-31 13:41:59 -07:00
2010-08-31 13:41:58 -07:00
2015-12-22 10:40:40 -08:00
2015-09-02 09:30:18 -07:00
2015-01-16 14:41:26 -08:00
2015-01-16 14:41:26 -08:00
2015-12-22 10:21:33 -08:00
2015-01-16 14:41:26 -08:00
2015-01-16 14:41:26 -08:00
2015-01-16 14:41:26 -08:00
2013-10-31 14:58:04 -07:00
2015-12-22 10:21:33 -08:00
2015-12-04 09:39:20 -08:00
2015-12-28 09:41:30 -08:00
2015-01-16 14:41:26 -08:00
2010-08-31 13:41:58 -07:00
2015-09-04 16:08:14 -07:00
2015-01-16 14:41:26 -08:00
2013-10-30 14:51:27 -07:00
2014-09-05 15:11:43 -07:00
2015-01-16 14:41:26 -08:00
2015-12-30 13:20:12 -08:00
2014-08-01 14:28:05 -07:00
2015-12-22 10:21:33 -08:00
2015-12-30 13:20:12 -08:00
2015-12-15 16:21:43 -08:00