Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0670fc2
)
libext2fs: teach ext2fs_flush() to check if group descriptors are loaded
author
Theodore Ts'o
<tytso@mit.edu>
Thu, 16 Jan 2020 23:56:49 +0000
(18:56 -0500)
committer
Theodore Ts'o
<tytso@mit.edu>
Fri, 17 Jan 2020 00:47:54 +0000
(19:47 -0500)
If the EXT2_FLAG_SUPER_ONLY is not set, and the group descriptors are
not loaded, ext2fs_flush[2]() will return EXT2_ET_NO_GDESC.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/closefs.c
patch
|
blob
|
history
diff --git
a/lib/ext2fs/closefs.c
b/lib/ext2fs/closefs.c
index
1d4d5b7
..
6814cdc
100644
(file)
--- a/
lib/ext2fs/closefs.c
+++ b/
lib/ext2fs/closefs.c
@@
-293,6
+293,11
@@
errcode_t ext2fs_flush2(ext2_filsys fs, int flags)
EXT2_CHECK_MAGIC(fs, EXT2_ET_MAGIC_EXT2FS_FILSYS);
+ if ((fs->flags & EXT2_FLAG_SUPER_ONLY) == 0 &&
+ !ext2fs_has_feature_journal_dev(fs->super) &&
+ fs->group_desc == NULL)
+ return EXT2_ET_NO_GDESC;
+
fs_state = fs->super->s_state;
feature_incompat = fs->super->s_feature_incompat;