All of lore.kernel.org
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Namjae Jeon <namjae.jeon@samsung.com>
Cc: linux-ext4 <linux-ext4@vger.kernel.org>,
	"Lukáš Czerner" <lczerner@redhat.com>,
	"Ashish Sangwan" <a.sangwan@samsung.com>
Subject: Re: [PATCH 1/2] ext4: introduce new i_write_mutex to protect fallocate
Date: Mon, 26 May 2014 21:59:59 -0400	[thread overview]
Message-ID: <20140527015959.GO22284@thunk.org> (raw)
In-Reply-To: <20140526162900.GI22284@thunk.org>

On Mon, May 26, 2014 at 12:29:00PM -0400, Theodore Ts'o wrote:
> On Tue, May 13, 2014 at 09:19:17AM +0900, Namjae Jeon wrote:
> > Introduce new i_write_mutex to protect new writes from coming while doing
> > fallocate operations. Also, get rid of aio_mutex as it is covered by
> > i_write_mutex.
> > 
> Thanks, applied.
> 

I had to apply the following fix up patch, or else running generic/308
using the ext3 config would end up returning to userspace with
i_write_mutex still locked.

For all ext4 developers: please consider running at least
"kvm-xfstests -g quick" (which would have shown this issue), or better
yet, "kvm-xfstests -g auto" before sending patches.  It finds problems
like this.  :-)

Cheers,

					- Ted

diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 8c39305..e5cd87f 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -135,8 +135,8 @@ ext4_file_write(struct kiocb *iocb, const struct iovec *iov,
 		if ((pos > sbi->s_bitmap_maxbytes) ||
 		    (pos == sbi->s_bitmap_maxbytes && length > 0)) {
 			mutex_unlock(&inode->i_mutex);
-			ret = -EFBIG;
-			goto errout;
+			mutex_unlock(&EXT4_I(inode)->i_write_mutex);
+			return -EFBIG;
 		}
 
 		if (pos + length > sbi->s_bitmap_maxbytes) {
@@ -196,7 +196,6 @@ ext4_file_write(struct kiocb *iocb, const struct iovec *iov,
 	if (o_direct)
 		blk_finish_plug(&plug);
 
-errout:
 	if (unaligned_direct_aio)
 		mutex_unlock(&EXT4_I(inode)->i_write_mutex);
 	return ret;

  reply	other threads:[~2014-05-27  2:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-13  0:19 [PATCH 1/2] ext4: introduce new i_write_mutex to protect fallocate Namjae Jeon
2014-05-26 16:29 ` Theodore Ts'o
2014-05-27  1:59   ` Theodore Ts'o [this message]
2014-05-27  2:12     ` Namjae Jeon
2014-05-29 12:42 ` Lukáš Czerner
2014-05-29 16:28   ` Theodore Ts'o
2014-05-31  6:45     ` Namjae Jeon
2014-06-02 14:38       ` Theodore Ts'o
2014-06-03  6:04         ` Namjae Jeon
2014-06-03 10:49           ` Lukáš Czerner
2014-06-03 15:19           ` Theodore Ts'o
2014-06-04  5:58             ` Namjae Jeon
2014-06-08  2:48               ` Theodore Ts'o

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=20140527015959.GO22284@thunk.org \
    --to=tytso@mit.edu \
    --cc=a.sangwan@samsung.com \
    --cc=lczerner@redhat.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=namjae.jeon@samsung.com \
    /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 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.