[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-id: <1357093127.18226.11.camel@kjgkr>
Date: Wed, 02 Jan 2013 11:18:47 +0900
From: Jaegeuk Kim <jaegeuk.kim@...sung.com>
To: Namjae Jeon <linkinjeon@...il.com>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-f2fs-devel@...ts.sourceforge.net,
Namjae Jeon <namjae.jeon@...sung.com>,
Amit Sahrawat <a.sahrawat@...sung.com>
Subject: Re: [PATCH 3/4] f2fs: fix removing cache entry within proper lock
NAK, we don't need to do this.
There is no relationship between kmem_cache_* and free_nid_list_lock.
Moreover, IMO, it would be better unlock free_nid_list_lock as quickly
as possible in order to reduce lock contention.
2012-12-30 (일), 14:52 +0900, Namjae Jeon:
> From: Namjae Jeon <namjae.jeon@...sung.com>
>
> Cache entry for free NID, is not getting removed under proper
> lock in case of error in add_free_nid. So, free the cache entry
> first before releasing the spinlock.
>
> Signed-off-by: Namjae Jeon <namjae.jeon@...sung.com>
> Signed-off-by: Amit Sahrawat <a.sahrawat@...sung.com>
> ---
> fs/f2fs/node.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
> index 5066bfd..09139fb 100644
> --- a/fs/f2fs/node.c
> +++ b/fs/f2fs/node.c
> @@ -1227,8 +1227,8 @@ retry:
>
> spin_lock(&nm_i->free_nid_list_lock);
> if (__lookup_free_nid_list(nid, &nm_i->free_nid_list)) {
> - spin_unlock(&nm_i->free_nid_list_lock);
> kmem_cache_free(free_nid_slab, i);
> + spin_unlock(&nm_i->free_nid_list_lock);
> return 0;
> }
> list_add_tail(&i->list, &nm_i->free_nid_list);
--
Jaegeuk Kim
Samsung
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists