RE: [f2fs-dev][PATCH] f2fs: merge two uchar variable in struct nat_entry to reduce memory cost

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

 



Hi Jaegeuk,

> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk@xxxxxxxxxx]
> Sent: Monday, December 15, 2014 4:27 PM
> To: Chao Yu
> Cc: Changman Lee; linux-f2fs-devel@xxxxxxxxxxxxxxxxxxxxx; linux-fsdevel@xxxxxxxxxxxxxxx;
> linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: [f2fs-dev][PATCH] f2fs: merge two uchar variable in struct nat_entry to reduce
> memory cost
> 
> Hi Chao,
> 
> I found a bug in this patch.

Oh, it's my bad. I will fix this as you suggested.
Thank you for helping to find this bug. :)

Regards,
Yu

> 
> In set_node_addr,
> 
>  	down_write(&nm_i->nat_tree_lock);
> 	e = __lookup_nat_cache(nm_i, ni->nid);
> 	if (!e) {
> 		e = grab_nat_entry(nm_i, ni->nid);
> 		e->ni = *ni;
> 		^^^^^^^^^^^^
> 		this line should not copy ni.flag.
> 
> 		f2fs_bug_on(sbi, ni->blk_addr == NEW_ADDR);
> 	} else if (new_blkaddr == NEW_ADDR) {
> 		/*
> 		 * when nid is reallocated,
> 		 * previous nat entry can be remained in nat cache.
> 		 * So, reinitialize it with new information.
> 		 */
> 		e->ni = *ni;
> 		^^^^^^^^^^^^
> 		ditto.
> 
> 		f2fs_bug_on(sbi, ni->blk_addr != NULL_ADDR);
> 	}
> 
> So, please add inline function in node.h like:
> 
> static inline void copy_node_info(dst, src)
> {
> 	dst->nid = src->nid;
> 	dst->ino = src->ino;
> 	dst->blk_addr = src->blk_addr;
> 	dst->version = src->version;
> 	/* should not copy flag here */
> }
> 
> Then let's use this function.
> 
> Thanks,
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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