Project

General

Profile

Bug #5164

space_map_max_blksz causes panic, does not work

Added by Matthew Ahrens about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Category:
zfs - Zettabyte File System
Start date:
2014-09-13
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

Setting space_map_max_blksz causes the system to panic:

assertion failed: dmu_object_set_blocksize(sm->sm_os, space_map_object(sm),
newsz, 0, tx) 0 (0x30 0x0), file: ../../common/fs/zfs/space_map.c, line:
275

space_map_set_blocksize+0x1a2(ffffff01cf350210, 1058, ffffff01df924840)
space_map_write+0x116(ffffff01cf350210, ffffff01cf421d80, 1, ffffff01df924840)
metaslab_sync+0xee(ffffff01cf297540, 324b)
vdev_sync+0x7f(ffffff01cf18fac0, 324b)
spa_sync+0x343(ffffff01cf037000, 324b)
txg_sync_thread+0x21f(ffffff01ce3bf0c0)
thread_start+8()

The problem is that dmu_objset_set_blocksize() will fail if the object has
multiple blocks.

Fix is to ignore failures from dmu_objset_set_blocksize().

This fixes the panic, however space_map_max_blksz now has no effect, because
even though condensing truncates the file, its blocksize still can't be changed
because it used to have multiple blocks.

Fix is for space_map_truncate() to always do space_map_reallocate(). (Note
that given the desire to reset the blocksize to the minimum upon truncation,
there is no alternative to always reallocating. That said, it is not clear to
me why we would care to do that. Spacemaps typically use more than 128K, so it
would seem fine to me if we made space_map_truncate() reallocate if the
blocksize != space_map_max_blksz.)

Now the spacemap blocksize changes. However, metaslab_group_histogram_verify()
breaks, because space_map_truncate() clears the spacemap's histogram.

Fix is to verify the histogram before condensing.

History

#1

Updated by Electric Monk about 5 years ago

  • % Done changed from 0 to 100
  • Status changed from New to Closed

git commit b1be2892dd07cf9a97d47ad06334cdc879196aaf

commit  b1be2892dd07cf9a97d47ad06334cdc879196aaf
Author: Matthew Ahrens <mahrens@delphix.com>
Date:   2014-09-16T19:53:58.000Z

    5164 space_map_max_blksz causes panic, does not work
    5165 zdb fails assertion when run on pool with recently-enabled spacemap_histogram feature
    Reviewed by: Christopher Siden <christopher.siden@delphix.com>
    Reviewed by: George Wilson <george.wilson@delphix.com>
    Reviewed by: Saso Kiselkov <skiselkov.ml@gmail.com>
    Approved by: Dan McDonald <danmcd@omniti.com>

Also available in: Atom PDF