Skip to contentSkip to conversation

Patch "ceph: Correctly return NXIO errors from ceph_llseek" has been added to the 4.7-stable tree

PATCH [email protected] 1 participant 1 message Sep 28, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

ceph: Correctly return NXIO errors from ceph_llseek

to the 4.7-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
ceph-correctly-return-nxio-errors-from-ceph_llseek.patch
and it can be found in the queue-4.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From 955818cd5b6c4b58ea574ace4573e7afa4c19c1e Mon Sep 17 00:00:00 2001

From: Phil Turnbull <[email protected]>
Date: Thu, 21 Jul 2016 13:43:09 -0400
Subject: ceph: Correctly return NXIO errors from ceph_llseek

From: Phil Turnbull <[email protected]>

commit 955818cd5b6c4b58ea574ace4573e7afa4c19c1e upstream.

ceph_llseek does not correctly return NXIO errors because the 'out' path always returns 'offset'.

Fixes 06222e491e66 ("fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek")
---
 fs/ceph/file.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
fs/ceph/file.c +5 -7
@@ -1448,16 +1448,14 @@ static loff_t ceph_llseek(struct file *f
 {
 	struct inode *inode = file->f_mapping->host;
 	loff_t i_size;
-	int ret;
+	loff_t ret;
 
 	inode_lock(inode);
 
 	if (whence == SEEK_END || whence == SEEK_DATA || whence == SEEK_HOLE) {
 		ret = ceph_do_getattr(inode, CEPH_STAT_CAP_SIZE, false);
-		if (ret < 0) {
-			offset = ret;
+		if (ret < 0)
 			goto out;
-		}
 	}
 
 	i_size = i_size_read(inode);
@@ -1473,7 +1471,7 @@ static loff_t ceph_llseek(struct file *f
 		 * write() or lseek() might have altered it
 		 */
 		if (offset == 0) {
-			offset = file->f_pos;
+			ret = file->f_pos;
 			goto out;
 		}
 		offset += file->f_pos;
@@ -1493,11 +1491,11 @@ static loff_t ceph_llseek(struct file *f
 		break;
 	}
 
-	offset = vfs_setpos(file, offset, inode->i_sb->s_maxbytes);
+	ret = vfs_setpos(file, offset, inode->i_sb->s_maxbytes);
 
 out:
 	inode_unlock(inode);
-	return offset;
+	return ret;
 }
 
 static inline void ceph_zero_partial_page(

Patches currently in stable-queue which might be from [email protected] are

queue-4.7/configfs-return-efbig-from-configfs_write_bin_file.patch queue-4.7/ceph-correctly-return-nxio-errors-from-ceph_llseek.patch