lkml.org 
[lkml]   [2001]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: generic_osync_inode() broken?


On Thu, 12 Apr 2001, Marcelo Tosatti wrote:

>
> On Thu, 12 Apr 2001, Linus Torvalds wrote:
>
> > On Thu, 12 Apr 2001, Marcelo Tosatti wrote:
> > >
> > > Comments?
> > >
> > > --- fs/inode.c~ Thu Mar 22 16:04:13 2001
> > > +++ fs/inode.c Thu Apr 12 15:18:22 2001
> > > @@ -347,6 +347,11 @@
> > > #endif
> > >
> > > spin_lock(&inode_lock);
> > > + while (inode->i_state & I_LOCK) {
> > > + spin_unlock(&inode_lock);
> > > + __wait_on_inode(inode);
> > > + spin_lock(&inode_lock);
> > > + }
> > > if (!(inode->i_state & I_DIRTY))
> > > goto out;
> > > if (datasync && !(inode->i_state & I_DIRTY_DATASYNC))
> >
> > Ehh.
> >
> > Why not just lock the inode around the thing?
> >
> > The above looks rather ugly.
>
> You mean writing a function called "lock_inode()" or whatever to basically
> do what I did ?

Oh well, its still bad.

We drop the inode_lock before calling write_inode_now() (which is broken,
too :)), which means someone can set I_LOCK under us.

I'll send you a patch to fix that one (and other callers of
write_inode_now()) later.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:25    [W:0.064 / U:4.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site