RE: [PATCH v2 02/10] exfat: add exfat_get_empty_dentry_set() helper

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

 



> From: Sungjong Seo <sj1557.seo@xxxxxxxxxxx>
> Sent: Monday, March 4, 2024 4:43 PM
> To: Mo, Yuezhang <Yuezhang.Mo@xxxxxxxx>; linkinjeon@xxxxxxxxxx
>
> >
> > The following code still exists if without this patch set. It does not
> > allow deleted dentries to follow unused dentries.
> 
> It may be the same part as the code you mentioned, but remember that
> the first if-statement handles both an unused dentry and
> a deleted dentry together.

Thanks for your detailed explanation. 

I will update the code as follows, and I think it is very necessary to add such
comments.

        for (i = 0; i < es->num_entries; i++) {
                ep = exfat_get_dentry_cached(es, i);
                if (ep->type == EXFAT_UNUSED)
                        unused_hit = true;
                else if (IS_EXFAT_DELETED(ep->type)) {
                        /*
                         * Although it violates the specification for a
                         * deleted entry to follow an unused entry, some
                         * exFAT implementations could work like this.
                         * Therefore, to improve compatibility, allow it.
                         */
                        if (unused_hit)
                                continue;
                } else {
                        /* Used entry are not allowed to follow unused entry */
                        if (unused_hit)
                                goto err_used_follow_unused;

                        i++;
                        goto count_skip_entries;
                }
        }




[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