]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
pnfs-obj: pNFS errors are communicated on iodata->pnfs_error
authorBoaz Harrosh <bharrosh@panasas.com>
Fri, 6 Jan 2012 07:28:12 +0000 (09:28 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 26 Jan 2012 01:25:02 +0000 (17:25 -0800)
commit 5c0b4129c07b902b27d3f3ebc087757f534a3abd upstream.

Some time along the way pNFS IO errors were switched to
communicate with a special iodata->pnfs_error member instead
of the regular RPC members. But objlayout was not switched
over.

Fix that!
Without this fix any IO error is hanged, because IO is not
switched to MDS and pages are never cleared or read.

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/nfs/objlayout/objlayout.c

index 1d06f8e2adeaec53fd8dc71c4e1a9cae2baef9c3..fefa1224aff3f9d7a2ffcf86876184840207fc90 100644 (file)
@@ -294,9 +294,11 @@ objlayout_read_done(struct objlayout_io_state *state, ssize_t status, bool sync)
        dprintk("%s: Begin status=%zd eof=%d\n", __func__, status, eof);
        rdata = state->rpcdata;
        rdata->task.tk_status = status;
-       if (status >= 0) {
+       if (likely(status >= 0)) {
                rdata->res.count = status;
                rdata->res.eof = eof;
+       } else {
+               rdata->pnfs_error = status;
        }
        objlayout_iodone(state);
        /* must not use state after this point */
@@ -380,15 +382,17 @@ objlayout_write_done(struct objlayout_io_state *state, ssize_t status,
        wdata = state->rpcdata;
        state->status = status;
        wdata->task.tk_status = status;
-       if (status >= 0) {
+       if (likely(status >= 0)) {
                wdata->res.count = status;
                wdata->verf.committed = state->committed;
                dprintk("%s: Return status %d committed %d\n",
                        __func__, wdata->task.tk_status,
                        wdata->verf.committed);
-       } else
+       } else {
+               wdata->pnfs_error = status;
                dprintk("%s: Return status %d\n",
                        __func__, wdata->task.tk_status);
+       }
        objlayout_iodone(state);
        /* must not use state after this point */