Artem Bityutskiy c43be1085f UBIFS: do not use inc_link when i_nlink is zero
This patch changes the 'i_nlink' counter handling in 'ubifs_unlink()',
'ubifs_rmdir()' and 'ubifs_rename()'. In these function  'i_nlink' may become 0,
and if 'ubifs_jnl_update()' failed, we would use 'inc_nlink()' to restore
the previous 'i_nlink' value, which is incorrect from the VFS point of view and
would cause a 'WARN_ON()' (see 'inc_nlink() implementation).

This patches saves the previous 'i_nlink' value in a local variable and uses it
at the error path instead of calling 'inc_nlink()'. We do this only for the
inodes where 'i_nlink' may potentially become zero.

This change has been requested by Al Viro <viro@ZenIV.linux.org.uk>.

Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
2012-02-29 16:10:20 +02:00
..
2008-12-31 14:13:24 +02:00
2011-07-04 10:54:33 +03:00
2012-01-03 22:52:40 -05:00
2012-01-13 12:50:42 +02:00
2011-04-05 10:45:45 +03:00
2011-07-04 10:54:33 +03:00
2011-07-04 10:54:33 +03:00
2011-07-04 10:54:33 +03:00
2012-01-13 12:50:42 +02:00
2011-08-26 16:08:39 +05:30
2011-07-04 10:54:33 +03:00
2012-01-13 12:50:42 +02:00
2012-01-03 22:55:06 -05:00