Use update() to directly set or unset xattr's instead of pulling in the complete file object, changing one attribute, and writing it all back out.