From patchwork Sat Aug 6 10:11:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luk Claes X-Patchwork-Id: 1041412 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 p76ADcPm015199 for ; Sat, 6 Aug 2011 10:13:39 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752883Ab1HFKLX (ORCPT ); Sat, 6 Aug 2011 06:11:23 -0400 Received: from georges.telenet-ops.be ([195.130.137.68]:58671 "EHLO georges.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753787Ab1HFKLW (ORCPT ); Sat, 6 Aug 2011 06:11:22 -0400 Received: from station.luk.local ([78.20.70.239]) by georges.telenet-ops.be with bizsmtp id GyBL1h00K59kwV206yBLuu; Sat, 06 Aug 2011 12:11:20 +0200 Received: from luk by station.luk.local with local (Exim 4.76) (envelope-from ) id 1Qpdr5-0000es-79; Sat, 06 Aug 2011 12:11:43 +0200 From: Luk Claes To: Steve Dickson , linux-nfs@vger.kernel.org Cc: Luk Claes Subject: [PATCH] mount.nfs: Preserve any explicit port=2049 option Date: Sat, 6 Aug 2011 12:11:36 +0200 Message-Id: <1312625496-2496-1-git-send-email-luk@debian.org> X-Mailer: git-send-email 1.7.5.4 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]); Sat, 06 Aug 2011 10:13:39 +0000 (UTC) If NFS port (2049) is supplied explicitly, don't ignore this setting by requesting it to portmapper again. Thanks to Ben Hutchings for the patch. Signed-off-by: Luk Claes --- utils/mount/stropts.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index f1aa503..8b2799c 100644 --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -437,8 +437,8 @@ static int nfs_construct_new_options(struct mount_options *options, if (po_append(options, new_option) == PO_FAILED) return 0; - po_remove_all(options, "port"); - if (nfs_pmap->pm_port != NFS_PORT) { + if(po_remove_all(options, "port") == PO_FOUND || + nfs_pmap->pm_port != NFS_PORT) { snprintf(new_option, sizeof(new_option) - 1, "port=%lu", nfs_pmap->pm_port); if (po_append(options, new_option) == PO_FAILED)