RE: [PATCH v4 1/2] exfat: change to get file size from DataLength

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

 



> From: Namjae Jeon <linkinjeon@xxxxxxxxxx> 
> Sent: Monday, November 27, 2023 8:12 AM
> To: Mo, Yuezhang <Yuezhang.Mo@xxxxxxxx>
> Cc: sj1557.seo@xxxxxxxxxxx; linux-fsdevel@xxxxxxxxxxxxxxx; Wu, Andy <Andy.Wu@xxxxxxxx>; Aoyama, Wataru (SGC) <Wataru.Aoyama@xxxxxxxx>
> Subject: Re: [PATCH v4 1/2] exfat: change to get file size from DataLength
> 
> [snip]
> > +	map_bh(bh_result, sb, phys);
> > +	if (buffer_delay(bh_result))
> > +		clear_buffer_delay(bh_result);
> > +
> >  	if (create) {
> > +		sector_t valid_blks;
> > +
> > +		valid_blks = EXFAT_B_TO_BLK_ROUND_UP(ei->valid_size, sb);
> > +		if (iblock < valid_blks && iblock + max_blocks >= valid_blks) {
> > +			max_blocks = valid_blks - iblock;
> > +			goto done;
> > +		}
> I don't know why this check is needed. And Why do you call
> exfat_map_new_buffer() about < valid blocks ?

If part of a block has been written, the written part needs to be read out and the unwritten part needs to be zeroed before writing.
So unwritten area and written area need to be mapped separately.

There is no need to call exfat_map_new_buffer() if iblock + max_blocks < valid_blks.
I will update the code.

> > +
> >  		err = exfat_map_new_buffer(ei, bh_result, pos);
> >  		if (err) {
> >  			exfat_fs_error(sb,




[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