linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <linux@treblig.org>
To: Christoph Hellwig <hch@lst.de>
Cc: mikulas@artax.karlin.mff.cuni.cz, linux-fsdevel@vger.kernel.org
Subject: [PATCH] hpfs_setattr error case avoids unlock_kernel
Date: Mon, 13 Dec 2010 17:09:52 +0000	[thread overview]
Message-ID: <20101213170952.GA29037@gallifrey> (raw)
In-Reply-To: <20101213160304.GA6238@lst.de>

* Christoph Hellwig (hch@lst.de) wrote:
> On Sun, Dec 12, 2010 at 12:49:47AM +0000, Dr. David Alan Gilbert wrote:
> > it looks like that 1st 'return error' needs to change into a goto out_unlock;
> 
> Yes.  Care to send a patch to fix it?


This fixed a case that 'sparse' spotted where hpfs_setattr has an error return
that didn't go through it's path that unlocks.

This is against git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
version 6313e3c21743cc88bb5bd8aa72948ee1e83937b6.

Build tested only, I don't have an hpfs file system to test.

Dave

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

---
diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c
index 56f0da1..1ae35ba 100644
--- a/fs/hpfs/inode.c
+++ b/fs/hpfs/inode.c
@@ -281,7 +281,7 @@ int hpfs_setattr(struct dentry *dentry, struct iattr *attr)
 	    attr->ia_size != i_size_read(inode)) {
 		error = vmtruncate(inode, attr->ia_size);
 		if (error)
-			return error;
+			goto out_unlock;
 	}
 
 	setattr_copy(inode, attr);
-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\ gro.gilbert @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

  reply	other threads:[~2010-12-13 17:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-12  0:49 hpfs_setattr error case avoids unlock_kernel ? Dr. David Alan Gilbert
2010-12-13 16:03 ` Christoph Hellwig
2010-12-13 17:09   ` Dr. David Alan Gilbert [this message]
2011-02-07 15:31     ` [PATCH] hpfs_setattr error case avoids unlock_kernel Mikulas Patocka
2011-02-07 15:31   ` hpfs_setattr error case avoids unlock_kernel ? Mikulas Patocka

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=20101213170952.GA29037@gallifrey \
    --to=linux@treblig.org \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=mikulas@artax.karlin.mff.cuni.cz \
    /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).