[CentOS] Modifying files of NFS

Thu Apr 16 12:12:54 UTC 2015
Dennis Jacobfeuerborn <dennisml at conversis.de>

On 16.04.2015 02:12, Steven Tardy wrote:
> 
>> I have an NFS storage system and want to run jpegoptim on several GB's
>> of jpeg images and I'm wondering what the best approach is.
>> Is it ok to run this operation on the Server itself while the clients
>> have it mounted or will this lead to problems like e.g. the dreaded
>> "stale filehandle"?
> 
> Stale file handles won't happen if the file modified time stamp is updated. Add a simple 'touch $file' after updating each file.

If I'm not mistaken then jpegoptim will use the regular way this is done
by writing the new version to a temporary file and then rename that to
the original filename this replacing/overwriting it so the modified time
changes automatically but so does for example the inode of the file
since technically it is a new file.

The question really is if NFS picks up on this and just keeps serving
the new file normally or if it gets confused because the change was made
in the underlying filesystem on the server and not "trough" NFS from one
of the clients.
I've done this in the past and didn't see any errors but I was wondering
if this is intended to work by design or if I was just lucky in the past.

Regards,
  Dennis