Whamcloud - gitweb
e2fsck: Fix inode nlink accounting that could cause PROGRAMMING BUG errors
authorTheodore Ts'o <tytso@mit.edu>
Sat, 27 Nov 2010 00:09:43 +0000 (19:09 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 27 Nov 2010 00:09:43 +0000 (19:09 -0500)
commit992016c5afde0f77a9ff10c4fc5be02f83eb055c
tree35b8973cb219708478c3ee372c22fa9a34db174c
parent6a81b40ae7f1334dc8b3872534d2abb0646eafbd
e2fsck: Fix inode nlink accounting that could cause PROGRAMMING BUG errors

This fixes two possible causes for the error message:

WARNING: PROGRAMMING BUG IN E2FSCK!
        OR SOME BONEHEAD (YOU) IS CHECKING A MOUNTED (LIVE) FILESYSTEM.
inode_link_info[X] is Y, inode.i_links_count is Z.  They should be the same!

One cause which can trigger this message is when an inode has an
illegal link count > 65500 --- for example, 65535.  This was the case
in the Debian Bug report #555456.

Another cause which could trigger this message is if an ext4 directory
previously had more than 65000 subdirectories (thus causing
i_link_count to be set to 1), but then some of the subdirectories were
deleted, such that i_link_count should now be the actual number of
subdirectories.

Addresses-Debian-Bug: #555456

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
e2fsck/pass4.c