All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] ext4: Fix softlockups in ext4_seek_data()
@ 2016-03-03 10:23 Jan Kara
  2016-03-03 10:23 ` [PATCH 1/5] ext4: Fix setting of referenced bit in ext4_es_lookup_extent() Jan Kara
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Jan Kara @ 2016-03-03 10:23 UTC (permalink / raw)
  To: Ted Tso; +Cc: linux-ext4, Jan Kara

Hello,

I've seen several reports of softlockups somewhere under ext4_seek_data()
usually during fuzzing. The culprit is that ext4_seek_data() iterates holes
block by block and thus suitably crafted file can make ext4_seek_data() do
a *lot* of lookups using ext4_map_blocks() which is slow. This is really
unnecessary since in principle we have all the information for efficient
skipping of holes, just a layer below. Even for indirect-block based files
we can easily reduce the asymptotic complexity of hole iteration from linear
to logarithmic albeit with a relatively large constant.

Patches 1 and 4 in this series are independent cleanups I've spotted while
changing the code, they can be merged separately. Patches 2 and 3 are
preparatory changes which make ext4_map_blocks() return hole size in
map->m_len field. We still return 0 from ext4_map_blocks() calls finding hole
to maintain backward compatibility of this function and it still makes sense
as such - it still returns the number of allocated blocks starting at given
logical offset. Patch 5 then uses the newly available information in
ext4_seek_data() and it also rewrites ext4_seek_hole() so that both functions
are symmetric.

								Honza

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

end of thread, other threads:[~2016-03-10  3:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-03 10:23 [PATCH 0/5] ext4: Fix softlockups in ext4_seek_data() Jan Kara
2016-03-03 10:23 ` [PATCH 1/5] ext4: Fix setting of referenced bit in ext4_es_lookup_extent() Jan Kara
2016-03-10  3:45   ` Theodore Ts'o
2016-03-03 10:23 ` [PATCH 2/5] ext4: Factor out determining of hole size Jan Kara
2016-03-10  3:54   ` Theodore Ts'o
2016-03-03 10:23 ` [PATCH 3/5] ext4: Return hole from ext4_map_blocks() Jan Kara
2016-03-03 10:23 ` [PATCH 4/5] ext4: Cleanup handling of bh->b_state in DAX mmap Jan Kara
2016-03-03 10:23 ` [PATCH 5/5] ext4: More efficient SEEK_DATA implementation Jan Kara

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.