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 <[email protected]>
> > ---
> >  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
> > [email protected]
> > https://www.nilfs.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> [email protected]
> https://www.nilfs.org/mailman/listinfo/users
> 
> 
> 

-- 
Jiro SEKIBA <[email protected]>
_______________________________________________
users mailing list
[email protected]
https://www.nilfs.org/mailman/listinfo/users

Reply via email to