linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Daeho Jeong <daeho.jeong@samsung.com>
Cc: jack@suse.cz, linux-ext4@vger.kernel.org
Subject: Re: [PATCH v4 2/3] ext4: fix races between changing inode journal mode and ext4_writepages
Date: Wed, 27 Apr 2016 01:05:31 -0400	[thread overview]
Message-ID: <20160427050531.GD30021@thunk.org> (raw)
In-Reply-To: <1457922900-30367-2-git-send-email-daeho.jeong@samsung.com>

On Mon, Mar 14, 2016 at 11:34:59AM +0900, Daeho Jeong wrote:
> Now, in ext4, there is a race condition between changing inode journal
> mode and ext4_writepages(). While ext4_writepages() is executed on
> a non-journalled mode inode, the inode's journal mode could be enabled
> by ioctl() and then, some pages dirtied after switching the journal
> mode will be still exposed to ext4_writepages() in non-journaled mode.
> To resolve this problem, we use fs-wide per-cpu rw semaphore by
> Jan Kara's suggestion because we don't want to waste ext4_inode_info's
> space for this extra rare case.
> 
> Signed-off-by: Daeho Jeong <daeho.jeong@samsung.com>
> Signed-off-by: Jan Kara <jack@suse.cz>

Hi Daeho,

This patch is causing a regression for xfstests generic/231 when using
a 1k block size (this case tests what happens when the blocksize <
page size, such as if you are using a 4k blocksize on a Power PC
system).

If you have kvm-xfstests or gce-xfstests[1] installed you can
reproduce it like this:

	gce-xfstests -c 1k -C 10 generic/231

(Or use kvm-xfstests if you don't want to get a GCE account).

[1] http://thunk.org/gce-xfstests

You will get this:

BEGIN TEST 1k: Ext4 1k block Wed Apr 27 00:48:01 EDT 2016
DEVICE: /dev/mapper/xt-vdd
MK2FS OPTIONS: -q -b 1024
MOUNT OPTIONS: -o block_validity
FSTYP         -- ext4
PLATFORM      -- Linux/x86_64 xfstests-201604270046 4.6.0-rc4-ext4-00010-geed525e
MKFS_OPTIONS  -- -q -b 1024 /dev/mapper/xt-vdc
MOUNT_OPTIONS -- -o acl,user_xattr -o block_validity /dev/mapper/xt-vdc /xt-vdc

generic/231 64s ...	[00:48:03] [00:49:44] [failed, exit status 1] - output mismatch (see /results/results-1k/generic/231.out.bad)
    --- tests/generic/231.out	2016-04-27 00:15:36.000000000 -0400
    +++ /results/results-1k/generic/231.out.bad	2016-04-27 00:49:44.701895666 -0400
    @@ -4,13 +4,10041 @@
     Comparing user usage
     Comparing group usage
     === FSX Standard Mode, Memory Mapping, 4 Tasks ===
    -All 20000 operations completed A-OK!
    -All 20000 operations completed A-OK!
    -All 20000 operations completed A-OK!
    -All 20000 operations completed A-OK!
    ...
    (Run 'diff -u tests/generic/231.out /results/results-1k/generic/231.out.bad'  to see the entire diff)
Ran: generic/231
Failures: generic/231
Failed 1 of 1 tests

I'm going to drop patch 2 and 3 of your patch series from the ext4
tree for now.   Could you take a closer look?

Thanks,

						- Ted
						

  parent reply	other threads:[~2016-04-27  5:05 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-14  2:34 [PATCH v4 1/3] ext4: handle unwritten or delalloc buffers before enabling per-file data journaling Daeho Jeong
2016-03-14  2:34 ` [PATCH v4 2/3] ext4: fix races between changing inode journal mode and ext4_writepages Daeho Jeong
2016-03-14  7:43   ` Jan Kara
2016-04-27  5:05   ` Theodore Ts'o [this message]
2016-03-14  2:35 ` [PATCH v4 3/3] ext4: enable again per-file data journaling on delalloc mode Daeho Jeong
  -- strict thread matches above, loose matches on Subject: below --
2016-04-27  8:04 [PATCH v4 2/3] ext4: fix races between changing inode journal mode and ext4_writepages Daeho Jeong
2016-04-27 14:30 ` Theodore Ts'o
2016-04-29  1:06 Daeho Jeong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160427050531.GD30021@thunk.org \
    --to=tytso@mit.edu \
    --cc=daeho.jeong@samsung.com \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).