All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chao Yu <chao2.yu@samsung.com>
To: 'Jaegeuk Kim' <jaegeuk@kernel.org>
Cc: 'Changman Lee' <cm224.lee@samsung.com>,
	linux-f2fs-devel@lists.sourceforge.net,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: RE: [f2fs-dev][PATCH] f2fs: merge two uchar variable in struct nat_entry to reduce memory cost
Date: Mon, 15 Dec 2014 17:16:36 +0800	[thread overview]
Message-ID: <002401d01848$010fa9a0$032efce0$@samsung.com> (raw)
In-Reply-To: <20141215082717.GA83773@jaegeuk-mac02.mot-mobility.com>

Hi Jaegeuk,

> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk@kernel.org]
> Sent: Monday, December 15, 2014 4:27 PM
> To: Chao Yu
> Cc: Changman Lee; linux-f2fs-devel@lists.sourceforge.net; linux-fsdevel@vger.kernel.org;
> linux-kernel@vger.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,
> 


      reply	other threads:[~2014-12-15  9:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-08  7:13 [f2fs-dev][PATCH] f2fs: merge two uchar variable in struct nat_entry to reduce memory cost Chao Yu
2014-12-15  8:27 ` Jaegeuk Kim
2014-12-15  9:16   ` Chao Yu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='002401d01848$010fa9a0$032efce0$@samsung.com' \
    --to=chao2.yu@samsung.com \
    --cc=cm224.lee@samsung.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.