lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 15 Dec 2014 17:16:36 +0800
From:	Chao Yu <chao2.yu@...sung.com>
To:	'Jaegeuk Kim' <jaegeuk@...nel.org>
Cc:	'Changman Lee' <cm224.lee@...sung.com>,
	linux-f2fs-devel@...ts.sourceforge.net,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: RE: [f2fs-dev][PATCH] f2fs: merge two uchar variable in struct
 nat_entry to reduce memory cost

Hi Jaegeuk,

> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk@...nel.org]
> Sent: Monday, December 15, 2014 4:27 PM
> To: Chao Yu
> Cc: Changman Lee; linux-f2fs-devel@...ts.sourceforge.net; linux-fsdevel@...r.kernel.org;
> linux-kernel@...r.kernel.org
> 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-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ