grub-devel.gnu.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Frayer <nfrayer@redhat.com>
To: grub-devel@gnu.org
Subject: Re: Grub-devel Digest, Vol 240, Issue 26
Date: Tue, 20 Feb 2024 17:36:35 +0100	[thread overview]
Message-ID: <CAFfXDkSfYmnCFRa+SS91WuF0PawFjTp-WggvLnvx6r3doF=w-g@mail.gmail.com> (raw)
In-Reply-To: <mailman.55.1708189229.31297.grub-devel@gnu.org>

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
> *******************************************


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

       reply	other threads:[~2024-02-20 16:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.55.1708189229.31297.grub-devel@gnu.org>
2024-02-20 16:36 ` Nicolas Frayer [this message]
2024-02-20 16:56   ` Grub-devel Digest, Vol 240, Issue 26 Jon DeVree

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='CAFfXDkSfYmnCFRa+SS91WuF0PawFjTp-WggvLnvx6r3doF=w-g@mail.gmail.com' \
    --to=nfrayer@redhat.com \
    --cc=grub-devel@gnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).