All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 2/3] xfs: truncate should remove all blocks, not just to the end of the page cache
Date: Fri, 10 Jan 2020 03:52:47 -0800	[thread overview]
Message-ID: <20200110115247.GB19577@infradead.org> (raw)
In-Reply-To: <157859547075.163942.7214434913691255010.stgit@magnolia>

On Thu, Jan 09, 2020 at 10:44:30AM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> xfs_itruncate_extents_flags() is supposed to unmap every block in a file
> from EOF onwards.  Oddly, it uses s_maxbytes as the upper limit to the
> bunmapi range, even though s_maxbytes reflects the highest offset the
> pagecache can support, not the highest offset that XFS supports.
> 
> The result of this confusion is that if you create a 20T file on a
> 64-bit machine, mount the filesystem on a 32-bit machine, and remove the
> file, we leak everything above 16T.  Fix this by capping the bunmapi
> request at the maximum possible block offset, not s_maxbytes.

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

  reply	other threads:[~2020-01-10 11:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-09 18:44 [PATCH v3 0/3] xfs: fix maxbytes problems on 32-bit systems Darrick J. Wong
2020-01-09 18:44 ` [PATCH 1/3] xfs: introduce XFS_MAX_FILEOFF Darrick J. Wong
2020-01-10 11:52   ` Christoph Hellwig
2020-01-09 18:44 ` [PATCH 2/3] xfs: truncate should remove all blocks, not just to the end of the page cache Darrick J. Wong
2020-01-10 11:52   ` Christoph Hellwig [this message]
2020-01-09 18:44 ` [PATCH 3/3] xfs: fix s_maxbytes computation on 32-bit kernels Darrick J. Wong
  -- strict thread matches above, loose matches on Subject: below --
2020-01-08  4:17 [PATCH v2 0/3] xfs: fix maxbytes problems on 32-bit systems Darrick J. Wong
2020-01-08  4:17 ` [PATCH 2/3] xfs: truncate should remove all blocks, not just to the end of the page cache Darrick J. Wong
2020-01-08  8:11   ` Christoph Hellwig
2020-01-08 16:37     ` 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=20200110115247.GB19577@infradead.org \
    --to=hch@infradead.org \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.