Skip to contentSkip to conversation

fs: Allow splicing from character device

PATCH New Rafał Hibner 1 participant 1 message Apr 26, 2020 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs: Allow splicing from character device

Splicing from character devices should be enabled. It allows for efficient (ZEROCOPY) bulk data tranfers from device.

---
 fs/splice.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/splice.c +1 -1
index 4735defc46..306d11c5ea 100644
@@ -920,7 +920,7 @@ ssize_t splice_direct_to_actor(struct file *in, struct splice_desc *sd,
 	 * piped splicing for that!
 	 */
 	i_mode = file_inode(in)->i_mode;
-	if (unlikely(!S_ISREG(i_mode) && !S_ISBLK(i_mode)))
+	if (unlikely(!S_ISREG(i_mode) && !S_ISBLK(i_mode) && !S_ISCHR(i_mode)))
 		return -EINVAL;
 
 	/*
Signature · 1 line
2.24.1