summaryrefslogtreecommitdiffstats
path: root/fs/fuse
diff options
context:
space:
mode:
authorAlexander Zarochentsev <zam@namesys.com>2006-08-13 23:24:27 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2006-08-14 12:54:29 -0700
commit1d7ea7324ae7a59f8e17e4ba76a2707c1e6f24d2 (patch)
tree902b646ed70af86481a77a67582b79e67264a481 /fs/fuse
parent9b41ea7289a589993d3daabc61f999b4147872c4 (diff)
downloadop-kernel-dev-1d7ea7324ae7a59f8e17e4ba76a2707c1e6f24d2.zip
op-kernel-dev-1d7ea7324ae7a59f8e17e4ba76a2707c1e6f24d2.tar.gz
[PATCH] fuse: fix error case in fuse_readpages
Don't let fuse_readpages leave the @pages list not empty when exiting on error. [akpm@osdl.org: kernel-doc fixes] Signed-off-by: Alexander Zarochentsev <zam@namesys.com> Signed-off-by: Miklos Szeredi <miklos@szeredi.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/fuse')
-rw-r--r--fs/fuse/file.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 63614ed..5c4fcd1 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -395,14 +395,16 @@ static int fuse_readpages(struct file *file, struct address_space *mapping,
struct fuse_readpages_data data;
int err;
+ err = -EIO;
if (is_bad_inode(inode))
- return -EIO;
+ goto clean_pages_up;
data.file = file;
data.inode = inode;
data.req = fuse_get_req(fc);
+ err = PTR_ERR(data.req);
if (IS_ERR(data.req))
- return PTR_ERR(data.req);
+ goto clean_pages_up;
err = read_cache_pages(mapping, pages, fuse_readpages_fill, &data);
if (!err) {
@@ -412,6 +414,10 @@ static int fuse_readpages(struct file *file, struct address_space *mapping,
fuse_put_request(fc, data.req);
}
return err;
+
+clean_pages_up:
+ put_pages_list(pages);
+ return err;
}
static size_t fuse_send_write(struct fuse_req *req, struct file *file,
OpenPOWER on IntegriCloud