When a file is updated, the mount does not invalidate the kernel cache. So the file size is unchanged. I tried to use direct_io in https://github.com/bazil/fuse/issues/156 to solve this. So the cat the_file works.
However, ls -l the_file is still reporting the wrong file size. The wrong file size is failing other operations, e.g., echo something >> the_file will append at the wrong offset.
I have tried to use InvalidateNodeData and/or InvalidateNodeAttr without success.
When ls -l the_file, with debug message, the correct file size is set correctly to the attr.Size in Attr(ctx context.Context, attr *fuse.Attr).
Is there any way to invalidate kernel node cache? Or some way to tell kernel to Forget the node?
I am trying to deal with this https://github.com/chrislusf/seaweedfs/issues/1752
When a file is updated, the mount does not invalidate the kernel cache. So the file size is unchanged. I tried to use direct_io in https://github.com/bazil/fuse/issues/156 to solve this. So the
cat the_file
works.However,
ls -l the_file
is still reporting the wrong file size. The wrong file size is failing other operations, e.g.,echo something >> the_file
will append at the wrong offset.I have tried to use
InvalidateNodeData
and/orInvalidateNodeAttr
without success. Whenls -l the_file
, with debug message, the correct file size is set correctly to theattr.Size
inAttr(ctx context.Context, attr *fuse.Attr)
.Is there any way to invalidate kernel node cache? Or some way to tell kernel to Forget the node?