Whamcloud - gitweb
e2fsck: fix multiply-claimed block quota accounting when deleting files
authorEric Whitney <enwlinux@gmail.com>
Thu, 25 May 2017 01:34:20 +0000 (21:34 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 25 May 2017 01:34:23 +0000 (21:34 -0400)
commitb0f5fa880c36bf25bb5beebd0b43102fffec99b0
tree5dfd91495e907beb3f93057b5374854f1f57f263
parent3fb715b55426875902dfef3056b2cf7335953178
e2fsck: fix multiply-claimed block quota accounting when deleting files

As e2fsck processes each file in pass1, the actual file system quota is
increased by the number of blocks discovered in the file.  This can
include both non-multiply-claimed and multiply-claimed blocks, if the
latter exist.  However, if a file containing multiply-claimed blocks
is then deleted in pass1b, those blocks are not taken into account when
decreasing the actual quota.  In this case, the new quota values written
to the file system by e2fsck overstate the space actually consumed.
And, e2fsck must be run twice on the file system to fully correct
quota.

Fix this by counting multiply-claimed blocks as a debit to quota when
deleting files in pass1b.

Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
e2fsck/pass1b.c