Whamcloud - gitweb
libext2fs: fix tdb.c mmap leak
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 27 Jan 2015 18:10:26 +0000 (13:10 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 27 Jan 2015 18:10:39 +0000 (13:10 -0500)
commit5f0164b3a4fb0527b3877aff122d564844c0b301
tree07617ee997453f6fb7a3ea35260783fbcdf27d8d
parent2c741a8afc7e597c2770f96579b034db078402b6
libext2fs: fix tdb.c mmap leak

When undoing an expansion of an mmap'd database while cancelling a
transaction, the tdb code prematurely decreases the variable that
tracks the file size, which leads to a region leak during the
subsequent unmap.  Fix this by maintaining a separate counter for the
region size.

(This is probably unnecessary since e2undo was the only user of tdb
transactions, but I suppose we could be proactive.)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/tdb.c