Skip to content
Browse files

fix

  • Loading branch information...
1 parent f4f8b89 commit 72f6a93d1bfdab2a325914e4c95a379d02090970 @szmi szmi committed Jan 29, 2004
Showing with 21 additions and 7 deletions.
  1. +4 −0 ChangeLog
  2. +17 −7 kernel/dev.c
View
4 ChangeLog
@@ -1,3 +1,7 @@
+2004-01-29 Miklos Szeredi <mszeredi@inf.bme.hu>
+
+ * Properly check if the inode exists in fuse_invalidate
+
2004-01-27 Miklos Szeredi <mszeredi@inf.bme.hu>
* Added -q option for fusermount
View
24 kernel/dev.c
@@ -410,21 +410,31 @@ static inline int copy_out_header(struct fuse_out_header *oh, const char *buf,
return 0;
}
+#ifdef KERNEL_2_6
static int fuse_invalidate(struct fuse_conn *fc, struct fuse_user_header *uh)
{
- struct inode *inode = iget(fc->sb, uh->ino);
+ struct inode *inode = ilookup(fc->sb, uh->ino);
if (!inode)
return -ENOENT;
-
-#ifdef KERNEL_2_6
invalidate_inode_pages(inode->i_mapping);
-#else
- invalidate_inode_pages(inode);
-#endif
-
iput(inode);
return 0;
}
+#else
+static int fuse_invalidate(struct fuse_conn *fc, struct fuse_user_header *uh)
+{
+ struct inode *inode = iget(fc->sb, uh->ino);
+ int err = -ENOENT;
+ if(inode) {
+ if(inode->u.generic_ip) {
+ invalidate_inode_pages(inode);
+ err = 0;
+ }
+ iput(inode);
+ }
+ return err;
+}
+#endif
static int fuse_user_request(struct fuse_conn *fc, const char *buf,
size_t nbytes)

0 comments on commit 72f6a93

Please sign in to comment.
Something went wrong with that request. Please try again.