aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2009-03-27 06:36:10 -0400
committerMiklos Szeredi <mszeredi@suse.cz>2009-03-30 11:26:24 -0400
commit5291658d87ac1ae60418e79e7b6bad7d5f595e0c (patch)
treee91cba2f5e73a5a93fcff6e866ebae737fee1e5c
parent0d34fb8e93ceba7b6dad0062dbb4a0813bacd75b (diff)
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 <error27@gmail.com> Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> CC: stable@kernel.org
-rw-r--r--fs/fuse/file.c3
1 files changed, 2 insertions, 1 deletions
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)
1465 case SEEK_END: 1465 case SEEK_END:
1466 retval = fuse_update_attributes(inode, NULL, file, NULL); 1466 retval = fuse_update_attributes(inode, NULL, file, NULL);
1467 if (retval) 1467 if (retval)
1468 return retval; 1468 goto exit;
1469 offset += i_size_read(inode); 1469 offset += i_size_read(inode);
1470 break; 1470 break;
1471 case SEEK_CUR: 1471 case SEEK_CUR:
@@ -1479,6 +1479,7 @@ static loff_t fuse_file_llseek(struct file *file, loff_t offset, int origin)
1479 } 1479 }
1480 retval = offset; 1480 retval = offset;
1481 } 1481 }
1482exit:
1482 mutex_unlock(&inode->i_mutex); 1483 mutex_unlock(&inode->i_mutex);
1483 return retval; 1484 return retval;
1484} 1485}