Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MKNOD "Function not implemented" but is now used by nfs-kernel-server #18

Open
gdelafond opened this issue Jan 22, 2020 · 1 comment · May be fixed by #21
Open

MKNOD "Function not implemented" but is now used by nfs-kernel-server #18

gdelafond opened this issue Jan 22, 2020 · 1 comment · May be fixed by #21

Comments

@gdelafond
Copy link
Contributor

Hello,

When exporting through NFS with at least nfs-kernel-server from Debian stretch (1.3.4-2.1), it uses mknod() system call to create a file.

Create a file locally (touch /cg/test):

unique: 4, opcode: LOOKUP (1), nodeid: 1, insize: 48, pid: 107156
   unique: 4, success, outsize: 144
unique: 5, opcode: LOOKUP (1), nodeid: 1932, insize: 48, pid: 107156
   unique: 5, error: -2 (No such file or directory), outsize: 16
unique: 6, opcode: CREATE (35), nodeid: 1932, insize: 64, pid: 107156
   unique: 6, success, outsize: 160
unique: 7, opcode: FLUSH (25), nodeid: 1942, insize: 64, pid: 107156
   unique: 7, error: -38 (Function not implemented), outsize: 16
unique: 8, opcode: SETATTR (4), nodeid: 1942, insize: 128, pid: 107156
   unique: 8, success, outsize: 120
unique: 9, opcode: RELEASE (18), nodeid: 1942, insize: 64, pid: 0
   unique: 9, success, outsize: 16
unique: 10, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 72040
   unique: 10, success, outsize: 96

Create a file through an NFS mount point (touch /mnt/cg/test) :

unique: 70, opcode: LOOKUP (1), nodeid: 1932, insize: 46, pid: 107327
   unique: 70, error: -2 (No such file or directory), outsize: 16
unique: 71, opcode: LOOKUP (1), nodeid: 1932, insize: 46, pid: 107327
   unique: 71, error: -2 (No such file or directory), outsize: 16
unique: 72, opcode: MKNOD (8), nodeid: 1932, insize: 62, pid: 107327
   unique: 72, error: -38 (Function not implemented), outsize: 16
unique: 73, opcode: LOOKUP (1), nodeid: 1932, insize: 46, pid: 107327
   unique: 73, error: -2 (No such file or directory), outsize: 16
unique: 74, opcode: STATFS (17), nodeid: 1, insize: 40, pid: 72040

As far as I know, nfs was not using mknod() on Debian Wheezy (and jessie I think).

Is there a way to implement it (for S_IFREG flag only of course)?

@rgacogne
Copy link
Member

Great, using mknod() to create a regular file does not only seem very weird, it's also not a portable use of mknod() according to POSIX:

POSIX.1-2001 says: "The only portable use of mknod() is to create a
FIFO-special file.  If mode is not S_IFIFO or dev is not 0, the
behavior of mknod() is unspecified.

@rgacogne rgacogne linked a pull request Jan 29, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants