On 3/11/19 7:09 AM, Chris Murphy wrote:
In the case where superblock 0 at 65536 is valid but stale (older than the others): 1. btrfs check doesn't complain, the stale super is used for the check
2. when mounting, super 0 is used, no complaints at mount time, fairly quickly the newer supers are overwritten
More or less all these were hardened in the patchset [1] which is in the mailing-list. [PATCH v4 0/7] Superblock read and verify cleanups Thanks, Anand
Is this expected? In particular, in lieu of `btrfs rescue super` behavior which considers super 0 a bad super, and offers to fix it from the newer ones, and when I answer y, it replaces super 0 with newer information from the other supers. I think the `btrfs rescue` behavior is correct. I would expect that all the supers are read at mount time, and if there's discrepancy that either there's code to suspiciously sanity check the latest roots in the newest super, or it flat out fails to mount. Mounting based on stale super data seems risky doesn't it?