Skip to contentSkip to conversation

two simple but important clones fixes

PATCH New Christoph Hellwig 1 participant 3 messages Nov 11, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Two trivial fixes for CLONE for the 4.4 queue. I have another one to allow same file clones, but we'll need to finalize the language for that in the NFSv4 WG first.

#1 lore raw

PATCH 1/2 nfs: pass on count for CLONE operations

Currently we pass uninitialized stack garbage in the count parameter. The value is usually large enought to clone whole files and thus let simple tests pass, but it makes the tests for range clones very unhappy.

---
 fs/nfs/nfs42proc.c | 1 +
 1 file changed, 1 insertion(+)
fs/nfs/nfs42proc.c +1 -0
index 3e92a3c..303d22e 100644
@@ -284,6 +284,7 @@ static int _nfs42_proc_clone(struct rpc_message *msg, struct file *src_f,
 		.dst_fh = NFS_FH(dst_inode),
 		.src_offset = src_offset,
 		.dst_offset = dst_offset,
+		.count = count,
 		.dst_bitmask = server->cache_consistency_bitmask,
 	};
 	struct nfs42_clone_res res = {
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/2 nfs: offer native ioctls even if CONFIG_COMPAT is set

In reply to Christoph Hellwig

Without this for example 64-bit binaries on typical amd64 distributions would not be able to use ioctls on NFS. For now this only affects clones.

---
 fs/nfs/nfs4file.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
fs/nfs/nfs4file.c +1 -2
index 4aa5719..7f72505 100644
@@ -347,9 +347,8 @@ const struct file_operations nfs4_file_operations = {
 #endif /* CONFIG_NFS_V4_2 */
 	.check_flags	= nfs_check_flags,
 	.setlease	= simple_nosetlease,
-#ifdef CONFIG_COMPAT
 	.unlocked_ioctl = nfs4_ioctl,
-#else
+#ifdef CONFIG_COMPAT
 	.compat_ioctl	= nfs4_ioctl,
 #endif /* CONFIG_COMPAT */
 };
Signature · 1 line
1.9.1