From patchwork Tue Jun 14 21:03:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Boaz Harrosh X-Patchwork-Id: 880142 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5EL25Mj011700 for ; Tue, 14 Jun 2011 21:03:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752540Ab1FNVDl (ORCPT ); Tue, 14 Jun 2011 17:03:41 -0400 Received: from daytona.panasas.com ([67.152.220.89]:36616 "EHLO daytona.panasas.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753958Ab1FNVDk (ORCPT ); Tue, 14 Jun 2011 17:03:40 -0400 Received: from yafyuf.citi.umich.edu ([172.17.33.117]) by daytona.panasas.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 14 Jun 2011 17:03:39 -0400 From: Boaz Harrosh To: Benny Halevy , open-osd , NFS list Subject: [PATCH 8/8] pnfsd-exofs: layoutreturn pnfs-obj information decoding Date: Tue, 14 Jun 2011 17:03:39 -0400 Message-Id: <1308085419-12686-1-git-send-email-bharrosh@panasas.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <4DF7CA2F.7030407@panasas.com> References: <4DF7CA2F.7030407@panasas.com> X-OriginalArrivalTime: 14 Jun 2011 21:03:39.0772 (UTC) FILETIME=[890ED3C0:01CC2AD6] Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Tue, 14 Jun 2011 21:03:41 +0000 (UTC) Use pnfs_osd_xdr_decode_ioerr() in exofs_layout_return, and print the received errors. TODO: Call exofs_file_recovery() on errors that need it. (When it's implemented) Signed-off-by: Boaz Harrosh --- fs/exofs/export.c | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/fs/exofs/export.c b/fs/exofs/export.c index c0705df..8281c85 100644 --- a/fs/exofs/export.c +++ b/fs/exofs/export.c @@ -229,11 +229,31 @@ static int exofs_layout_commit( return 0; } +static void exofs_handle_error(struct pnfs_osd_ioerr *ioerr) +{ + EXOFS_ERR("exofs_handle_error: errno=%d is_write=%d obj=0x%llx " + "offset=0x%llx length=0x%llx\n", + ioerr->oer_errno, ioerr->oer_iswrite, + _LLU(ioerr->oer_component.oid_object_id), + _LLU(ioerr->oer_comp_offset), + _LLU(ioerr->oer_comp_length)); +} + static int exofs_layout_return( struct inode *inode, const struct nfsd4_pnfs_layoutreturn_arg *args) { - /* TODO: Decode the pnfs_osd_ioerr if lrf_body_len > 0 */ + struct exp_xdr_stream xdr = { + .p = args->lrf_body, + .end = args->lrf_body + exp_xdr_qwords(args->lrf_body_len), + }; + struct pnfs_osd_ioerr ioerr; + + EXOFS_DBGMSG("(0x%lx) cookie %p body_len %d\n", + inode->i_ino, args->lr_cookie, args->lrf_body_len); + + while (pnfs_osd_xdr_decode_ioerr(&ioerr, &xdr)) + exofs_handle_error(&ioerr); if (args->lr_cookie) { struct exofs_i_info *oi = exofs_i(inode);