]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
pnfs-obj: don't leak objio_state if ore_write/read fails
authorBoaz Harrosh <bharrosh@panasas.com>
Fri, 8 Jun 2012 02:29:40 +0000 (05:29 +0300)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 25 Jul 2012 03:11:30 +0000 (04:11 +0100)
commit 9909d45a8557455ca5f8ee7af0f253debc851f1a upstream.

[Bug since 3.2 Kernel]
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/nfs/objlayout/objio_osd.c

index 55d01280a6098264cc5e6d7133c72347e392d109..0e7b3fcf0b1e35d3cc736348a854256060e16ff4 100644 (file)
@@ -433,7 +433,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;
 }
 
 /*
@@ -517,8 +520,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);