[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201110012250.04307.andres@anarazel.de>
Date: Sat, 1 Oct 2011 22:50:04 +0200
From: Andres Freund <andres@...razel.de>
To: Andi Kleen <andi@...stfloor.org>
Cc: robertmhaas@...il.com, viro@...iv.linux.org.uk,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] btrfs: Don't have multiple paths to error out in btrfs_file_llseek
Using multiple paths seems to invite overlooking one when adding new
stuff in the future.
Signed-of-by: Andres Freund <andres@...razel.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists