mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-11-24 18:43:53 +08:00
47fee2ef6a
Currently there are many uses of ext2fs_close() which might be wrong. First of all ext2fs_close() does not set the ext2_filsys pointer to NULL so the caller is responsible for clearing it, however there are some cases there we do not do it. Second of all very small number of users of ext2fs_close() actually check the return value. If there is a problem in ext2fs_close() it will not even free the ext2_filsys structure, but majority of users expect it to do so. To fix both problems this commit introduces a new helper ext2fs_close_free() which will not only check for the return value and free the ext2_filsys structure if the call to ext2fs_close2() failed, but it will also set the ext2_filsys pointer to NULL. Replace every use of ext2fs_close() in e2fsprogs tools with ext2fs_close_free() - there is no real reason to keep using ext2fs_close(). Signed-off-by: Lukas Czerner <lczerner@redhat.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> |
||
---|---|---|
.. | ||
debug_cmds.ct | ||
debugfs.8.in | ||
debugfs.c | ||
debugfs.h | ||
dump.c | ||
extent_cmds.ct | ||
extent_inode.c | ||
filefrag.c | ||
htree.c | ||
icheck.c | ||
jfs_user.h | ||
logdump.c | ||
ls.c | ||
lsdel.c | ||
Makefile.in | ||
ncheck.c | ||
quota.c | ||
ro_debug_cmds.ct | ||
set_fields.c | ||
unused.c | ||
util.c | ||
zap.c |