Linux NILFS development
 help / color / mirror / Atom feed
From: Ryusuke Konishi <ryusuke-sG5X7nlA6pw@public.gmane.org>
To: lihong.hi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org,
	linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 2/3] nilfs2: nilfs_segctor_destroy() should do a full job
Date: Sun, 11 Apr 2010 17:15:51 +0900 (JST)	[thread overview]
Message-ID: <20100411.171551.04175650.ryusuke@osrg.net> (raw)
In-Reply-To: <20100411042749.GB10086@xhl>

On Sun, 11 Apr 2010 12:27:49 +0800, Li Hong <lihong.hi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On Sun, Apr 11, 2010 at 03:10:05AM +0900, Ryusuke Konishi wrote:
> > On Sun, 11 Apr 2010 00:17:00 +0800, Li Hong <lihong.hi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > > From 466fbbc10dabc8a14e292ee19636fc534036a8b7 Mon Sep 17 00:00:00 2001
> > > From: Li Hong <lihong.hi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > > Date: Sat, 10 Apr 2010 22:26:04 +0800
> > > Subject: [PATCH 2/3] nilfs2: nilfs_segctor_destroy() should do a full job
> > > 
> > > To set "sbi->s_sc_info = NULL;" is also a part of nilfs_segctor_destroy()'s job.
> > > Move it into the destroy procedure.
> > > 
> > > Signed-off-by: Li Hong <lihong.hi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> > 
> > No, don't do this.  sbi->s_sc_info is the holder of the segment
> > constructor object and is not a part of the object though
>                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> No, my meaning is that: to set "sbi->s_sc_info = NULL;" is also a _part_ of 
> nilfs_segctor_destroy()'s _job_. 

It's your opinion, and my opinion is different.  I'd prefer to
intentionally keep the clearance in
nilfs_detach_segment_constructor().  It's not a matter of your
changelog description.

Thanks,
Ryusuke Konishi

> I should make the explanation clearer. IMO, I just think 'kfree
> something' and 'set the obj to NULL' can't be seperated by a
> procedure.

> Thanks,
> Li Hong
> 
> > nilfs_segctor_destroy needs some cleanup.
> > 
> > Ryusuke Konishi
> > 
> > > ---
> > >  fs/nilfs2/segment.c |    5 ++---
> > >  1 files changed, 2 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c
> > > index 514620d..dd3c4d5 100644
> > > --- a/fs/nilfs2/segment.c
> > > +++ b/fs/nilfs2/segment.c
> > > @@ -2774,6 +2774,7 @@ static void nilfs_segctor_destroy(struct nilfs_sc_info *sci)
> > >  	down_write(&sbi->s_nilfs->ns_segctor_sem);
> > >  
> > >  	kfree(sci);
> > > +	sbi->s_sc_info = NULL;
> > >  }
> > >  
> > >  /**
> > > @@ -2829,10 +2830,8 @@ void nilfs_detach_segment_constructor(struct nilfs_sb_info *sbi)
> > >  	LIST_HEAD(garbage_list);
> > >  
> > >  	down_write(&nilfs->ns_segctor_sem);
> > > -	if (NILFS_SC(sbi)) {
> > > +	if (NILFS_SC(sbi))
> > >  		nilfs_segctor_destroy(NILFS_SC(sbi));
> > > -		sbi->s_sc_info = NULL;
> > > -	}
> > >  
> > >  	/* Force to free the list of dirty files */
> > >  	spin_lock(&sbi->s_inode_lock);
> > > -- 
> > > 1.6.3.3
> > > 
> > > --
> > > To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
> > > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-nilfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-04-11  8:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-10 16:15 [PATCH 1/3] nilfs2: remove nilfs_segctor_init() in segment.c Li Hong
2010-04-10 16:17 ` [PATCH 2/3] nilfs2: nilfs_segctor_destroy() should do a full job Li Hong
2010-04-10 16:17   ` [PATCH 3/3] nilfs2: change sc_timer from a pointer to an embedded one in struct nilfs_sc_info Li Hong
2010-04-11  2:40     ` Ryusuke Konishi
     [not found]       ` <20100411.114022.199103512.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-04-11  4:29         ` Li Hong
2010-04-11  9:08           ` Li Hong
2010-04-11  9:47             ` Ryusuke Konishi
2010-04-10 18:10   ` [PATCH 2/3] nilfs2: nilfs_segctor_destroy() should do a full job Ryusuke Konishi
     [not found]     ` <20100411.031005.204131803.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-04-11  4:27       ` Li Hong
2010-04-11  8:15         ` Ryusuke Konishi [this message]
     [not found]           ` <20100411.171551.04175650.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-04-11  8:29             ` Li Hong
2010-04-10 17:57 ` [PATCH 1/3] nilfs2: remove nilfs_segctor_init() in segment.c Ryusuke Konishi
     [not found]   ` <20100411.025715.33555818.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-04-11  4:17     ` Li Hong
2010-04-11  7:58       ` Ryusuke Konishi
     [not found]         ` <20100411.165847.77342547.ryusuke-sG5X7nlA6pw@public.gmane.org>
2010-04-11  8:22           ` Li Hong
2010-04-11  8:40             ` Ryusuke Konishi

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=20100411.171551.04175650.ryusuke@osrg.net \
    --to=ryusuke-sg5x7nla6pw@public.gmane.org \
    --cc=konishi.ryusuke-Zyj7fXuS5i5L9jVzuh4AOg@public.gmane.org \
    --cc=lihong.hi-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-nilfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox