e2fsprogs/e2fsck
Darrick J. Wong ab2cd4a4d2 e2fsck: don't flush the FS unless it's actually dirty
ext2fs_flush2() unconditionally writes the block group descriptors to
disk even if the underlying FS isn't marked dirty.  This causes the
following error message on a fsck -n run:

e2fsck 1.43-WIP (09-Jul-2014)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Error writing block 2 (Attempt to write block to filesystem resulted in short write).  Ignore error? no

Error writing block 2 (Attempt to write block to filesystem resulted in short write).  Ignore error? no

Error writing file system info: Attempt to write block to filesystem resulted in short write

Since ext2fs_close2() only calls flush if the dirty flag is set,
modify e2fsck to exhibit the same behavior so that we don't spit out
write errors for a read only check.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-08-12 14:19:42 -04:00
..
CHANGES Many files: 1997-04-26 13:21:57 +00:00
Makefile.in e2fsprogs: remove checker infrastructure 2014-07-04 23:59:30 -04:00
Makefile.pq Many files: 1997-11-14 05:23:04 +00:00
argv_parse.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
argv_parse.h Remove trailing whitespace for the entire source tree 2008-08-27 23:07:54 -04:00
badblocks.c e2fsck: fix memory leak on error path in read_bad_blocks_files() 2014-01-07 09:10:24 -05:00
crc32.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
crc32defs.h Only use __builtin_expect if __GNUC__ > 3 2008-07-13 16:06:56 -04:00
dict.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
dict.h Fixx gcc -Wall nitpicks. 2003-07-06 00:36:48 -04:00
dirinfo.c Save and restore umask around calls to mkstemp() 2014-01-09 15:18:44 -05:00
dx_dirinfo.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
e2fsck.8.in Fix spelling typo's in man pages for tune2fs and mke2fs 2012-07-14 19:58:06 -04:00
e2fsck.c Clean up sparse warnings 2013-12-16 18:56:36 -05:00
e2fsck.conf.5.in e2fsck.conf: clarify man page's description of accept_time_fudge 2014-01-04 19:11:36 -05:00
e2fsck.h e2fsck: reserve blocks for root/lost+found directory repair 2014-07-26 15:45:42 -04:00
ea_refcount.c e2fsck: fix printf conversion specs in ea_refcount.c 2013-12-24 22:50:23 -05:00
ehandler.c e2fsck: fix potential segv when handling a read error in a superblock 2012-08-06 18:46:42 -04:00
emptydir.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
extend.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
flushb.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
gen_crc32table.c Fix gcc -Wall warnings in e2fsck 2008-06-07 11:04:10 -04:00
iscan.c debugfs, e2fsck: fix s_desc_size handling 2013-12-24 22:50:19 -05:00
jfs_user.h Allow e2fsprogs to be built using the clang (LLVM) frontend 2012-09-09 21:35:39 -04:00
journal.c journal: use consts instead of 1024 and add helper for journal with 1k blocksize 2014-07-28 20:21:47 -04:00
logfile.c e2fsck: do not crash on long log file names 2013-01-08 20:36:48 -05:00
message.c e2fsck: sort the abbreviations better 2014-06-03 22:04:33 -04:00
mtrace.awk Many files: 1997-04-26 13:21:57 +00:00
mtrace.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
mtrace.h ChangeLog, super.c: 2001-01-12 21:05:57 +00:00
pass1.c e2fsck: fix rule-violating lblk->pblk mappings on bigalloc filesystems 2014-07-26 16:27:41 -04:00
pass1b.c e2fsck: during pass1b delete_file, only free a cluster once 2014-07-26 16:28:58 -04:00
pass2.c e2fsck: during pass1b delete_file, only free a cluster once 2014-07-26 16:28:58 -04:00
pass3.c e2fsck: reserve blocks for root/lost+found directory repair 2014-07-26 15:45:42 -04:00
pass4.c e2fsck: use dgrp_t for block group numbers 2013-12-02 23:21:31 -05:00
pass5.c Fix 32/64-bit overflow when multiplying by blocks/clusters per group 2014-07-26 07:40:36 -04:00
problem.c e2fsck: flush out the superblock and bitmaps before printing final messages 2014-08-10 18:12:02 -04:00
problem.h e2fsck: flush out the superblock and bitmaps before printing final messages 2014-08-10 18:12:02 -04:00
problemP.h e2fsck: add ability to limit the # of problems of a particular type 2012-03-14 17:44:54 -04:00
prof_err.et Fix more spelling errors found by translators and add pluralization 2011-10-09 17:54:23 -04:00
profile.c e2fsck, mke2fs: enable octal integers in the profile/config file 2014-01-30 13:58:18 -05:00
profile.h mke2fs: Allow specifying reserved_ratio via mke2fs.conf 2011-05-14 23:34:48 -04:00
profile_helpers.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
profile_helpers.h Simplify profile core functionality 2006-01-02 22:04:41 -05:00
quota.c quota: integrate mkquota.h into quotaio.h 2014-05-13 10:13:04 -04:00
recovery.c e2fsck: fix gcc -Wall nits 2013-05-19 21:36:31 -04:00
region.c build: quiet some "gcc -Wall" compiler warnings 2012-12-29 17:39:45 -05:00
rehash.c libext2fs: provide a function to set inode size 2014-07-26 14:34:56 -04:00
revoke.c Shorten compile commands run by the build system 2011-09-18 17:34:37 -04:00
scantest.c e2fsprogs: introduce ext2fs_close_free() helper 2014-07-05 21:06:48 -04:00
sigcatcher.c Work around Debian Bug #712530 2013-06-16 17:54:39 -04:00
super.c e2fsck: fix file systems with an overly large s_first_meta_bg 2014-08-10 16:21:08 -04:00
unix.c e2fsck: don't flush the FS unless it's actually dirty 2014-08-12 14:19:42 -04:00
util.c e2fsprogs: introduce ext2fs_close_free() helper 2014-07-05 21:06:48 -04:00