From: Artem Bityutskiy Date: Tue, 7 Feb 2012 08:58:51 +0000 (+0200) Subject: UBIFS: do not use inc_link when i_nlink is zero X-Git-Tag: sz_release~71 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b14fd42d80107c887ce064a9aa0b8da89571f8df;p=pandora-kernel.git 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 . Signed-off-by: Artem Bityutskiy --- Reading git-diff-tree failed