Re: [PATCH] hpfs_setattr error case avoids unlock_kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ACK.

Mikulas

On Mon, 13 Dec 2010, Dr. David Alan Gilbert wrote:

> * Christoph Hellwig (hch@xxxxxx) 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@xxxxxxxxxxx>
> 
> ---
> 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   |_______/
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux