diff options
author | attilio <attilio@FreeBSD.org> | 2012-11-08 00:32:49 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2012-11-08 00:32:49 +0000 |
commit | 1e93fc5eebeddeb9b55367b7dbe1cfd50b731fbe (patch) | |
tree | d1e3110effbc60ea33841aa63c836e4e9dfbb12f /sys/fs/fuse/fuse_node.c | |
parent | a60f06157e6e44ea0691467709b746037e6111c2 (diff) | |
download | FreeBSD-src-1e93fc5eebeddeb9b55367b7dbe1cfd50b731fbe.zip FreeBSD-src-1e93fc5eebeddeb9b55367b7dbe1cfd50b731fbe.tar.gz |
- Current caching mode is completely broken because it simply relies
on timing of the operations and not real lookup, bringing too many
false positives. Remove the whole mechanism. If it needs to be
implemented, next time it should really be done in the proper way.
- Fix VOP_GETATTR() in order to cope with userland bugs that would
change the type of file and not panic. Instead it gets the entry as
if it is not existing.
Reported and tested by: flo
MFC after: 2 months
X-MFC: 241519, 242536,242616
Diffstat (limited to 'sys/fs/fuse/fuse_node.c')
-rw-r--r-- | sys/fs/fuse/fuse_node.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/sys/fs/fuse/fuse_node.c b/sys/fs/fuse/fuse_node.c index a77082e..ea10c96 100644 --- a/sys/fs/fuse/fuse_node.c +++ b/sys/fs/fuse/fuse_node.c @@ -283,16 +283,6 @@ fuse_vnode_open(struct vnode *vp, int32_t fuse_open_flags, struct thread *td) } int -fuse_isvalid_attr(struct vnode *vp) -{ - struct fuse_vnode_data *fvdat = VTOFUD(vp); - struct timespec uptsp; - - nanouptime(&uptsp); - return fuse_timespec_cmp(&uptsp, &fvdat->cached_attrs_valid, <=); -} - -int fuse_vnode_savesize(struct vnode *vp, struct ucred *cred) { struct fuse_vnode_data *fvdat = VTOFUD(vp); @@ -337,8 +327,6 @@ fuse_vnode_savesize(struct vnode *vp, struct ucred *cred) if (err == 0) fvdat->flag &= ~FN_SIZECHANGE; - fuse_invalidate_attr(vp); - return err; } @@ -350,8 +338,7 @@ fuse_vnode_refreshsize(struct vnode *vp, struct ucred *cred) struct vattr va; if ((fvdat->flag & FN_SIZECHANGE) != 0 || - (fuse_refresh_size == 0 && fvdat->filesize != 0) || - fuse_isvalid_attr(vp)) + (fuse_refresh_size == 0 && fvdat->filesize != 0)) return; VOP_GETATTR(vp, &va, cred); @@ -378,7 +365,5 @@ fuse_vnode_setsize(struct vnode *vp, struct ucred *cred, off_t newsize) err = vtruncbuf(vp, cred, newsize, fuse_iosize(vp)); } vnode_pager_setsize(vp, newsize); - fuse_invalidate_attr(vp); - return err; } |