mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Viacheslav Dubeyko <slava@dubeyko.com>
To: Yangtao Li <frank.li@vivo.com>, glaubitz@physik.fu-berlin.de
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hfsplus: return EIO when type of hidden directory mismatch in hfsplus_fill_super()
Date: Fri, 08 Aug 2025 13:00:11 -0700	[thread overview]
Message-ID: <852f5f06eaa3c41e9f940defb3563e24087451ba.camel@dubeyko.com> (raw)
In-Reply-To: <20250805165905.3390154-1-frank.li@vivo.com>

On Tue, 2025-08-05 at 10:58 -0600, Yangtao Li wrote:
> If Catalog File contains corrupted record for the case of
> hidden directory's type, regard it as I/O error instead of
> Invalid argument.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>  fs/hfsplus/super.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
> index 86351bdc8985..55f42b349a5e 100644
> --- a/fs/hfsplus/super.c
> +++ b/fs/hfsplus/super.c
> @@ -524,7 +524,7 @@ static int hfsplus_fill_super(struct super_block
> *sb, struct fs_context *fc)
>  	if (!hfs_brec_read(&fd, &entry, sizeof(entry))) {
>  		hfs_find_exit(&fd);
>  		if (entry.type != cpu_to_be16(HFSPLUS_FOLDER)) {
> -			err = -EINVAL;
> +			err = -EIO;

Potentially, we could consider to add an error or warning message that
informs a user about file system corruption.

>  			goto out_put_root;
>  		}
>  		inode = hfsplus_iget(sb,
> be32_to_cpu(entry.folder.id));

Looks good.

Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com>

Thanks,
Slava.


      reply	other threads:[~2025-08-08 20:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-05 16:58 Yangtao Li
2025-08-08 20:00 ` Viacheslav Dubeyko [this message]

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=852f5f06eaa3c41e9f940defb3563e24087451ba.camel@dubeyko.com \
    --to=slava@dubeyko.com \
    --cc=frank.li@vivo.com \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®