Linux NILFS development
 help / color / mirror / Atom feed
From: Jiro SEKIBA <jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>
To: NILFS Users mailing list <users-JrjvKiOkagjYtjvyW6yDsg@public.gmane.org>
Subject: Re: [PATCH 1/3] nilfs2: fix disorder of nilfs_write_super in nilfs_sync_fs
Date: Wed, 22 Jul 2009 13:02:43 +0900	[thread overview]
Message-ID: <878wihxt3w.wl%jir@sekiba.com> (raw)
In-Reply-To: <20090719.195358.55746341.ryusuke-sG5X7nlA6pw@public.gmane.org>

Hi,

At Sun, 19 Jul 2009 19:53:58 +0900 (JST),
Ryusuke Konishi wrote:
> 
> Hi,
> On Sun, 19 Jul 2009 14:26:20 +0900, Jiro SEKIBA wrote:
> > fix disorder of nilfs_write_super in nilfs_sync_fs.
> > commiting super block must be the end of the function
> > so that every chanages are reflected.
> > 
> > Signed-off-by: Jiro SEKIBA <jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>
> > ---
> >  fs/nilfs2/super.c |    5 +++--
> >  1 files changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
> > index 8e2ec43..ba69601 100644
> > --- a/fs/nilfs2/super.c
> > +++ b/fs/nilfs2/super.c
> > @@ -388,11 +388,12 @@ static int nilfs_sync_fs(struct super_block *sb, int wait)
> >  {
> >  	int err = 0;
> >  
> > -	nilfs_write_super(sb);
> > -
> >  	/* This function is called when super block should be written back */
> >  	if (wait)
> >  		err = nilfs_construct_segment(sb);
> > +
> > +	nilfs_write_super(sb);
> > +
> 
> I read callers of the sync_fs callback, and I felt that
> nilfs_sync_fs() would rather call nilfs_commit_super() directly.
> 
> nilfs_write_super is written to handle periodic callback,
> and it moderates frequency of actual write back.
> 
> Is sync_fs called periodically or frequently?

I added printk in nilfs_sync_fs and nilfs_write_super.
As you mentioned, nilfs_sync_fs is not called periodically
nor frequently like nilfs_write_super.

> If neither was, I think it's only necessary to do:
> 
>     down_write(&nilfs->ns_sem);
>     if (sb->s_dirt)
>         nilfs_commit_super(NILFS_SB(sb), 1);
>     up_write(&nilfs->ns_sem);
> 
> Note that ->sync_fs() is not called for read-only filesystems.

So this change be applicable.

thank you for the comments! I'll revise patches and resent it.

> The recent migration of write_super into sync_fs made this
> transformation possible.
>
> Thanks,
> Ryusuke Konishi
> 
> >  	return err;
> >  }
> >  
> > -- 
> > 1.5.6.5
> > 
> > _______________________________________________
> > users mailing list
> > users-JrjvKiOkagjYtjvyW6yDsg@public.gmane.org
> > https://www.nilfs.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> users-JrjvKiOkagjYtjvyW6yDsg@public.gmane.org
> https://www.nilfs.org/mailman/listinfo/users
> 
> 
> 

-- 
Jiro SEKIBA <jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>

  parent reply	other threads:[~2009-07-22  4:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-19  5:26 [PATCH 0/3] v2: write_super clean up Jiro SEKIBA
     [not found] ` <1247981182-14831-1-git-send-email-jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>
2009-07-19  5:26   ` [PATCH 1/3] nilfs2: fix disorder of nilfs_write_super in nilfs_sync_fs Jiro SEKIBA
     [not found]     ` <1247981182-14831-2-git-send-email-jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>
2009-07-19 10:53       ` Ryusuke Konishi
     [not found]         ` <20090719.195358.55746341.ryusuke-sG5X7nlA6pw@public.gmane.org>
2009-07-22  4:02           ` Jiro SEKIBA [this message]
2009-07-19  5:26   ` [PATCH 2/3] nilfs2: clean up nilfs_write_super Jiro SEKIBA
2009-07-19  5:26   ` [PATCH 3/3] nilfs2: stop using periodic write_super callback Jiro SEKIBA
     [not found]     ` <1247981182-14831-4-git-send-email-jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>
2009-07-19 11:48       ` Ryusuke Konishi
  -- strict thread matches above, loose matches on Subject: below --
2009-07-22  8:45 [PATCH 0/3] v3: write_super clean up Jiro SEKIBA
     [not found] ` <1248252323-22959-1-git-send-email-jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>
2009-07-22  8:45   ` [PATCH 1/3] nilfs2: fix disorder of nilfs_write_super in nilfs_sync_fs Jiro SEKIBA
2009-07-17  9:12 [PATCH 0/3] write_super clean up Jiro SEKIBA
     [not found] ` <1247821968-31232-1-git-send-email-jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>
2009-07-17  9:12   ` [PATCH 1/3] nilfs2: fix disorder of nilfs_write_super in nilfs_sync_fs Jiro SEKIBA
     [not found]     ` <1247821968-31232-2-git-send-email-jir-hfpbi5WX9J54Eiagz67IpQ@public.gmane.org>
2009-07-17 15:34       ` 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=878wihxt3w.wl%jir@sekiba.com \
    --to=jir-hfpbi5wx9j54eiagz67ipq@public.gmane.org \
    --cc=users-JrjvKiOkagjYtjvyW6yDsg@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