sharing: fix infinite loop

fix infinite loop while updating etags, fix for #4365