diff options
author | Niklas Hambüchen <mail@nh2.me> | 2024-01-23 16:36:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-23 16:36:49 +0100 |
commit | aa6c8ae3a62ce1b2888d5a9fa8e726a4dcaa6c31 (patch) | |
tree | 05ffd67b3221cd0c522b4ae418d239c0aa4ffbe9 /nixos | |
parent | 624b8aefb3cc727abdfa2f7ad326053d1890a3f3 (diff) | |
parent | b9ba9df3e8e65b9e9428de86a72b9fa75e565f48 (diff) |
Merge pull request #253488 from nh2/install-grub-dont-stat-network-fs
install-grub.pl: Do stat() last to not hang on hanging network FS
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/system/boot/loader/grub/install-grub.pl | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/nixos/modules/system/boot/loader/grub/install-grub.pl b/nixos/modules/system/boot/loader/grub/install-grub.pl index d1e7a0cb81785..6f0f62546a018 100644 --- a/nixos/modules/system/boot/loader/grub/install-grub.pl +++ b/nixos/modules/system/boot/loader/grub/install-grub.pl @@ -136,7 +136,6 @@ sub GetFs { chomp $fs; my @fields = split / /, $fs; my $mountPoint = $fields[4]; - next unless -d $mountPoint; my @mountOptions = split /,/, $fields[5]; # Skip the optional fields. @@ -155,6 +154,11 @@ sub GetFs { # Is it better than our current match? if (length($mountPoint) > length($bestFs->mount)) { + + # -d performs a stat, which can hang forever on network file systems, + # so we only make this call last, when it's likely that this is the mount point we need. + next unless -d $mountPoint; + $bestFs = Fs->new(device => $device, type => $fsType, mount => $mountPoint); } } |