From: Avnish Chouhan <avnish@linux.ibm.com>
To: mchang@suse.com
Cc: grub-devel@gnu.org, Daniel Kiper <daniel.kiper@oracle.com>
Subject: Re: [PATCH] getroot: Skip mount points in grub_find_device
Date: Tue, 16 Sep 2025 22:57:16 +0530 [thread overview]
Message-ID: <86254689759ae94568547ecb66c0f3ee@linux.ibm.com> (raw)
In-Reply-To: <mailman.5114.1758024225.1197.grub-devel@gnu.org>
On 2025-09-16 17:33, grub-devel-request@gnu.org wrote:
> Message: 3
> Date: Tue, 16 Sep 2025 14:38:05 +0800
> From: Michael Chang <mchang@suse.com>
> To: The development of GNU GRUB <grub-devel@gnu.org>
> Subject: [PATCH] getroot: Skip mount points in grub_find_device
> Message-ID: <20250916063805.181388-1-mchang@suse.com>
>
> The grub_find_device function scans a starting directory, typically
> /dev, for device files with matching major and minor numbers. During
> this process, it recursively descends into subdirectories.
>
> However, this can significantly slow down the scan if a subdirectory is
> a mount point not related to devtmpfs, especially if it contains a
> large
> number of files.
>
> This patch modifies grub_find_device() to skip subdirectories that are
> mount points. A mount point is detected by comparing the st_dev of the
> subdirectory against that of the parent or starting directory. While
> this method does not catch all types of mounts, for eg bind mounts, it
> is a practical solution that avoids the need to parse
> /proc/self/mounts.
>
> Signed-off-by: Michael Chang <mchang@suse.com>
Reviewed-by: Avnish Chouhan <avnish@linux.ibm.com>
_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel
next prev parent reply other threads:[~2025-09-16 17:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.5114.1758024225.1197.grub-devel@gnu.org>
2025-09-16 16:38 ` [PATCH] docs/grub.texi: Fix build warnings in libgcrypt and blsuki doc Avnish Chouhan
2025-09-16 17:27 ` Avnish Chouhan [this message]
2025-09-16 6:38 [PATCH] getroot: Skip mount points in grub_find_device Michael Chang via Grub-devel
2025-09-16 12:02 ` Neal Gompa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=86254689759ae94568547ecb66c0f3ee@linux.ibm.com \
--to=avnish@linux.ibm.com \
--cc=daniel.kiper@oracle.com \
--cc=grub-devel@gnu.org \
--cc=mchang@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.