Re: generic_osync_inode() broken?

2001-04-12 Thread Marcelo Tosatti
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(_lock); > > + while

Re: generic_osync_inode() broken?

2001-04-12 Thread Marcelo Tosatti
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.cThu Apr 12 15:18:22 2001 > > > @@ -347,6 +347,11

Re: generic_osync_inode() broken?

2001-04-12 Thread Marcelo Tosatti
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(_lock); > > + while

Re: generic_osync_inode() broken?

2001-04-12 Thread Linus Torvalds
On Thu, 12 Apr 2001, Marcelo Tosatti wrote: > > Comments? > > --- fs/inode.c~ Thu Mar 22 16:04:13 2001 > +++ fs/inode.cThu Apr 12 15:18:22 2001 > @@ -347,6 +347,11 @@ > #endif > > spin_lock(_lock); > + while (inode->i_state & I_LOCK) { > +

generic_osync_inode() broken?

2001-04-12 Thread Marcelo Tosatti
Hi, generic_osync_inode() (called by generic_file_write()) is not checking if the inode being synced has the I_LOCK bit set before checking the I_DIRTY bit. AFAICS, the following problem can happen: sync() ... sync_one() reset I_DIRTY, set I_LOCK filemap_fdatasync() <-- #window

generic_osync_inode() broken?

2001-04-12 Thread Marcelo Tosatti
Hi, generic_osync_inode() (called by generic_file_write()) is not checking if the inode being synced has the I_LOCK bit set before checking the I_DIRTY bit. AFAICS, the following problem can happen: sync() ... sync_one() reset I_DIRTY, set I_LOCK filemap_fdatasync() -- #window write_inode()

Re: generic_osync_inode() broken?

2001-04-12 Thread Linus Torvalds
On Thu, 12 Apr 2001, Marcelo Tosatti wrote: Comments? --- fs/inode.c~ Thu Mar 22 16:04:13 2001 +++ fs/inode.cThu 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);

Re: generic_osync_inode() broken?

2001-04-12 Thread Marcelo Tosatti
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

Re: generic_osync_inode() broken?

2001-04-12 Thread Marcelo Tosatti
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.cThu Apr 12 15:18:22 2001 @@ -347,6 +347,11 @@ #endif

Re: generic_osync_inode() broken?

2001-04-12 Thread Marcelo Tosatti
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