Commit d447d0da authored by Fabian Frederick's avatar Fabian Frederick Committed by Chris Mason

Btrfs: fix sparse warning

Fix the following sparse warning:
fs/btrfs/send.c:518:51: warning: incorrect type in argument 2 (different address spaces)
fs/btrfs/send.c:518:51:    expected char const [noderef] <asn:1>*<noident>
fs/btrfs/send.c:518:51:    got char *

We can safely use (const char __user *) with set_fs(KERNEL_DS)

__force added to avoid sparse-all warning:
fs/btrfs/send.c:518:40: warning: cast adds address space to expression (<asn:1>)
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Reviewed-by: default avatarZach Brown <zab@zabbo.net>
Signed-off-by: default avatarChris Mason <clm@fb.com>
parent 14586651
......@@ -515,7 +515,8 @@ static int write_buf(struct file *filp, const void *buf, u32 len, loff_t *off)
set_fs(KERNEL_DS);
while (pos < len) {
ret = vfs_write(filp, (char *)buf + pos, len - pos, off);
ret = vfs_write(filp, (__force const char __user *)buf + pos,
len - pos, off);
/* TODO handle that correctly */
/*if (ret == -ERESTARTSYS) {
continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment