| To: | Lachlan McIlroy <lachlan@xxxxxxx> |
|---|---|
| Subject: | Re: [PATCH] Wait for all I/O on truncate to zero file size |
| From: | Christoph Hellwig <hch@xxxxxxxxxxxxx> |
| Date: | Wed, 24 Sep 2008 10:43:06 -0400 |
| Cc: | xfs-dev <xfs-dev@xxxxxxx>, xfs-oss <xfs@xxxxxxxxxxx> |
| In-reply-to: | <48D87908.80408@xxxxxxx> |
| References: | <48D87908.80408@xxxxxxx> |
| User-agent: | Mutt/1.5.18 (2008-05-17) |
On Tue, Sep 23, 2008 at 03:05:12PM +1000, Lachlan McIlroy wrote: > It's possible to have outstanding xfs_ioend_t's queued when the file > size is zero. This can happen in the direct I/O path when a direct > I/O write fails due to ENOSPC. In this case the xfs_ioend_t will still > be queued (ie xfs_end_io_direct() does not know that the I/O failed so > can't force the xfs_ioend_t to be flushed synchronously). > > When we truncate a file on unlink we don't know to wait for these > xfs_ioend_ts and we can have a use-after-free situation if the inode > is reclaimed before the xfs_ioend_t is finally processed. > > As was suggested by Dave Chinner lets wait for all I/Os to complete > when truncating the file size to zero. Looks good. |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: [PATCH v2] Use atomic_t and wait_event to track dquot pincount, Christoph Hellwig |
|---|---|
| Next by Date: | Re: RFC: adding a crc field to xfs_buf_log_format_t, Christoph Hellwig |
| Previous by Thread: | [PATCH] Wait for all I/O on truncate to zero file size, Lachlan McIlroy |
| Next by Thread: | [RFC 0/3] Future Directions for XFS...., Dave Chinner |
| Indexes: | [Date] [Thread] [Top] [All Lists] |