dcache icon indicating copy to clipboard operation
dcache copied to clipboard

NFS doesn't preserve attributes when instructed so

Open calestyo opened this issue 8 years ago • 4 comments

Hey.

When a file is copied on a nfs41 mountpoint with e.g. cp -a, then attributes (at least the dates) aren't preserved, even though this should be the case; instead the current time is used. No error message is given that the preservation request has failed (which would be AFAIC mandatory for most of the --preserve types.

Cheers, Chris

calestyo avatar Oct 30 '15 01:10 calestyo

The problem is that cp command sends attributes before closing the file. On the close dCache itself update atime and mtime with information provided by mover and overwrites previously existing values.

On the other hand, rsync command sets atime and atime after closing the file and., as a result, file attributes get expected values.

$ cp --preserve ~/bin/dsip.py . $ ls -l dsip.py
-rwxrwxr-x 1 tigran tigran 425 Nov 3 2015 dsip.py $ rm dsip.py
$ rsync -a ~/bin/dsip.py . $ ls -l dsip.py
-rwxrwxr-x 1 tigran tigran 425 Aug 28 2013 dsip.py $

Is it an option for you to use rsync?

kofemann avatar Nov 03 '15 09:11 kofemann

Well it's not really crucial for me - I've just noted it and thought it should be reported.

If cp sends attributes, then doesn't it make sense to take those and not whatever dCache thinks whet it closes the mover? In doubt, I'd say, cp is right - at least for the mtime (atime and ctime is another matter, where the server could be considered to be right per definition).

calestyo avatar Nov 03 '15 16:11 calestyo

cp has it assumption on filesystem behavior, which is probably based on POSIX. Unless 'cp complaint' semantics is really required, we will keep it as-is for now.

kofemann avatar Nov 04 '15 08:11 kofemann

Yes, it's probably POSIX based... and in the past, all places were dcache diverged for "historical" reasons from POSIX caused rather more pain until it was sooner or later resolved :-/

calestyo avatar Nov 08 '15 03:11 calestyo