From: Christoph Hellwig <hch@infradead.org>
To: Lachlan McIlroy <lachlan@sgi.com>
Cc: xfs-dev <xfs-dev@sgi.com>, xfs-oss <xfs@oss.sgi.com>
Subject: Re: [PATCH] Wait for all I/O on truncate to zero file size
Date: Wed, 24 Sep 2008 10:43:06 -0400 [thread overview]
Message-ID: <20080924144306.GC349@infradead.org> (raw)
In-Reply-To: <48D87908.80408@sgi.com>
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 parent reply other threads:[~2008-09-24 14:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-23 5:05 [PATCH] Wait for all I/O on truncate to zero file size Lachlan McIlroy
2008-09-24 14:43 ` Christoph Hellwig [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080924144306.GC349@infradead.org \
--to=hch@infradead.org \
--cc=lachlan@sgi.com \
--cc=xfs-dev@sgi.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox