From patchwork Thu Aug 9 18:05:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Schumaker X-Patchwork-Id: 1302631 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 06D8C3FD8D for ; Thu, 9 Aug 2012 18:06:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758796Ab2HISGZ (ORCPT ); Thu, 9 Aug 2012 14:06:25 -0400 Received: from mx2.netapp.com ([216.240.18.37]:50787 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756920Ab2HISGZ (ORCPT ); Thu, 9 Aug 2012 14:06:25 -0400 X-IronPort-AV: E=Sophos;i="4.77,741,1336374000"; d="scan'208";a="675087614" Received: from smtp2.corp.netapp.com ([10.57.159.114]) by mx2-out.netapp.com with ESMTP; 09 Aug 2012 11:05:54 -0700 Received: from davros.hq.netapp.com (davros.hq.netapp.com [10.63.225.83]) by smtp2.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id q79I5q54028755; Thu, 9 Aug 2012 11:05:54 -0700 (PDT) From: bjschuma@netapp.com To: Trond.Myklebust@netapp.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH 2/3] NFS: return -ENOKEY when the upcall fails to map the name Date: Thu, 9 Aug 2012 14:05:50 -0400 Message-Id: <1344535551-4412-2-git-send-email-bjschuma@netapp.com> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1344535551-4412-1-git-send-email-bjschuma@netapp.com> References: <1344535551-4412-1-git-send-email-bjschuma@netapp.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Bryan Schumaker This allows the normal error-paths to handle the error, rather than making a special call to complete_request_key() just for this instance. Signed-off-by: Bryan Schumaker Tested-by: William Dauchy --- fs/nfs/idmap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/nfs/idmap.c b/fs/nfs/idmap.c index c2b4004..9864b48 100644 --- a/fs/nfs/idmap.c +++ b/fs/nfs/idmap.c @@ -756,9 +756,8 @@ idmap_pipe_downcall(struct file *filp, const char __user *src, size_t mlen) } if (!(im.im_status & IDMAP_STATUS_SUCCESS)) { - ret = mlen; - complete_request_key(cons, -ENOKEY); - goto out_incomplete; + ret = -ENOKEY; + goto out; } namelen_in = strnlen(im.im_name, IDMAP_NAMESZ); @@ -775,7 +774,6 @@ idmap_pipe_downcall(struct file *filp, const char __user *src, size_t mlen) out: complete_request_key(cons, ret); -out_incomplete: return ret; }