linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Brian Foster <bfoster@redhat.com>
Cc: stable@vger.kernel.org, linux-xfs@vger.kernel.org,
	Michal Hocko <mhocko@kernel.org>
Subject: Re: [PATCH] xfs: clear delalloc and cache on buffered write failure
Date: Tue, 21 Feb 2017 14:56:39 +0100	[thread overview]
Message-ID: <20170221135639.GA26768@kroah.com> (raw)
In-Reply-To: <1487684787-5004-1-git-send-email-bfoster@redhat.com>

On Tue, Feb 21, 2017 at 08:46:27AM -0500, Brian Foster wrote:
> commit fa7f138ac4c70dc00519c124cf7cd4862a0a5b0e upstream.
> 
> The buffered write failure handling code in
> xfs_file_iomap_end_delalloc() has a couple minor problems. First, if
> written == 0, start_fsb is not rounded down and it fails to kill off a
> delalloc block if the start offset is block unaligned. This results in a
> lingering delalloc block and broken delalloc block accounting detected
> at unmount time. Fix this by rounding down start_fsb in the unlikely
> event that written == 0.
> 
> Second, it is possible for a failed overwrite of a delalloc extent to
> leave dirty pagecache around over a hole in the file. This is because is
> possible to hit ->iomap_end() on write failure before the iomap code has
> attempted to allocate pagecache, and thus has no need to clean it up. If
> the targeted delalloc extent was successfully written by a previous
> write, however, then it does still have dirty pages when ->iomap_end()
> punches out the underlying blocks. This ultimately results in writeback
> over a hole. To fix this problem, unconditionally punch out the
> pagecache from XFS before the associated delalloc range.
> 
> Signed-off-by: Brian Foster <bfoster@redhat.com>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> CC: stable@vger.kernel.org # v4.8+
> ---
> 
> This is for stable... it fixes a latent regression exposed by
> d1908f52557b ("fs: break out of iomap_file_buffered_write on fatal
> signals"), which is to be backported to 4.8+ stable kernels.

For XFS patches, I need an explicit ack from the maintainer before
applying them, as per their instructions in the past...

thanks,

greg k-h

  reply	other threads:[~2017-02-21 13:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21 13:46 [PATCH] xfs: clear delalloc and cache on buffered write failure Brian Foster
2017-02-21 13:56 ` Greg KH [this message]
2017-02-21 14:40   ` Christoph Hellwig
2017-02-21 14:47     ` Greg KH
2017-02-21 16:33   ` Darrick J. Wong

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=20170221135639.GA26768@kroah.com \
    --to=greg@kroah.com \
    --cc=bfoster@redhat.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=mhocko@kernel.org \
    --cc=stable@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).