mds: catch duplicates in DamageTable
There was an implicit assumption in the code that callers
wouldn't hit the notify_*damaged paths twice because they would
have checked is_*_damaged paths first.
However, that's not really true in all cases, e.g. scrub
code isn't required to respect existing damage entries
when trying to load a CDir.
Simply fix this by having the DamageTable notify* functions
check the key they're inserting doesn't already exist.
Fixes: http://tracker.ceph.com/issues/17173
Signed-off-by: John Spray <john.spray@redhat.com>
(cherry picked from commit
c9cfaef104e9aaefad55583d7e54f8b4665904b3)