From: Miklos S. <mi...@sz...> - 2006-06-27 11:15:24
|
> I'm trying to use FUSE to display the contents of a file as a directory. > I can change 'struct stat::st_mode' from the getattr file operation, > and it works fine. The problem is that I want to use setxattr to control > the way that getattr behaves. If I /usr/bin/stat the file immediately > after calling /usr/bin/setfattr, it looks like the old attributes are > taken from a cache somewhere. I've tried setting the attr_timeout option > to 0, but it makes no difference. How can I invalidate the attribute > cache from within my setattr file operation? Can you try the following patch? It looks like the attr_timeout == 0 case is buggy. Thanks, Miklos Index: kernel/dir.c =================================================================== RCS file: /cvsroot/fuse/fuse/kernel/dir.c,v retrieving revision 1.104 diff -u -r1.104 dir.c --- kernel/dir.c 12 Apr 2006 10:41:50 -0000 1.104 +++ kernel/dir.c 27 Jun 2006 11:13:57 -0000 @@ -31,8 +31,11 @@ */ static unsigned long time_to_jiffies(unsigned long sec, unsigned long nsec) { - struct timespec ts = {sec, nsec}; - return jiffies + timespec_to_jiffies(&ts); + if (sec || nsec) { + struct timespec ts = {sec, nsec}; + return jiffies + timespec_to_jiffies(&ts); + } else + return jiffies - 1; } /* |