Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse

Pull fuse fixes from Miklos Szeredi:
"This fixes bugs in zero-copy splice to the fuse device"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
fuse: explicitly set /dev/fuse file's private_data
fuse: set stolen page uptodate
fuse: notify: don't move pages

+17 -2
+17 -2
fs/fuse/dev.c
··· 890 890 891 891 newpage = buf->page; 892 892 893 - if (WARN_ON(!PageUptodate(newpage))) 894 - return -EIO; 893 + if (!PageUptodate(newpage)) 894 + SetPageUptodate(newpage); 895 895 896 896 ClearPageMappedToDisk(newpage); 897 897 ··· 1353 1353 return err; 1354 1354 } 1355 1355 1356 + static int fuse_dev_open(struct inode *inode, struct file *file) 1357 + { 1358 + /* 1359 + * The fuse device's file's private_data is used to hold 1360 + * the fuse_conn(ection) when it is mounted, and is used to 1361 + * keep track of whether the file has been mounted already. 1362 + */ 1363 + file->private_data = NULL; 1364 + return 0; 1365 + } 1366 + 1356 1367 static ssize_t fuse_dev_read(struct kiocb *iocb, const struct iovec *iov, 1357 1368 unsigned long nr_segs, loff_t pos) 1358 1369 { ··· 1808 1797 static int fuse_notify(struct fuse_conn *fc, enum fuse_notify_code code, 1809 1798 unsigned int size, struct fuse_copy_state *cs) 1810 1799 { 1800 + /* Don't try to move pages (yet) */ 1801 + cs->move_pages = 0; 1802 + 1811 1803 switch (code) { 1812 1804 case FUSE_NOTIFY_POLL: 1813 1805 return fuse_notify_poll(fc, size, cs); ··· 2231 2217 2232 2218 const struct file_operations fuse_dev_operations = { 2233 2219 .owner = THIS_MODULE, 2220 + .open = fuse_dev_open, 2234 2221 .llseek = no_llseek, 2235 2222 .read = do_sync_read, 2236 2223 .aio_read = fuse_dev_read,