RE: [PATCH] exfat: handle unreconized benign secondary entries

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

 



> @@ -567,12 +579,30 @@ int exfat_remove_entries(struct inode *inode, struct
> exfat_chain *p_dir,
>  	int i;
>  	struct exfat_dentry *ep;
>  	struct buffer_head *bh;
> +	int type;
> 
>  	for (i = order; i < num_entries; i++) {
>  		ep = exfat_get_dentry(sb, p_dir, entry + i, &bh);
>  		if (!ep)
>  			return -EIO;
> 
> +		type = exfat_get_entry_type(ep);
> +		if (type & TYPE_BENIGN_SEC) {
> +			struct exfat_chain dir;
> +			unsigned int start_clu =
> +				le32_to_cpu(ep-
> >dentry.generic_secondary.start_clu);
> +			u64 size = le64_to_cpu(ep-
> >dentry.generic_secondary.size);
> +			unsigned char flags = ep-
> >dentry.generic_secondary.flags;
> +
> +			if (!(flags & ALLOC_FAT_CHAIN) || !start_clu || !size)
> +				continue;

Oops, this BENIGN_SECONDARY entry should be removed regardless of
its cluster allocation.

> +
> +			exfat_chain_set(&dir, start_clu,
> +					EXFAT_B_TO_CLU_ROUND_UP(size,
> EXFAT_SB(sb)),
> +					flags);
> +			exfat_free_cluster(inode, &dir);
> +		}
> +
>  		exfat_set_entry_type(ep, TYPE_DELETED);
>  		exfat_update_bh(bh, IS_DIRSYNC(inode));
>  		brelse(bh);
> @@ -741,6 +771,7 @@ enum exfat_validate_dentry_mode {
>  	ES_MODE_GET_STRM_ENTRY,
>  	ES_MODE_GET_NAME_ENTRY,
>  	ES_MODE_GET_CRITICAL_SEC_ENTRY,
> +	ES_MODE_GET_BENIGN_SEC_ENTRY,
>  };
> 




[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