From: Chuck Lever <chuck.lever@oracle.com>
To: Neil Brown <neilb@suse.de>
Cc: nfs@lists.sourceforge.net
Subject: Re: [PATCH 03/17] mount.nfs: Remove support for "-t" option
Date: Sun, 15 Jul 2007 23:44:37 -0400 [thread overview]
Message-ID: <469AE9A5.3000107@oracle.com> (raw)
In-Reply-To: <18074.59398.729707.566494@notabene.brown>
[-- Attachment #1: Type: text/plain, Size: 2223 bytes --]
Neil Brown wrote:
> On Sunday July 15, chuck.lever@oracle.com wrote:
>> /bin/mount will never pass "-t" to a mount helper, since it passes the
>> fs-type in the name of the program it is executing.
>
> Does it hurt to leave it there though? Maybe it makes unit-testing
> easier?
> Or maybe not....
Well, part of these changes remove stuff that just seems confusing to
anyone trying to understand the code, and yes, this one is quite
optional. Honestly, I couldn't think of a case where this could
possibly be useful, but I'm open to education.
The fact that we can do a "mount.nfs -t nfs4" and that's the same as
"mount.nfs4" seems a little weird. The mount command will parse the
"-t" option and invoke either "mount.nfs" or "mount.nfs4"... extra logic
here is just going to cloud things.
>> @@ -413,23 +413,12 @@ int main(int argc, char *argv[])
>> mount_point = argv[2];
>>
>> argv[2] = argv[0]; /* so that getopt error messages are correct */
>> - while ((c = getopt_long (argc - 2, argv + 2, "rt:vVwfno:hs",
>> + while ((c = getopt_long (argc - 2, argv + 2, "r:vVwfno:hs",
> ^^
>
> Ooops. -r takes an argument now?
Hmmm. I'll fix that too.
>> if ((mc = getfsfile(mount_point)) == NULL ||
>> - strcmp(mc->m.mnt_fsname, spec) != 0 ||
>> - strcmp(mc->m.mnt_type, (nfs_mount_vers == 4 ? "nfs4":"nfs")) != 0
>> - ) {
>> - fprintf(stderr, "%s: permission died - no match for fstab\n",
>> - progname);
>> + !strcmp(mc->m.mnt_fsname, spec) ||
> ^^^^
>
> I absolutely LOATHE that construct. The first thing you read is "!"
> which means "not" but it is actually a test for "are these things
> equal" which makes it confusing (to me). So I always like to see the
> result of strcmp tested with "== 0" "< 0" "> 0" as the relation
> given applies exactly to the tested relation between the strings.
OK, now that I know that's the preference, I will use "== 0".
> Further:
>> - strcmp(mc->m.mnt_fsname, spec) != 0 ||
> and
>> + !strcmp(mc->m.mnt_fsname, spec) ||
>
> are opposite tests, and it is not clear to me why you inverted the
> test.
Simple explanation: because I'm a bone-head.
[-- Attachment #2: chuck.lever.vcf --]
[-- Type: text/x-vcard, Size: 290 bytes --]
begin:vcard
fn:Chuck Lever
n:Lever;Chuck
org:Oracle Corporation;Corporate Architecture: Linux Projects Group
adr:;;1015 Granger Avenue;Ann Arbor;MI;48104;USA
title:Principal Member of Staff
tel;work:+1 248 614 5091
x-mozilla-html:FALSE
url:http://oss.oracle.com/~cel
version:2.1
end:vcard
[-- Attachment #3: Type: text/plain, Size: 286 bytes --]
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
[-- Attachment #4: Type: text/plain, Size: 140 bytes --]
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
prev parent reply other threads:[~2007-07-16 3:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-16 3:15 [PATCH 03/17] mount.nfs: Remove support for "-t" option Chuck Lever
2007-07-16 3:37 ` Neil Brown
2007-07-16 3:44 ` Chuck Lever [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=469AE9A5.3000107@oracle.com \
--to=chuck.lever@oracle.com \
--cc=neilb@suse.de \
--cc=nfs@lists.sourceforge.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.