linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: linux-fsdevel@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
	bfields@fieldses.org, Al Viro <viro@ZenIV.linux.org.uk>,
	Jan Kara <jack@suse.cz>
Subject: [PATCH 2/6] ext4: Remove i_mutex use from ext4_quota_write()
Date: Wed, 25 Apr 2012 22:57:43 +0200	[thread overview]
Message-ID: <1335387467-4928-3-git-send-email-jack@suse.cz> (raw)
In-Reply-To: <1335387467-4928-1-git-send-email-jack@suse.cz>

We don't need i_mutex in ext4_quota_write() because writes to quota file
are serialized by dqio_mutex anyway. Changes to quota files outside of quota
code are forbidded and enforced by NOATIME and IMMUTABLE bits.

Signed-off-by: Jan Kara <jack@suse.cz>
---
 fs/ext4/super.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 6da1935..14965ca 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -4742,7 +4742,6 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type,
 		return -EIO;
 	}
 
-	mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
 	bh = ext4_bread(handle, inode, blk, 1, &err);
 	if (!bh)
 		goto out;
@@ -4758,16 +4757,13 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type,
 	err = ext4_handle_dirty_metadata(handle, NULL, bh);
 	brelse(bh);
 out:
-	if (err) {
-		mutex_unlock(&inode->i_mutex);
+	if (err)
 		return err;
-	}
 	if (inode->i_size < off + len) {
 		i_size_write(inode, off + len);
 		EXT4_I(inode)->i_disksize = inode->i_size;
 		ext4_mark_inode_dirty(handle, inode);
 	}
-	mutex_unlock(&inode->i_mutex);
 	return len;
 }
 
-- 
1.7.1


  parent reply	other threads:[~2012-04-25 20:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-25 20:57 [PATCH 0/6] Get rid of I_MUTEX_QUOTA use Jan Kara
2012-04-25 20:57 ` [PATCH 1/6] ext3: Remove i_mutex use from ext3_quota_write() Jan Kara
2012-04-25 20:57 ` Jan Kara [this message]
2012-04-25 20:57 ` [PATCH 3/6] reiserfs: Remove i_mutex use from reiserfs_quota_write() Jan Kara
2012-04-25 20:57 ` [PATCH 4/6] ext2: Remove i_mutex use from ext2_quota_write() Jan Kara
2012-04-25 20:57 ` [PATCH 5/6] quota: Use precomputed value of sb_dqopt in dquot_quota_sync Jan Kara
2012-04-25 20:57 ` [PATCH 6/6] quota: Get rid of nested I_MUTEX_QUOTA locking subclass Jan Kara
2012-04-25 21:25 ` [PATCH 0/6] Get rid of I_MUTEX_QUOTA use J. Bruce Fields
2012-04-26 13:26   ` Jan Kara
2012-04-27 13:47     ` J. Bruce Fields
2012-04-30 13:54       ` Jan Kara
2012-05-09 21:34         ` J. Bruce Fields

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=1335387467-4928-3-git-send-email-jack@suse.cz \
    --to=jack@suse.cz \
    --cc=bfields@fieldses.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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).