diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-09 12:18:23 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-09 12:18:23 -0400 |
commit | 16d70e15295953b19ecf59e943723a181782b856 (patch) | |
tree | 3d8cc1991b02ed703dc551c5558452b5c5f462f5 /fs/fuse/dir.c | |
parent | 6c337ad6cccf3365c89152896217be9d953121c6 (diff) | |
parent | 05726acabef10faffcbc400c109ddb6c9d7560e4 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse
Pull fuse bugfixes from Miklos Szeredi:
"Just a bunch of bugfixes"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
fuse: use list_for_each_entry() for list traversing
fuse: readdir: check for slash in names
fuse: hotfix truncate_pagecache() issue
fuse: invalidate inode attributes on xattr modification
fuse: postpone end_page_writeback() in fuse_writepage_locked()
Diffstat (limited to 'fs/fuse/dir.c')
-rw-r--r-- | fs/fuse/dir.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 0e6961aae6c0..3ac91086f41f 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c | |||
@@ -1177,6 +1177,8 @@ static int parse_dirfile(char *buf, size_t nbytes, struct file *file, | |||
1177 | return -EIO; | 1177 | return -EIO; |
1178 | if (reclen > nbytes) | 1178 | if (reclen > nbytes) |
1179 | break; | 1179 | break; |
1180 | if (memchr(dirent->name, '/', dirent->namelen) != NULL) | ||
1181 | return -EIO; | ||
1180 | 1182 | ||
1181 | if (!dir_emit(ctx, dirent->name, dirent->namelen, | 1183 | if (!dir_emit(ctx, dirent->name, dirent->namelen, |
1182 | dirent->ino, dirent->type)) | 1184 | dirent->ino, dirent->type)) |
@@ -1315,6 +1317,8 @@ static int parse_dirplusfile(char *buf, size_t nbytes, struct file *file, | |||
1315 | return -EIO; | 1317 | return -EIO; |
1316 | if (reclen > nbytes) | 1318 | if (reclen > nbytes) |
1317 | break; | 1319 | break; |
1320 | if (memchr(dirent->name, '/', dirent->namelen) != NULL) | ||
1321 | return -EIO; | ||
1318 | 1322 | ||
1319 | if (!over) { | 1323 | if (!over) { |
1320 | /* We fill entries into dstbuf only as much as | 1324 | /* We fill entries into dstbuf only as much as |
@@ -1585,6 +1589,7 @@ int fuse_do_setattr(struct inode *inode, struct iattr *attr, | |||
1585 | struct file *file) | 1589 | struct file *file) |
1586 | { | 1590 | { |
1587 | struct fuse_conn *fc = get_fuse_conn(inode); | 1591 | struct fuse_conn *fc = get_fuse_conn(inode); |
1592 | struct fuse_inode *fi = get_fuse_inode(inode); | ||
1588 | struct fuse_req *req; | 1593 | struct fuse_req *req; |
1589 | struct fuse_setattr_in inarg; | 1594 | struct fuse_setattr_in inarg; |
1590 | struct fuse_attr_out outarg; | 1595 | struct fuse_attr_out outarg; |
@@ -1612,8 +1617,10 @@ int fuse_do_setattr(struct inode *inode, struct iattr *attr, | |||
1612 | if (IS_ERR(req)) | 1617 | if (IS_ERR(req)) |
1613 | return PTR_ERR(req); | 1618 | return PTR_ERR(req); |
1614 | 1619 | ||
1615 | if (is_truncate) | 1620 | if (is_truncate) { |
1616 | fuse_set_nowrite(inode); | 1621 | fuse_set_nowrite(inode); |
1622 | set_bit(FUSE_I_SIZE_UNSTABLE, &fi->state); | ||
1623 | } | ||
1617 | 1624 | ||
1618 | memset(&inarg, 0, sizeof(inarg)); | 1625 | memset(&inarg, 0, sizeof(inarg)); |
1619 | memset(&outarg, 0, sizeof(outarg)); | 1626 | memset(&outarg, 0, sizeof(outarg)); |
@@ -1675,12 +1682,14 @@ int fuse_do_setattr(struct inode *inode, struct iattr *attr, | |||
1675 | invalidate_inode_pages2(inode->i_mapping); | 1682 | invalidate_inode_pages2(inode->i_mapping); |
1676 | } | 1683 | } |
1677 | 1684 | ||
1685 | clear_bit(FUSE_I_SIZE_UNSTABLE, &fi->state); | ||
1678 | return 0; | 1686 | return 0; |
1679 | 1687 | ||
1680 | error: | 1688 | error: |
1681 | if (is_truncate) | 1689 | if (is_truncate) |
1682 | fuse_release_nowrite(inode); | 1690 | fuse_release_nowrite(inode); |
1683 | 1691 | ||
1692 | clear_bit(FUSE_I_SIZE_UNSTABLE, &fi->state); | ||
1684 | return err; | 1693 | return err; |
1685 | } | 1694 | } |
1686 | 1695 | ||
@@ -1744,6 +1753,8 @@ static int fuse_setxattr(struct dentry *entry, const char *name, | |||
1744 | fc->no_setxattr = 1; | 1753 | fc->no_setxattr = 1; |
1745 | err = -EOPNOTSUPP; | 1754 | err = -EOPNOTSUPP; |
1746 | } | 1755 | } |
1756 | if (!err) | ||
1757 | fuse_invalidate_attr(inode); | ||
1747 | return err; | 1758 | return err; |
1748 | } | 1759 | } |
1749 | 1760 | ||
@@ -1873,6 +1884,8 @@ static int fuse_removexattr(struct dentry *entry, const char *name) | |||
1873 | fc->no_removexattr = 1; | 1884 | fc->no_removexattr = 1; |
1874 | err = -EOPNOTSUPP; | 1885 | err = -EOPNOTSUPP; |
1875 | } | 1886 | } |
1887 | if (!err) | ||
1888 | fuse_invalidate_attr(inode); | ||
1876 | return err; | 1889 | return err; |
1877 | } | 1890 | } |
1878 | 1891 | ||