grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Grub-devel Digest, Vol 240, Issue 26


From: Nicolas Frayer
Subject: Re: Grub-devel Digest, Vol 240, Issue 26
Date: Tue, 20 Feb 2024 17:36:35 +0100

On Sat, Feb 17, 2024 at 6:01 PM <grub-devel-request@gnu.org> wrote:
>
> Send Grub-devel mailing list submissions to
>         grub-devel@gnu.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.gnu.org/mailman/listinfo/grub-devel
> or, via email, send a message with subject or body 'help' to
>         grub-devel-request@gnu.org
>
> You can reach the person managing the list at
>         grub-devel-owner@gnu.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Grub-devel digest..."
>
>
> Today's Topics:
>
>    1. Re: [PATCH] fs/xfs: Handle non-continuous data blocks in
>       directory extents (Jon DeVree)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 16 Feb 2024 16:39:42 -0500
> From: Jon DeVree <nuxi@vault24.org>
> To: Vladimir 'phcoder' Serbinenko <phcoder@gmail.com>
> Cc: The development of GNU GRUB <grub-devel@gnu.org>
> Subject: Re: [PATCH] fs/xfs: Handle non-continuous data blocks in
>         directory extents
> Message-ID: <Zc_WHpsWnBaEZERt@feynman.vault24.org>
> Content-Type: text/plain; charset=utf-8
>
> On Thu, Feb 15, 2024 at 20:33:13 +0300, Vladimir 'phcoder' Serbinenko wrote:
> > Is the pointer guaranteed to be aligned? If not you have to use unaligned
> > access.
>
> I don't know what alignment guarantees grub_malloc() makes. As long as
> they are close to what the regular C malloc() guarantees then it should
> be fine.
>
> > Any reason not to check it against correct magic and not just
> > zero-out?
>
> I found at least 4 different magic numbers in the XFS documentation and
> I wasn't sure if there were any more.
>
I think there are more than 4 magic numbers also as I had to put my code in the
direntry loop for it to fix the issue. I think it's because of the
fact that if the directory
list fits in an inode it won't create extent hence no extent magic numbers.
Here is an excerpt from my patch for reference:

@@ -951,6 +960,17 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir,
                    continue;
                  }

+               /* If the dirblock magic number doesn't match a valid
number then break */
+               dirblock_magic =
grub_be_to_cpu32(grub_get_unaligned32(dirblock));
+
+               if ((dirblock_magic != XFS_DIR2_BLOCK_MAGIC) &&
+               (dirblock_magic != XFS_DIR2_DATA_MAGIC)    &&
+               (dirblock_magic != XFS_DIR3_BLOCK_MAGIC)   &&
+               (dirblock_magic != XFS_DIR3_DATA_MAGIC))
+                 {
+                   break;
+                 }
+

> --
> Jon
> Doge Wrangler
> X(7): A program for managing terminal windows. See also screen(1) and tmux(1).
>
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> https://lists.gnu.org/mailman/listinfo/grub-devel
>
>
> ------------------------------
>
> End of Grub-devel Digest, Vol 240, Issue 26
> *******************************************




reply via email to

[Prev in Thread] Current Thread [Next in Thread]