Skip to content

Commit

Permalink
fuse: fix fuse_file_lseek returning with lock held
Browse files Browse the repository at this point in the history
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
  • Loading branch information
error27 authored and Miklos Szeredi committed Mar 30, 2009
1 parent 0d34fb8 commit 5291658
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/fuse/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
}
Expand Down

0 comments on commit 5291658

Please sign in to comment.