Skip to content

Commit

Permalink
btrfs: unlock on error in btrfs_file_llseek()
Browse files Browse the repository at this point in the history
There were some unlocks on error missing in a recent patch to
btrfs_file_llseek().

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
  • Loading branch information
error27 authored and chrismason-xx committed Aug 18, 2011
1 parent cb6db4e commit 9a4327c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions fs/btrfs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1804,10 +1804,14 @@ static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int origin)
}
}

if (offset < 0 && !(file->f_mode & FMODE_UNSIGNED_OFFSET))
return -EINVAL;
if (offset > inode->i_sb->s_maxbytes)
return -EINVAL;
if (offset < 0 && !(file->f_mode & FMODE_UNSIGNED_OFFSET)) {
ret = -EINVAL;
goto out;
}
if (offset > inode->i_sb->s_maxbytes) {
ret = -EINVAL;
goto out;
}

/* Special lock needed here? */
if (offset != file->f_pos) {
Expand Down

0 comments on commit 9a4327c

Please sign in to comment.