lkml.org 
[lkml]   [2011]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] btrfs: Don't have multiple paths to error out in btrfs_file_llseek
Date
Using multiple paths seems to invite overlooking one when adding new
stuff in the future.

Signed-of-by: Andres Freund <andres@anarazel.de>
---
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


\
 
 \ /
  Last update: 2011-10-01 22:53    [W:0.300 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site