The issue comes up occasionally in case of setups where people have e.g /home mounted via NFS.
During the update of the filesystem package which contains /home rpm simply checks if the directory is there. In case it isn't it of course creates it. In case of an update though it just then follows with a chown, chgrp and a chmod on the directory and fails if any of them fails.
Now, if neither the user, group nor mode has changed wouldn't it be better behaviour if rpm checks if they changed after the failed chown/chgrp/chmod calls and if they didn't then basically ignores the errors as the state of the directory after the transaction would still correctly reflect what is in the new rpm?
Of course this only works for directories and only for updates, but at least for that case this would be a nice improvement of behaviour without any negative side effects from what i can see.
So in short pseudcode:
During unpacking of the cpio:
if chown(fname) failed and fname is a dir:
if user(dirname on disk) == user(dirname in rpm)
ignore error
else
normal error
if chgrp(fname) failed and fname is a dir:
if group(dirname on disk) == group(dirname in rpm)
ignore error
else
normal error
if chmode(fname) failed and fname is a dir:
if mode(dirname on disk) == mode(dirname in rpm)
ignore error
else
normal error
In case you think this is something worth putting in RPM let me know and i'll write a patch for it and post it to rpm-maint list.
References: https://bugzilla.redhat.com/show_bug.cgi?id=483071