kernel-fxtec-pro1x/fs/fuse
Miklos Szeredi 1fb69e7817 fuse: fix race between getattr and write
Getattr and lookup operations can be running in parallel to attribute changing
operations, such as write and setattr.

This means, that if for example getattr was slower than a write, the cached
size attribute could be set to a stale value.

To prevent this race, introduce a per-filesystem attribute version counter.
This counter is incremented whenever cached attributes are modified, and the
incremented value stored in the inode.

Before storing new attributes in the cache, getattr and lookup check, using
the version number, whether the attributes have been modified during the
request's lifetime.  If so, the returned attributes are not cached, because
they might be stale.

Thanks to Jakub Bogusz for the bug report and test program.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Cc: Jakub Bogusz <jakub.bogusz@gemius.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-18 14:37:30 -07:00
..
control.c [PATCH] mark struct inode_operations const 1 2007-02-12 09:48:46 -08:00
dev.c fuse: no ENOENT from fuse device read 2007-10-17 08:43:04 -07:00
dir.c fuse: fix race between getattr and write 2007-10-18 14:37:30 -07:00
file.c fuse: fix race between getattr and write 2007-10-18 14:37:30 -07:00
fuse_i.h fuse: fix race between getattr and write 2007-10-18 14:37:30 -07:00
inode.c fuse: fix race between getattr and write 2007-10-18 14:37:30 -07:00
Makefile [PATCH] fuse: add control filesystem 2006-06-25 10:01:19 -07:00