linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* NFSv4: truncate returns I/O error
@ 2012-03-06 10:10 Miklos Szeredi
  2012-03-06 14:16 ` Myklebust, Trond
  2012-03-07 22:40 ` [PATCH 0/2] " Trond Myklebust
  0 siblings, 2 replies; 15+ messages in thread
From: Miklos Szeredi @ 2012-03-06 10:10 UTC (permalink / raw)
  To: Trond Myklebust
  Cc: linux-nfs-u79uwXL29TY76Z2rM5mHXA,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 189 bytes --]

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: truncate-test.c --]
[-- Type: text/x-csrc, Size: 317 bytes --]

#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;
}

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-03-08 21:27 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-06 10:10 NFSv4: truncate returns I/O error Miklos Szeredi
2012-03-06 14:16 ` Myklebust, Trond
2012-03-07 22:40 ` [PATCH 0/2] " Trond Myklebust
2012-03-07 22:40   ` [PATCH 1/2] NFS: Properly handle the case where the delegation is revoked Trond Myklebust
2012-03-07 22:40     ` [PATCH 2/2] NFSv4: Return the delegation if the server returns NFS4ERR_OPENMODE Trond Myklebust
2012-03-08 17:52       ` Olga Kornievskaia
     [not found]         ` <CAN-5tyG-w+ie3sxTwNA6e9x=CojxyDaJScJuCbS+9VE=yTmJNA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-03-08 18:15           ` Myklebust, Trond
     [not found]             ` <1331230525.2472.39.camel-SyLVLa/KEI9HwK5hSS5vWB2eb7JE58TQ@public.gmane.org>
2012-03-08 20:23               ` Olga Kornievskaia
2012-03-08 20:42                 ` J. Bruce Fields
     [not found]                   ` <20120308204205.GB9273-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2012-03-08 20:50                     ` Myklebust, Trond
2012-03-08 20:57                       ` J. Bruce Fields
2012-03-08 21:02                         ` Myklebust, Trond
2012-03-08 21:09                           ` J. Bruce Fields
     [not found]                         ` <20120308205737.GC9273-uC3wQj2KruNg9hUCZPvPmw@public.gmane.org>
2012-03-08 21:12                           ` Boaz Harrosh
     [not found]                       ` <1331239814.11759.1.camel-SyLVLa/KEI9HwK5hSS5vWB2eb7JE58TQ@public.gmane.org>
2012-03-08 21:27                         ` Olga Kornievskaia

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).