lkml.org 
[lkml]   [2012]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectNFSv4: truncate returns I/O error
Date
The attached test program reliably fails on an NFSv4 mount.

# mount -tnfs -onfsvers=4 127.0.0.1:/ /mnt/nfs
# ./truncate-test /mnt/nfs/tmp/xyz
truncate: Input/output error

Thanks,
Miklos

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>

int main(int argc, char *argv[])
{
int res;
char *name = argv[1];

unlink(name);
close(open(name, O_WRONLY | O_CREAT, 0644));
close(open(name, O_RDONLY));

res = truncate(name, 1);
if (res == -1) {
perror("truncate");
return 1;
}
return 0;
}
\
 
 \ /
  Last update: 2012-03-06 11:13    [W:0.057 / U:13.952 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site