Ok, Thanks for clarification. I probably misread some sentences like: A valid stateid SHOULD always be specified. When the file size attribute is not set, the special anonymous stateid MAY be passed. anyway, it's I have to handle it on the server as RHEL6 clients won't get any new updates. Tigran. ----- Original Message ----- > From: "Trond Myklebust" <trondmy@xxxxxxxxxxxxxxx> > To: "Tigran Mkrtchyan" <tigran.mkrtchyan@xxxxxxx>, "Olga Kornievskaia" <aglo@xxxxxxxxx> > Cc: "linux-nfs" <linux-nfs@xxxxxxxxxxxxxxx> > Sent: Wednesday, July 19, 2017 4:33:27 PM > Subject: Re: SETATTR without stateid > On Wed, 2017-07-19 at 10:22 -0400, Olga Kornievskaia wrote: >> On Wed, Jul 19, 2017 at 9:58 AM, Mkrtchyan, Tigran >> <tigran.mkrtchyan@xxxxxxx> wrote: >> > 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. >> >> SETATTR is allowed to send an all-zero stateid: >> >> RFC7530 9.1.4.3 >> >> Anonymous Stateid: When "other" and seqid are both zero, the stateid >> is treated as a special anonymous stateid, which can be used in >> READ, WRITE, and SETATTR requests to indicate the absence of >> any >> open state associated with the request. > > Agreed. As Olga says, there is no spec requirement that the client open > the file in order to service a truncate() call, so this behaviour is by > design. > > Cheers > Trond > -- > Trond Myklebust > Linux NFS client maintainer, PrimaryData > trond.myklebust@xxxxxxxxxxxxxxx > N�����r��y���b�X��ǧv�^�){.n�+����{���"��^n�r���z���h����&���G���h�(�階�ݢj"���m�����z�ޖ���f���h���~�m� -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html