summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2011-10-23 10:07:20 +0200
committerMiklos Szeredi <mszeredi@suse.cz>2011-11-02 18:34:50 +0100
commit9294657fb966c685cf6a99f4bbe73a91eb2b8f3c (patch)
tree4bc1f26c41b140d83b547f6c0509c63caff64363
parentd83caf3f072d1f13464d96368422519053a3fe28 (diff)
downloadfuse-9294657fb966c685cf6a99f4bbe73a91eb2b8f3c.tar.gz
Reply with ENOMEM in case of failure to allocate request
Reply to request with ENOMEM in case of failure to allocate request structure. Otherwise the task issuing the request will just freeze up until the filesystem daemon is killed. Reported by Stephan Kulow
-rw-r--r--ChangeLog7
-rw-r--r--lib/fuse_lowlevel.c11
2 files changed, 18 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 4be41e3..77a9b9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-10-13 Miklos Szeredi <miklos@szeredi.hu>
+
+ * Reply to request with ENOMEM in case of failure to allocate
+ request structure. Otherwise the task issuing the request will
+ just freeze up until the filesystem daemon is killed. Reported by
+ Stephan Kulow
+
2011-09-13 Miklos Szeredi <miklos@szeredi.hu>
* Released 2.8.6
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c
index c519bfb..c86a910 100644
--- a/lib/fuse_lowlevel.c
+++ b/lib/fuse_lowlevel.c
@@ -1467,7 +1467,18 @@ static void fuse_ll_process(void *data, const char *buf, size_t len,
req = (struct fuse_req *) calloc(1, sizeof(struct fuse_req));
if (req == NULL) {
+ struct fuse_out_header out = {
+ .unique = in->unique,
+ .error = -ENOMEM,
+ .len = sizeof(struct fuse_out_header),
+ };
+ struct iovec iov = {
+ .iov_base = &out,
+ .iov_len = sizeof(struct fuse_out_header),
+ };
+
fprintf(stderr, "fuse: failed to allocate request\n");
+ fuse_chan_send(ch, &iov, 1);
return;
}