0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

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
This commit is contained in:
Niklas Hambüchen 2024-01-23 16:36:49 +01:00 committed by GitHub
commit aa6c8ae3a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}
}