mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
[PATCH] fuse: fix error case in fuse_readpages
Don't let fuse_readpages leave the @pages list not empty when exiting on error. [[email protected]: kernel-doc fixes] Signed-off-by: Alexander Zarochentsev <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
9b41ea7289
commit
1d7ea7324a
3 changed files with 29 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue