AOSP: e2fsck: allow read-only testing if -E unshare_blocks will succeed
If -E unshare_blocks is used with -n, it will normally fail since the
filesystem is read-only. For Android's "adb remount" it is more useful
to report whether or not the unshare operation would succeed, were the
filesystem writable. We do that here by ignoring certain write
operations if -E unshare_blocks is specified with -n. It is not perfect,
since the actual unshare operation could still fail (for example if
new extents need to consume additional blocks).
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Google-Bug-Id:
64109868
Test: e2fsck -f -n -E unshare_blocks on deduplicated image
Change-Id: Ia50ceb7b3745fdf8766cff06c697818f07411635
From AOSP commit:
9e76dc0f65d8a8dec27f57b9020e81cbbbe12faf