Using multiple paths seems to invite overlooking one when adding new stuff in the future. Signed-of-by: Andres Freund <andres@xxxxxxxxxxx> --- fs/btrfs/file.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 5bc7116..701c633 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -1814,14 +1814,14 @@ static loff_t btrfs_file_llseek(struct file *file, loff_t offset, int origin) mutex_lock(&inode->i_mutex); if (offset >= i_size_read(inode)) { - mutex_unlock(&inode->i_mutex); - return -ENXIO; + offset = -ENXIO; + goto out; } ret = find_desired_extent(inode, &offset, origin); if (ret) { - mutex_unlock(&inode->i_mutex); - return ret; + offset = ret; + goto out; } if (offset < 0 && !(file->f_mode & FMODE_UNSIGNED_OFFSET)) { -- 1.7.6.409.ge7a85.dirty -- 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