Re: nfs_dentry_iput() BUG and fix?

Steven N. Hirsch (
Tue, 20 Jan 1998 19:00:43 -0500 (EST)

On Tue, 20 Jan 1998, Bill Hawes wrote:

> Claus-Justus Heine wrote:
> > Now, nfs_flush_pages() may return NULL in two cases:
> >
> > a) no write request is pending. Fine.
> >
> > b) the write-back request is already in progress. BAD.
> >
> > b) means that whenever the write back request already has been
> > triggered the system might be caught in a loop. This happens because
> > the nfs-write-back request might sleep while waiting for the
> > nfs-server to answer. But as nfs_flush_pages() returns NULL in this
> > case the function nfs_flush_dirty_pages() not wait and return
> > immediately to its caller nfs_dentry_iput().


Let me provide another data point: I had one of my boxes blast off into
outer space with messages similar to what Claus-Justus describes. The
console was scrolling too fast for clear reading, though, and it has never
repeated itself.. I do not run SMP here.

I'll look forward to your patches.


> Hi Claus,
> Thanks for your good detective work! The nfs_flush_dirty_pages() is
> indeed supposed to wait until all requests are finished, which is why
> nfs_dentry_iput() uses it. (The iput can't proceed until all requests
> are finished, as the requests need information in the dentry and the
> dentry may disappear soon.)
> > The following patch maybe fixes the problem. It changes
> > nfs_flush_pages() to also return the write-back requests to its caller
> > if the write back request already is in progress. Maybe this has side
> > effects?
> I'll look through the code look for other side effects. I've recently
> added a NFS_WRITE_COMPLETE flag set in the nfs writeback callback to
> watch out for other problems when flushing requests.
> Regards,
> Bill