All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: Re: [heads-up] mknod() broken on nfs4
Date: Thu, 23 Jun 2011 03:48:09 +0100	[thread overview]
Message-ID: <20110623024809.GI11521@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20110622231946.GH11521@ZenIV.linux.org.uk>

On Thu, Jun 23, 2011 at 12:19:46AM +0100, Al Viro wrote:

> It always worked that way, all the way back to Unix v6 (and I'm fairly sure
> to earlier than that; don't have v5 kernel source, unfortunately).  Worked
> that way in Linux since 0.02/0.03/0.10, when Linus first added mknod(2)
> (presumably 0.01 had been tested with /dev populated by Minix ;-)

After looking around on the net: in v3 kernel, ken/sys2.c:

mknod()
{
        int *ip;
        extern uchar;

        if(suser()) {
                ip = namei(&uchar, 1);
                if(ip != NULL) {
                        u.u_error = EEXIST;
                        goto out;
                }
        }
        if(u.u_error)
                return;
        ip = maknode(u.u_arg[1]);
        ip->i_addr[0] = u.u_arg[2];

out:
        iput(ip);
}

IOW, mknod(path, 0777, 0) will, indeed, create a regular file.  Root-only,
back then.

; ls -l ken/sys2.c 
-rw-r--r-- 1 al al 3060 Aug 30  1973 ken/sys2.c

v3 manpages don't mention mknod(2) at all; it *is* wired in syscall table
(syscall 14).  Section 2 manpages give syscall numbers; what they have for
#14 is makdir (not mentioned by that name in the kernel, described as
creating an empty directory with given pathname and mode sans . and ..
links - i.e. exactly what mknod(2) did all the way to v7 when given
S_IFDIR | something).

  reply	other threads:[~2011-06-23  2:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-21 23:59 [heads-up] mknod() broken on nfs4 Al Viro
2011-06-22  0:23 ` Al Viro
2011-06-22 23:00   ` Trond Myklebust
2011-06-22 23:00     ` Trond Myklebust
2011-06-22 23:19     ` Al Viro
2011-06-22 23:19       ` Al Viro
2011-06-23  2:48       ` Al Viro [this message]
2011-06-23  5:37       ` Al Viro

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=20110623024809.GI11521@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=Trond.Myklebust@netapp.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --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 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.