Re: [PATCH] jffs2: Re-enable write-buffering after filesystem sync

2014-08-04 Thread Jeff Harris
On Fri, Aug 1, 2014 at 3:13 PM, Al Viro wrote: > Why do we need ->wbuf_queued, anyway? It's not as if queue_delayed_work() > wouldn't do the right thing - if the sucker already has > WORK_STRUCT_PENDING_BIT > set it'll simply do nothing. And it won't spend much time finding that > out - in fact

Re: [PATCH] jffs2: Re-enable write-buffering after filesystem sync

2014-08-01 Thread Al Viro
On Fri, Aug 01, 2014 at 01:15:45PM -0400, Jeff Harris wrote: > On Fri, Aug 1, 2014 at 12:56 PM, Al Viro wrote: > > > > On Fri, Aug 01, 2014 at 12:06:12PM -0400, Jeff Harris wrote: > > > > > + spin_lock(&c->wbuf_dwork_lock); > > > cancel_delayed_work_sync(&c->wbuf_dwork); > > > > Umm...

Re: [PATCH] jffs2: Re-enable write-buffering after filesystem sync

2014-08-01 Thread Jeff Harris
On Fri, Aug 1, 2014 at 12:56 PM, Al Viro wrote: > > On Fri, Aug 01, 2014 at 12:06:12PM -0400, Jeff Harris wrote: > > > + spin_lock(&c->wbuf_dwork_lock); > > cancel_delayed_work_sync(&c->wbuf_dwork); > > Umm... Usually ..._sync in function name is a sign of potential sleeper, > and calli

Re: [PATCH] jffs2: Re-enable write-buffering after filesystem sync

2014-08-01 Thread Al Viro
On Fri, Aug 01, 2014 at 12:06:12PM -0400, Jeff Harris wrote: > + spin_lock(&c->wbuf_dwork_lock); > cancel_delayed_work_sync(&c->wbuf_dwork); Umm... Usually ..._sync in function name is a sign of potential sleeper, and calling those under a spinlock is a bad idea. And looking at the de

[PATCH] jffs2: Re-enable write-buffering after filesystem sync

2014-08-01 Thread Jeff Harris
A JFFS2 filesystem sync cancels the write buffering dirty work and performs the flush manually. However, the flag which indicates that the work is active is not reset. Thus, if a sync happens while the work is pending, the flag will never be reset resulting in future work never being started. Th