From patchwork Mon Dec 16 18:36:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "J. Bruce Fields" X-Patchwork-Id: 3356231 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3708FC0D4A for ; Mon, 16 Dec 2013 18:36:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2336D201FB for ; Mon, 16 Dec 2013 18:36:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E86BA201F9 for ; Mon, 16 Dec 2013 18:36:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755118Ab3LPSgM (ORCPT ); Mon, 16 Dec 2013 13:36:12 -0500 Received: from fieldses.org ([174.143.236.118]:59197 "EHLO fieldses.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754466Ab3LPSgL (ORCPT ); Mon, 16 Dec 2013 13:36:11 -0500 Received: from bfields by fieldses.org with local (Exim 4.76) (envelope-from ) id 1Vsd1W-0008LH-Sx; Mon, 16 Dec 2013 13:36:10 -0500 Date: Mon, 16 Dec 2013 13:36:10 -0500 To: Tony Asleson Cc: linux-nfs@vger.kernel.org Subject: Re: exportfs: Messages indicating unsupported operation that works Message-ID: <20131216183610.GA31816@fieldses.org> References: <52AE712B.3060404@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <52AE712B.3060404@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) From: "J. Bruce Fields" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sun, Dec 15, 2013 at 09:19:07PM -0600, Tony Asleson wrote: > When I try to export a directory that has a space in it I get the following: > > # exportfs *:"/mnt/has space" > exportfs: /mnt/has space does not support NFS export > > exit code is 0. > > If I do: > > # exportfs -v > /mnt/has space (ro,wdelay,root_squash,no_subtree_check, > sec=sys,ro,secure,root_squash,no_all_squash) > > It exists and I can mount it from a client and everything appears fine. > > I took a peek at the code and we are failing in test_export. We are > getting a -1 returned when we write to: /proc/net/rpc/nfsd.export/channel . > > This seems like a confusing message when it appears that everything is > working, thoughts? > > Notes: > - Kernel Linux rawhide 3.13.0-0.rc3.git1.2.fc21.x86_64 > - nfs-utils: Latest from git, but this happens on older released > versions tested too. test_export clearly isn't escaping the pathname. It probably needs something like the following (completely untested). --b. --- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/utils/exportfs/exportfs.c b/utils/exportfs/exportfs.c index 4331697..d5dfb0b 100644 --- a/utils/exportfs/exportfs.c +++ b/utils/exportfs/exportfs.c @@ -418,11 +418,15 @@ static int can_test(void) static int test_export(char *path, int with_fsid) { char buf[1024]; + char *bp = buf; + int len = sizeof(buf); int fd, n; - sprintf(buf, "-test-client- %s 3 %d 65534 65534 0\n", - path, - with_fsid ? NFSEXP_FSID : 0); + n = sprintf(buf, "-test-client- "); + bp += n; + len -= n; + qword_add(&bp, &len, path); + sprintf(bp, " 3 %d 65534 65534 0\n", with_fsid ? NFSEXP_FSID : 0); fd = open("/proc/net/rpc/nfsd.export/channel", O_WRONLY); if (fd < 0) return 0;