All of lore.kernel.org
 help / color / mirror / Atom feed
* SETATTR without stateid
@ 2017-07-19 13:58 Mkrtchyan, Tigran
  2017-07-19 14:22 ` Olga Kornievskaia
  0 siblings, 1 reply; 4+ messages in thread
From: Mkrtchyan, Tigran @ 2017-07-19 13:58 UTC (permalink / raw)
  To: linux-nfs

Dear friends,

By running xfstest (generic/013) I have discovered client side misbehavior.
Consider the following test code:

-----

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


int main(int argc, char **argv)
{

  if (argc != 2) {
    fprintf(stderr, "Usage: %s <path>\n", argv[0]);
    exit(1);
  }

  int rc = truncate(argv[1], 8192);
  if (rc < 0) {
    perror("Failed to truncate the file");
    exit(4);
  }
  exit(0);
}


----

The expectation is that client will send a valid open stateid with SETATTR (rfc7530#16.32.4).
However, this is not the case - client just send's a SETATTR with size, but without any open.

BTW, older clients (RHEL6) will fail with EIO, latest kernel, 4.13.0-rc1 goes into an
infinite loop of SETATTR requests.

On the other hand, ftruncate works as expected, e.q. following example:

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


int main(int argc, char **argv)
{

  if (argc != 2) {
    fprintf(stderr, "Usage: %s <path>\n", argv[0]);
    exit(1);
  }

  int fd = open(argv[1], O_RDWR, 0644);
  if (fd < 0) {
    perror("Failed to open file");
    exit(2);
  }

  int rc = ftruncate(fd, 8192);
  if (rc < 0) {
    perror("Failed to truncate the file");
    exit(4);
  }

  close(fd);
  exit(0);
}
----
Will provide an open stateid with SETATTR requests as mandated by rfc.

Tigran.

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

end of thread, other threads:[~2017-07-19 15:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-19 13:58 SETATTR without stateid Mkrtchyan, Tigran
2017-07-19 14:22 ` Olga Kornievskaia
2017-07-19 14:33   ` Trond Myklebust
2017-07-19 15:37     ` Mkrtchyan, Tigran

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.