[kwlug-disc] Accessing recently-written NFS files

William Park opengeometry at yahoo.ca
Mon Dec 12 21:37:43 EST 2022


If 'mv' works after some time, then probably you may be right.

NOTE: Depending on your current working directory, you may want to quote 
the glob, like
     -name 'test_file*'

On 2022-12-12 17:45, Adam Glauser wrote:
> I've got a bit of a head-scratcher on my hands.
> 
> I have a filesystem on my application's host (Oracle/RH Linux 7) that is 
> mounted via NFS. I believe the FS is served by a Windows machine.
> 
> If I do something like this, everything is fine
> $for i in {1..100};
> do
> head -c 10 </dev/urandom >"/nfs_share/tmp/test_file${i}";
> done && find /nfs_share/tmp/ -name test_file* -exec mv {} /nfs_share/final_location \;
> 
> However, if I bump up the file size to 10K, suddenly they all fail to mv 
> with "Permission denied" errors. Waiting some time and retrying the 'mv' 
> causes it to complete successfully.
> 
> I think this means that there is some kind of client-side caching 
> happening, so that the file appears to be written, while NFS is still 
> working away on transferring it to the storage location. Trying to 
> unlink the file before the cache is emptied is disallowed, presumably to 
> avoid data loss.
> 
> Am I headed in the right direction by trying to delve into the details 
> of NFS caching and file locking? Any other avenues that someone can suggest?
> 
> Thanks,
> Adam
> 
> _______________________________________________
> kwlug-disc mailing list
> To unsubscribe, send an email to kwlug-disc-leave at kwlug.org
> with the subject "unsubscribe", or email
> kwlug-disc-owner at kwlug.org to contact a human being.




More information about the kwlug-disc mailing list