xfs
[Top] [All Lists]

Re: [PATCH 2/5] [XFS] Make inode flush at ENOSPC synchronous

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH 2/5] [XFS] Make inode flush at ENOSPC synchronous
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 16 Mar 2009 21:46:06 +1100
Cc: xfs@xxxxxxxxxxx, mpatocka@xxxxxxxxxx
In-reply-to: <20090316091235.GB2636@xxxxxxxxxxxxx>
Mail-followup-to: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx, mpatocka@xxxxxxxxxx
References: <1237116707-25793-1-git-send-email-david@xxxxxxxxxxxxx> <1237116707-25793-3-git-send-email-david@xxxxxxxxxxxxx> <20090316091235.GB2636@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.18 (2008-05-17)
On Mon, Mar 16, 2009 at 05:12:35AM -0400, Christoph Hellwig wrote:
> On Sun, Mar 15, 2009 at 10:31:44PM +1100, Dave Chinner wrote:
> >     } else {
> > +           int enospc = 0;
> > +           ssize_t ret2 = 0;
> > +
> > +write_retry:
> >             xfs_rw_enter_trace(XFS_WRITE_ENTER, xip, (void *)iovp, segs,
> >                             *offset, ioflags);
> > -           ret = generic_file_buffered_write(iocb, iovp, segs,
> > +           ret2 = generic_file_buffered_write(iocb, iovp, segs,
> >                             pos, offset, count, ret);
> > +           /*
> > +            * if we just got an ENOSPC, flush the inode now we
> > +            * aren't holding any page locks and retry *once*
> > +            */
> > +           if (ret2 == -ENOSPC && !enospc) {
> > +                   error = xfs_flush_pages(xip, 0, -1, 0, FI_NONE);
> > +                   if (error)
> > +                           goto out_unlock_internal;
> > +                   enospc = 1;
> > +                   goto write_retry;
> > +           }
> > +           ret = ret2;
> 
> Just use filemap_fdatawrite here directly..

OK. will fix.

-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>