public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Mingming Cao <cmm@us.ibm.com>
To: Jan Kara <jack@suse.cz>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext4: Add missing unlock to an error path in ext4_quota_write()
Date: Fri, 27 Jun 2008 16:54:34 -0700	[thread overview]
Message-ID: <1214610874.6837.22.camel@mingming-laptop> (raw)
In-Reply-To: <12144791441146-git-send-email-jack@suse.cz>


On Thu, 2008-06-26 at 13:19 +0200, Jan Kara wrote:
> When write in ext4_quota_write() fails, we have to properly release
> i_mutex. One error path has been missing the unlock...
> 

Added to ext4 patch queue,

thanks
Mingming
> Signed-off-by: Jan Kara <jack@suse.cz>
> ---
>  fs/ext4/super.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/ext4/super.c b/fs/ext4/super.c
> index cb96f12..02bf243 100644
> --- a/fs/ext4/super.c
> +++ b/fs/ext4/super.c
> @@ -3337,8 +3337,10 @@ static ssize_t ext4_quota_write(struct super_block *sb, int type,
>  		blk++;
>  	}
>  out:
> -	if (len == towrite)
> +	if (len == towrite) {
> +		mutex_unlock(&inode->i_mutex);
>  		return err;
> +	}
>  	if (inode->i_size < off+len-towrite) {
>  		i_size_write(inode, off+len-towrite);
>  		EXT4_I(inode)->i_disksize = inode->i_size;


      reply	other threads:[~2008-06-27 23:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-26 11:19 [PATCH] ext3: Add missing unlock to error path in ext3_quota_write() Jan Kara
2008-06-26 11:19 ` [PATCH] ext4: Add missing unlock to an error path in ext4_quota_write() Jan Kara
2008-06-27 23:54   ` Mingming Cao [this message]

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=1214610874.6837.22.camel@mingming-laptop \
    --to=cmm@us.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=jack@suse.cz \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@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