All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2 v2] Fix data corruption when blocksize < pagesize for mmapped data
@ 2014-10-10 14:23 ` Jan Kara
  0 siblings, 0 replies; 184+ messages in thread
From: Jan Kara @ 2014-10-10 14:23 UTC (permalink / raw)
  To: linux-fsdevel
  Cc: linux-ext4, Dave Chinner, xfs, cluster-devel, Steven Whitehouse,
	Mark Fasheh, Joel Becker, ocfs2-devel, reiserfs-devel,
	Jeff Mahoney, Dave Kleikamp, jfs-discussion, tytso, viro,
	Jan Kara

  Hello,

  this is a second version of the patches to fix data corruption in mmapped
data when blocksize < pagesize as tested by xfstests generic/030 test.
The patchset fixes XFS and ext4. I've checked and btrfs doesn't need fixing
because it doesn't support blocksize < pagesize. If that's ever going
to change btrfs will likely need a similar treatment. ocfs2, ext2, ext3 are
OK since they happily allocate blocks during writeback. For other filesystems
like gfs2, ubifs, nilfs, ceph,... I'm not sure whether they support blocksize <
pagesize at all. Interesting is also NFS which may care but I don't understand
its ->page_mkwrite() handler good enough to judge.

Changes since v1:
- changed helper function name and moved it to mm/truncate.c - I originally
  thought we can make the helper function update i_size to simplify the
  interface but it's actually impossible due to generic_write_end() lock
  ordering constraints.
- used round_up() instead of ALIGN()
- taught truncate_setsize() to use the helper function

								Honza

^ permalink raw reply	[flat|nested] 184+ messages in thread
* [PATCH] jbd2: Optimize jbd2_log_do_checkpoint() a bit
@ 2014-09-02 17:18 Jan Kara
  2014-09-02 21:59 ` Theodore Ts'o
  0 siblings, 1 reply; 184+ messages in thread
From: Jan Kara @ 2014-09-02 17:18 UTC (permalink / raw)
  To: Ted Tso; +Cc: linux-ext4, Jan Kara

When we discover written out buffer in transaction checkpoint list we
don't have to recheck validity of a transaction. Either this is the last
buffer in a transaction - and then we are done - or this isn't and then
we can just take another buffer from the checkpoint list without
dropping j_list_lock.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/jbd2/checkpoint.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/fs/jbd2/checkpoint.c b/fs/jbd2/checkpoint.c
index 993a187527f3..3722e2e53638 100644
--- a/fs/jbd2/checkpoint.c
+++ b/fs/jbd2/checkpoint.c
@@ -343,12 +343,15 @@ restart:
 		if (!buffer_dirty(bh)) {
 			if (unlikely(buffer_write_io_error(bh)) && !result)
 				result = -EIO;
-			get_bh(bh);
 			BUFFER_TRACE(bh, "remove from checkpoint");
-			__jbd2_journal_remove_checkpoint(jh);
-			spin_unlock(&journal->j_list_lock);
-			__brelse(bh);
-			goto retry;
+			if (__jbd2_journal_remove_checkpoint(jh)) {
+				/*
+				 * This was the last buffer attached to the
+				 * transaction. We are done.
+				 */
+				goto out;
+			}
+			continue;
 		}
 		/*
 		 * Important: we are about to write the buffer, and
-- 
1.8.1.4


^ permalink raw reply related	[flat|nested] 184+ messages in thread

end of thread, other threads:[~2014-10-10 15:32 UTC | newest]

Thread overview: 184+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-10 14:23 [PATCH 0/2 v2] Fix data corruption when blocksize < pagesize for mmapped data Jan Kara
2014-10-10 14:23 ` [Cluster-devel] " Jan Kara
2014-10-10 14:23 ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23 ` Jan Kara
2014-10-10 14:23 ` [PATCH 1/2 RESEND] bdi: Fix hung task on sync Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] block: free q->flush_rq in blk_init_allocated_queue error paths Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 15:19   ` Dave Jones
2014-10-10 15:19     ` [Cluster-devel] " Dave Jones
2014-10-10 15:32     ` Jan Kara
2014-10-10 15:32       ` [Cluster-devel] " Jan Kara
2014-10-10 15:32       ` [Ocfs2-devel] " Jan Kara
2014-10-10 15:32       ` Jan Kara
2014-10-10 14:23 ` [PATCH] block: improve rq_affinity placement Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] block: Make rq_affinity = 1 work as expected Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] block: strict rq_affinity Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] ext3: Fix deadlock in data=journal mode when fs is frozen Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] ext3: Speedup WB_SYNC_ALL pass Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] ext4: Avoid lock inversion between i_mmap_mutex and transaction start Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH 1/2] ext4: Don't check quota format when there are no quota files Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH 1/2] ext4: Fix block zeroing when punching holes in indirect block files Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] ext4: Fix buffer double free in ext4_alloc_branch() Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23 ` [PATCH] ext4: Fix jbd2 warning under heavy xattr load Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] ext4: Fix zeroing of page during writeback Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] ext4: Remove orphan list handling Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] ext4: Speedup WB_SYNC_ALL pass Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23 ` [PATCH for 3.14-stable] fanotify: fix double free of pending permission events Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] fs: Avoid userspace mounting anon_inodefs filesystem Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH 1/2] jbd2: Avoid pointless scanning of checkpoint lists Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] jbd2: Optimize jbd2_log_do_checkpoint() a bit Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] lockdep: Dump info via tracing Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] mm: Fixup pagecache_isize_extended() definitions for !CONFIG_MMU Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] ncpfs: fix rmdir returns Device or resource busy Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] ocfs2: Fix quota file corruption Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH 1/2] printk: Debug patch1 Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] printk: debug: Slow down printing to 9600 bauds Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] printk: enable interrupts before calling console_trylock_for_printk() Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] quota: Fix race between dqput() and dquot_scan_active() Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] scsi: Keep interrupts disabled while submitting requests Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] sync: don't block the flusher thread waiting on IO Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] timer: Fix lock inversion between hrtimer_bases.lock and scheduler locks Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] udf: Avoid infinite loop when processing indirect ICBs Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] udf: Print error when inode is loaded Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] vfs: Allocate anon_inode_inode in anon_inode_init() Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH 1/2] vfs: Fix data corruption when blocksize < pagesize for mmaped data Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH RESEND] vfs: Return EINVAL for default SEEK_HOLE, SEEK_DATA implementation Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] writeback: plug writeback at a high level Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH] x86: Fixup lockdep complaint caused by io apic code Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH 2/2 RESEND] bdi: Avoid oops on device removal Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH 2/2] ext3: Don't check quota format when there are no quota files Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH 2/2] ext4: Fix hole punching for files with indirect blocks Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH 2/2] ext4: Fix mmap data corruption when blocksize < pagesize Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH 2/2] jbd2: Simplify calling convention around __jbd2_journal_clean_checkpoint_list Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
2014-10-10 14:23 ` [PATCH 2/2] printk: Debug patch 2 Jan Kara
2014-10-10 14:23   ` [Cluster-devel] " Jan Kara
2014-10-10 14:23   ` [Ocfs2-devel] " Jan Kara
2014-10-10 14:23   ` Jan Kara
  -- strict thread matches above, loose matches on Subject: below --
2014-09-02 17:18 [PATCH] jbd2: Optimize jbd2_log_do_checkpoint() a bit Jan Kara
2014-09-02 21:59 ` Theodore Ts'o
2014-09-03 16:03   ` Jan Kara

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.