diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2011-10-23 10:07:20 +0200 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2011-11-02 18:34:50 +0100 |
commit | 9294657fb966c685cf6a99f4bbe73a91eb2b8f3c (patch) | |
tree | 4bc1f26c41b140d83b547f6c0509c63caff64363 | |
parent | d83caf3f072d1f13464d96368422519053a3fe28 (diff) | |
download | fuse-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-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/fuse_lowlevel.c | 11 |
2 files changed, 18 insertions, 0 deletions
@@ -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; } |