Re: [PATCH] hfsplus: return EIO when type of hidden directory mismatch in hfsplus_fill_super()

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

 



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@xxxxxxxx>
> ---
>  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@xxxxxxxxxxx>

Thanks,
Slava.






[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux