I'm guessing the problem is with the underlying librgw version. When
the mount is NFSv3, the file will be written out (by default) 10s
after the last append to the file via NFS. That write-out may be
failing.
Have you tried using NFSv4.1/2 as the NFS protocol version? That may
be easier to debug.
Matt
On Fri, Nov 8, 2019 at 9:46 AM Daniel Gryniewicz <dang(a)redhat.com> wrote:
On 11/8/19 5:06 AM, fanzi2009(a)hotmail.com wrote:
> Hi Guys,
> I tried to write files through FSAL_RGW and it's successful. But after a little
while, I found all the file size become 0. I just follow the writing logic for FSAL_RGW.
I found the `RGW_OPEN_FLAG_V3` is only set when state (which is a parameter
rgw_fsal_open2() in ) is NULL. However, it seems that the `state` is always NOT NULL.
When I changed the code to transfer RGW_OPEN_FLAG_V3 into rgw_open, the issue is gone.
> Is there any other guy meet a similar issue?
>
> ```
> rc = rgw_open(export->rgw_fs, handle->rgw_fh, posix_flags,
> (!state) ? RGW_OPEN_FLAG_V3 : RGW_OPEN_FLAG_NONE);
> ```
>
RGW_OPEN_FLAG_V3 indicates to RGW that this is an anonymous I/O, as is
done by NFSv3. It should only be passed when state is NULL, so the code
is correct as currently written.
I'm CC'ing Matt, who wrote this code.
Daniel
--
Matt Benjamin
Red Hat, Inc.
315 West Huron Street, Suite 140A
Ann Arbor, Michigan 48103
http://www.redhat.com/en/technologies/storage
tel. 734-821-5101
fax. 734-769-8938
cel. 734-216-5309