autofs: use __kernel_write() for the autofs pipe writing
Changes
2 files changed · +9 −1
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| fs/autofs/waitq.c | modified | +1 | −1 | View file |
| fs/read_write.c | modified | +8 | −0 | View file |
fs/autofs/waitq.c
View filediff --git a/fs/autofs/waitq.c b/fs/autofs/waitq.c
index 74c886f..5ced859 100644
--- a/fs/autofs/waitq.c
+++ b/fs/autofs/waitq.c
@@ -53,7 +53,7 @@ static int autofs_write(struct autofs_sb_info *sbi,
mutex_lock(&sbi->pipe_mutex);
while (bytes) {
- wr = kernel_write(file, data, bytes, &file->f_pos);
+ wr = __kernel_write(file, data, bytes, NULL);
if (wr <= 0)
break;
data += wr;
fs/read_write.c
View filediff --git a/fs/read_write.c b/fs/read_write.c
index 5db58b8..d342818 100644
--- a/fs/read_write.c
+++ b/fs/read_write.c
@@ -538,6 +538,14 @@ ssize_t __kernel_write(struct file *file, const void *buf, size_t count, loff_t
inc_syscw(current);
return ret;
}
+/*
+ * This "EXPORT_SYMBOL_GPL()" is more of a "EXPORT_SYMBOL_DONTUSE()",
+ * but autofs is one of the few internal kernel users that actually
+ * wants this _and_ can be built as a module. So we need to export
+ * this symbol for autofs, even though it really isn't appropriate
+ * for any other kernel modules.
+ */
+EXPORT_SYMBOL_GPL(__kernel_write);
ssize_t kernel_write(struct file *file, const void *buf, size_t count,
loff_t *pos)