From: Dan Carpenter Date: Fri, 27 Mar 2009 10:36:10 +0000 (+0300) Subject: fuse: fix fuse_file_lseek returning with lock held X-Git-Tag: MMI-PSA29.97-13-9~29190^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5291658d87ac1ae60418e79e7b6bad7d5f595e0c;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git fuse: fix fuse_file_lseek returning with lock held This bug was found with smatch (http://repo.or.cz/w/smatch.git/). If we return directly the inode->i_mutex lock doesn't get released. Signed-off-by: Dan Carpenter Signed-off-by: Miklos Szeredi CC: stable@kernel.org --- diff --git a/fs/fuse/file.c b/fs/fuse/file.c index d9fdb7cec538..821d10f719bd 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -1465,7 +1465,7 @@ static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin) case SEEK_END: retval = fuse_update_attributes(inode, NULL, file, NULL); if (retval) - return retval; + goto exit; offset += i_size_read(inode); break; case SEEK_CUR: @@ -1479,6 +1479,7 @@ static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin) } retval = offset; } +exit: mutex_unlock(&inode->i_mutex); return retval; }