summaryrefslogtreecommitdiff
path: root/fs/nfs
diff options
context:
space:
mode:
authorBoaz Harrosh <bharrosh@panasas.com>2012-06-08 05:29:40 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-29 08:04:20 -0700
commit08603bdd6b0b65248921c8be05febe574dd78905 (patch)
treee6703ffb7dd6035873999099cbb9e804ba7e9042 /fs/nfs
parentf6ecbea43e774dfc0b3678d2cdda9d4b43cfecf8 (diff)
downloadlinux-3.10-08603bdd6b0b65248921c8be05febe574dd78905.tar.gz
linux-3.10-08603bdd6b0b65248921c8be05febe574dd78905.tar.bz2
linux-3.10-08603bdd6b0b65248921c8be05febe574dd78905.zip
pnfs-obj: don't leak objio_state if ore_write/read fails
commit 9909d45a8557455ca5f8ee7af0f253debc851f1a upstream. [Bug since 3.2 Kernel] Signed-off-by: Boaz Harrosh <bharrosh@panasas.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/nfs')
-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 4bff4a3dab4..42ac1bf6fcc 100644
--- a/fs/nfs/objlayout/objio_osd.c
+++ b/fs/nfs/objlayout/objio_osd.c
@@ -453,7 +453,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;
}
/*
@@ -537,8 +540,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);