linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Kinglong Mee <kinglongmee@gmail.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] mount.nfs: print more useful error message
Date: Sun, 01 Jun 2014 13:13:12 -0400	[thread overview]
Message-ID: <538B5F28.2000100@RedHat.com> (raw)
In-Reply-To: <537AD1E7.6080404@gmail.com>



On 05/19/2014 11:54 PM, Kinglong Mee wrote:
> When mounting spec of a regular file, mount.nfs print error message as,
> 
> # mount -t nfs 127.0.0.1:/root/testfile /mnt/
> mount.nfs: mount point /mnt is not a directory
> # mount -t nfs 127.0.0.1:/root/testfile /mnt/testfile
> mount.nfs: mount point /mnt/testfile is not a directory
> 
> This patch lets mount.nfs print more useful message,
> 
> # mount -t nfs 127.0.0.1:/root/testfile /mnt/
> mount.nfs: mount spec 127.0.0.1:/root/testfile or point /mnt is not a directory
> # mount -t nfs 127.0.0.1:/root/testfile /mnt/testfile
> mount.nfs: mount point /mnt/testfile is not a directory
> 
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Committed... 

steved.

> ---
>  utils/mount/error.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/utils/mount/error.c b/utils/mount/error.c
> index f8fc13f..e06f598 100644
> --- a/utils/mount/error.c
> +++ b/utils/mount/error.c
> @@ -215,8 +215,12 @@ void mount_error(const char *spec, const char *mount_point, int error)
>  				progname);
>  		break;
>  	case ENOTDIR:
> -		nfs_error(_("%s: mount point %s is not a directory"),
> -				progname, mount_point);
> +		if (spec)
> +			nfs_error(_("%s: mount spec %s or point %s is not a "
> +				  "directory"),	progname, spec, mount_point);
> +		else
> +			nfs_error(_("%s: mount point %s is not a directory"),
> +				  progname, mount_point);
>  		break;
>  	case EBUSY:
>  		nfs_error(_("%s: %s is busy or already mounted"),
> 

      reply	other threads:[~2014-06-01 17:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20  3:54 [PATCH] mount.nfs: print more useful error message Kinglong Mee
2014-06-01 17:13 ` Steve Dickson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=538B5F28.2000100@RedHat.com \
    --to=steved@redhat.com \
    --cc=kinglongmee@gmail.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).