linux-stable/fs/ext3
Jan Kara 166418ccef ext3: Fix deadlock in data=journal mode when fs is frozen
When ext3 is used in data=journal mode, syncing filesystem makes sure
all the data is committed in the journal but the data doesn't have to be
checkpointed. ext3_freeze() then takes care of checkpointing all the
data so all buffer heads are clean but pages can still have dangling
dirty bits. So when flusher thread comes later when filesystem is
frozen, it tries to write back dirty pages, ext3_journalled_writepage()
tries to start a transaction and hangs waiting for frozen fs causing a
deadlock because a holder of s_umount semaphore may be waiting for
flusher thread to complete.

The fix is luckily relatively easy. We don't have to start a transaction
in ext3_journalled_writepage() when a page is just dirty (and doesn't
have PageChecked set) because in that case all buffers should be already
mapped (mapping must happen before writing a buffer to the journal) and
it is enough to write them out. This optimization also solves the deadlock
because block_write_full_page() will just find out there's no buffer to
write and do nothing.

Signed-off-by: Jan Kara <jack@suse.cz>
2014-05-22 17:26:11 +02:00
..
acl.c ext2/3/4: use generic posix ACL infrastructure 2014-01-25 23:58:19 -05:00
acl.h ext2/3/4: use generic posix ACL infrastructure 2014-01-25 23:58:19 -05:00
balloc.c ext3: remove an unneeded check in ext3_new_blocks() 2014-03-03 11:31:01 +01:00
bitmap.c ext3: use memweight() 2012-07-30 17:25:16 -07:00
dir.c fs: Mark function as static in ext3/dir.c 2014-03-03 11:30:59 +01:00
ext3.h Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs 2012-05-25 08:14:59 -07:00
ext3_jbd.c ext3: move headers to fs/ext3/ 2012-03-31 16:03:16 -04:00
file.c ext2/3/4: use generic posix ACL infrastructure 2014-01-25 23:58:19 -05:00
fsync.c ext3: Fix fsync error handling after filesystem abort. 2013-07-04 19:22:55 +02:00
hash.c ext3: return 32/64-bit dir name hash according to usage type 2012-05-15 23:34:39 +02:00
ialloc.c ext2/3: use prandom_u32() instead of get_random_bytes() 2014-03-04 12:19:03 +01:00
inode.c ext3: Fix deadlock in data=journal mode when fs is frozen 2014-05-22 17:26:11 +02:00
ioctl.c new helper: file_inode(file) 2013-02-22 23:31:31 -05:00
Kconfig ext3: default to ordered mode 2010-07-23 12:50:55 +02:00
Makefile
namei.c ext2/3/4: use generic posix ACL infrastructure 2014-01-25 23:58:19 -05:00
namei.h ext3: ext3_bread usage audit 2012-10-09 23:21:42 +02:00
resize.c Ext3: return ENOMEM rather than EIO if sb_getblk fails 2013-01-21 11:19:57 +01:00
super.c Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs 2014-04-07 17:59:17 -07:00
symlink.c ext3: move headers to fs/ext3/ 2012-03-31 16:03:16 -04:00
xattr.c ext2/3/4: use generic posix ACL infrastructure 2014-01-25 23:58:19 -05:00
xattr.h ext2/3/4: use generic posix ACL infrastructure 2014-01-25 23:58:19 -05:00
xattr_security.c fs: Mark function as static in ext3/xattr_security.c 2014-03-03 11:31:00 +01:00
xattr_trusted.c ext3: move headers to fs/ext3/ 2012-03-31 16:03:16 -04:00
xattr_user.c ext3: move headers to fs/ext3/ 2012-03-31 16:03:16 -04:00