From: Miklos Szeredi Date: Sun, 23 Oct 2011 08:07:20 +0000 (+0200) Subject: Reply with ENOMEM in case of failure to allocate request X-Git-Tag: fuse_2_8_7~5 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=9294657fb966c685cf6a99f4bbe73a91eb2b8f3c;p=qemu-gpiodev%2Flibfuse.git 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 --- diff --git a/ChangeLog b/ChangeLog index 4be41e3..77a9b9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-10-13 Miklos Szeredi + + * 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 * 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; }