linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] xfs: fix up xfs_swap_extent_forks inline extent handling
@ 2016-11-05  2:09 Eric Sandeen
  2016-11-05  2:24 ` [PATCH 1/2] " Eric Sandeen
  2016-11-05  2:27 ` [PATCH 2/2] xfs: provide helper for counting extents from if_bytes Eric Sandeen
  0 siblings, 2 replies; 9+ messages in thread
From: Eric Sandeen @ 2016-11-05  2:09 UTC (permalink / raw)
  To: linux-xfs

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-11-07 17:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-05  2:09 [PATCH 0/2] xfs: fix up xfs_swap_extent_forks inline extent handling Eric Sandeen
2016-11-05  2:24 ` [PATCH 1/2] " 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

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).