Skip to content

Commit

Permalink
shared/mountpoint-util: for old kernels, assume "norecovery" is suppo…
Browse files Browse the repository at this point in the history
…rted by btrfs

Fixup for e3828d7, as requested in
#32892 (comment).
  • Loading branch information
keszybz authored and bluca committed May 21, 2024
1 parent 72192b6 commit 055b465
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/basic/mountpoint-util.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,12 @@ const char* fstype_norecovery_option(const char *fstype) {
* old name if the new name doesn't work. */
if (streq(fstype, "btrfs")) {
r = mount_option_supported(fstype, "rescue=nologreplay", NULL);
if (r == -EAGAIN) {
log_debug_errno(r, "Failed to check for btrfs 'rescue=nologreplay' option, assuming old kernel with 'norecovery': %m");
return "norecovery";
}
if (r < 0)
log_debug_errno(r, "Failed to check for btrfs rescue=nologreplay option, assuming it is not supported: %m");
log_debug_errno(r, "Failed to check for btrfs 'rescue=nologreplay' option, assuming it is not supported: %m");
if (r > 0)
return "rescue=nologreplay";
}
Expand Down

0 comments on commit 055b465

Please sign in to comment.