Accepting request 90036 from filesystems

handle case of failure to allocate request [bnc#723616] (forwarded request 90035 from mszeredi)

OBS-URL: https://build.opensuse.org/request/show/90036
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/fuse?expand=0&rev=46
This commit is contained in:
Stephan Kulow 2011-11-05 09:56:21 +00:00 committed by Git OBS Bridge
commit f42d396734
3 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,35 @@
From 9294657fb966c685cf6a99f4bbe73a91eb2b8f3c Mon Sep 17 00:00:00 2001
From: Miklos Szeredi <mszeredi@suse.cz>
Date: Sun, 23 Oct 2011 10:07:20 +0200
Subject: 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
---
lib/fuse_lowlevel.c | 11 +++++++++++
1 file changed, 11 insertions(+)
Index: fuse-2.8.5/lib/fuse_lowlevel.c
===================================================================
--- fuse-2.8.5.orig/lib/fuse_lowlevel.c 2010-09-28 10:03:09.000000000 +0200
+++ fuse-2.8.5/lib/fuse_lowlevel.c 2011-11-03 13:10:07.000000000 +0100
@@ -1467,7 +1467,18 @@ static void fuse_ll_process(void *data,
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;
}

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Nov 3 13:15:39 CET 2011 - mszeredi@suse.cz
- handle case of failure to allocate request [bnc#723616]
-------------------------------------------------------------------
Sat Oct 1 05:39:08 UTC 2011 - coolo@suse.com

View File

@ -33,6 +33,7 @@ Patch2: fuse-pc-remove-libdir-from-Libs.diff
Patch3: fuse-umount-race-fix.patch
Patch4: fuse-fix-cleanup-in-case-of-failed-mount.patch
Patch5: fuse-gnu_source.patch
Patch6: fuse-handle-failure-to-allocate-req.patch
Url: http://fuse.sourceforge.net
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if 0%{?suse_version} > 1130
@ -278,6 +279,7 @@ Authors:
%patch3 -p1
%patch4 -p1
%patch5
%patch6 -p1
%build
autoreconf -fiv