summaryrefslogtreecommitdiffstats
path: root/fs/nfs/objlayout
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2012-06-08 05:29:40 +0300
committerBoaz Harrosh <bharrosh@panasas.com>2012-07-20 11:50:30 +0300
commit9909d45a8557455ca5f8ee7af0f253debc851f1a (patch)
treee1c60f1bdc4ecedf8d6c50bbede7ff05035d3a56 /fs/nfs/objlayout
parent537632e0a54a5355cdd0330911d18c3b773f9cf7 (diff)
downloadop-kernel-dev-9909d45a8557455ca5f8ee7af0f253debc851f1a.zip
op-kernel-dev-9909d45a8557455ca5f8ee7af0f253debc851f1a.tar.gz
pnfs-obj: don't leak objio_state if ore_write/read fails
[Bug since 3.2 Kernel] CC: Stable Tree <stable@kernel.org> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Diffstat (limited to 'fs/nfs/objlayout')
-rw-r--r--fs/nfs/objlayout/objio_osd.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c
index b47277ba..86d7595 100644
--- a/fs/nfs/objlayout/objio_osd.c
+++ b/fs/nfs/objlayout/objio_osd.c
@@ -454,7 +454,10 @@ int objio_read_pagelist(struct nfs_read_data *rdata)
objios->ios->done = _read_done;
dprintk("%s: offset=0x%llx length=0x%x\n", __func__,
rdata->args.offset, rdata->args.count);
- return ore_read(objios->ios);
+ ret = ore_read(objios->ios);
+ if (unlikely(ret))
+ objio_free_result(&objios->oir);
+ return ret;
}
/*
@@ -539,8 +542,10 @@ int objio_write_pagelist(struct nfs_write_data *wdata, int how)
dprintk("%s: offset=0x%llx length=0x%x\n", __func__,
wdata->args.offset, wdata->args.count);
ret = ore_write(objios->ios);
- if (unlikely(ret))
+ if (unlikely(ret)) {
+ objio_free_result(&objios->oir);
return ret;
+ }
if (objios->sync)
_write_done(objios->ios, objios);
OpenPOWER on IntegriCloud