linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@redhat.com>
To: linux-xfs <linux-xfs@vger.kernel.org>
Subject: [PATCH 0/2] xfs: fix up xfs_swap_extent_forks inline extent handling
Date: Fri, 4 Nov 2016 21:09:25 -0500	[thread overview]
Message-ID: <d279d52e-49f6-6fc2-c78b-0054d7ee0a1e@redhat.com> (raw)

xfs_swap_extent_forks() was wrongly using di_nextents
(on-disk extents) for determining whether the /incore/
inode could keep extents inline.  The code should be testing
if_bytes, not di_nextents, to make this determination.

The mistake led to an oops in some situations when running
xfs_fsr.

Throughout the code we have this sort of open-coded handling
like:

nextents = ip->i_df.if_bytes / (uint)sizeof(xfs_bmbt_rec_t);

so patch 2 creates a helper for that and uses it throughout
the codebase.

I should maybe also create a helper for the things that expand
it back out, i.e. nextents * (uint)sizeof(xfs_bmbt_rec_t) but
that seems error prone...

-Eric

             reply	other threads:[~2016-11-05  2:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-05  2:09 Eric Sandeen [this message]
2016-11-05  2:24 ` [PATCH 1/2] xfs: fix up xfs_swap_extent_forks inline extent handling Eric Sandeen
2016-11-07 14:57   ` Brian Foster
2016-11-07 16:38     ` Eric Sandeen
2016-11-05  2:27 ` [PATCH 2/2] xfs: provide helper for counting extents from if_bytes Eric Sandeen
2016-11-06 22:02   ` Dave Chinner
2016-11-07 16:45     ` Eric Sandeen
2016-11-07 14:58   ` Brian Foster
2016-11-07 17:35   ` [PATCH 2/2 V2] " Eric Sandeen

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=d279d52e-49f6-6fc2-c78b-0054d7ee0a1e@redhat.com \
    --to=sandeen@redhat.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 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).