Grub-devel Digest, Vol 240, Issue 26
Quoted 42 lines · On Sat, Feb 17, 2024 at 6:01 PM <[email protected]> wrote:
Send Grub-devel mailing list submissions to
[email protected]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
[email protected]You can reach the person managing the list at
[email protected]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 <[email protected]>
To: Vladimir 'phcoder' Serbinenko <[email protected]>
Cc: The development of GNU GRUB <[email protected]>
Subject: Re: [PATCH] fs/xfs: Handle non-continuous data blocks in
directory extents
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8Quoted 2 lines · Vladimir 'phcoder' Serbinenko
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 Cmalloc()guarantees then it should be fine.
Quoted 6 lines
Quoted 2 lines
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;
+ }
+
Quoted 17 lines
--
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
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 4 lines
------------------------------
End of Grub-devel Digest, Vol 240, Issue 26
*******************************************
_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel
Quoted 4 lines · Nicolas Frayer
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.
No, short form directories are handled by a different code path.
If having the checks outside of the direntry loop didn't work for you that suggests the premise of both our patches might not be correct. Do you know what magic numbers you were seeing?
Signature · 8 lines
Jon Doge Wrangler X(7): A program for managing terminal windows. See also screen(1) and tmux(1). _______________________________________________ Grub-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/grub-devel