diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2006-06-25 05:48:52 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 10:01:19 -0700 |
commit | 33649c91a3df57c1090a657637d44b896de367e7 (patch) | |
tree | 1ee4871a65f2b37a931c796463eb39737a32cbaa /fs/fuse/fuse_i.h | |
parent | 7142125937e1482ad3ae4366594c6586153dfc86 (diff) | |
download | lwn-33649c91a3df57c1090a657637d44b896de367e7.tar.gz lwn-33649c91a3df57c1090a657637d44b896de367e7.zip |
[PATCH] fuse: ensure FLUSH reaches userspace
All POSIX locks owned by the current task are removed on close(). If the
FLUSH request resulting initiated by close() fails to reach userspace, there
might be locks remaining, which cannot be removed.
The only reason it could fail, is if allocating the request fails. In this
case use the request reserved for RELEASE, or if that is currently used by
another FLUSH, wait for it to become available.
Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/fuse/fuse_i.h')
-rw-r--r-- | fs/fuse/fuse_i.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index eb3166625ca9..f7c74516f3a6 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -65,7 +65,7 @@ struct fuse_inode { /** FUSE specific file data */ struct fuse_file { /** Request reserved for flush and release */ - struct fuse_req *release_req; + struct fuse_req *reserved_req; /** File handle used by userspace */ u64 fh; @@ -213,6 +213,9 @@ struct fuse_req { /** Request completion callback */ void (*end)(struct fuse_conn *, struct fuse_req *); + + /** Request is stolen from fuse_file->reserved_req */ + struct file *stolen_file; }; /** @@ -456,11 +459,16 @@ struct fuse_req *fuse_request_alloc(void); void fuse_request_free(struct fuse_req *req); /** - * Reserve a preallocated request + * Get a request, may fail with -ENOMEM */ struct fuse_req *fuse_get_req(struct fuse_conn *fc); /** + * Gets a requests for a file operation, always succeeds + */ +struct fuse_req *fuse_get_req_nofail(struct fuse_conn *fc, struct file *file); + +/** * Decrement reference count of a request. If count goes to zero free * the request. */ |