Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix

  • Loading branch information...
commit 72f6a93d1bfdab2a325914e4c95a379d02090970 1 parent f4f8b89
Miklos Szeredi authored

Showing 2 changed files with 21 additions and 7 deletions. Show diff stats Hide diff stats

  1. +4 0 ChangeLog
  2. +17 7 kernel/dev.c
4 ChangeLog
... ... @@ -1,3 +1,7 @@
  1 +2004-01-29 Miklos Szeredi <mszeredi@inf.bme.hu>
  2 +
  3 + * Properly check if the inode exists in fuse_invalidate
  4 +
1 5 2004-01-27 Miklos Szeredi <mszeredi@inf.bme.hu>
2 6
3 7 * Added -q option for fusermount
24 kernel/dev.c
@@ -410,21 +410,31 @@ static inline int copy_out_header(struct fuse_out_header *oh, const char *buf,
410 410 return 0;
411 411 }
412 412
  413 +#ifdef KERNEL_2_6
413 414 static int fuse_invalidate(struct fuse_conn *fc, struct fuse_user_header *uh)
414 415 {
415   - struct inode *inode = iget(fc->sb, uh->ino);
  416 + struct inode *inode = ilookup(fc->sb, uh->ino);
416 417 if (!inode)
417 418 return -ENOENT;
418   -
419   -#ifdef KERNEL_2_6
420 419 invalidate_inode_pages(inode->i_mapping);
421   -#else
422   - invalidate_inode_pages(inode);
423   -#endif
424   -
425 420 iput(inode);
426 421 return 0;
427 422 }
  423 +#else
  424 +static int fuse_invalidate(struct fuse_conn *fc, struct fuse_user_header *uh)
  425 +{
  426 + struct inode *inode = iget(fc->sb, uh->ino);
  427 + int err = -ENOENT;
  428 + if(inode) {
  429 + if(inode->u.generic_ip) {
  430 + invalidate_inode_pages(inode);
  431 + err = 0;
  432 + }
  433 + iput(inode);
  434 + }
  435 + return err;
  436 +}
  437 +#endif
428 438
429 439 static int fuse_user_request(struct fuse_conn *fc, const char *buf,
430 440 size_t nbytes)

0 comments on commit 72f6a93

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