Page MenuHomeFreeBSD

Make ZFS indirect (removed) vdevs support TRIM
ClosedPublic

Authored by mav on Oct 11 2018, 9:06 PM.
Tags
Referenced Files
F82002885: D17523.diff
Wed, Apr 24, 9:30 AM
Unknown Object (File)
Mar 7 2024, 2:03 PM
Unknown Object (File)
Feb 22 2024, 7:37 PM
Unknown Object (File)
Jan 13 2024, 1:22 AM
Unknown Object (File)
Dec 23 2023, 12:15 PM
Unknown Object (File)
Dec 16 2023, 8:53 AM
Unknown Object (File)
Dec 13 2023, 7:01 PM
Unknown Object (File)
Dec 13 2023, 11:25 AM
Subscribers

Details

Summary

Without this change with TRIM enabled first free for block residing on removed vdev causes either assertion "zio->io_type == ZIO_TYPE_WRITE (0x3 == 0x2)" as in bug report 229007 if built with debug, or NULL dereference as in 228750 otherwise. Both cases are caused by the fact that vdev_indirect_io_start() has no idea about ZIO_TYPE_FREE, and also about the fact that such ZIOs have no data buffer.

This patch does two things:

  • removes assertion that there are only ZIO_TYPE_READ and ZIO_TYPE_WRITE are possible;
  • adds handling for NULL data pointers in case of ZIO_TYPE_FREE.
Test Plan

Remove vdev(s) from the pool, wait for completion, delete some large files, observe BIO_DELETE's on remaining vdevs and no crash.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

vdev_indirect.c
1270 ↗(On Diff #49031)

Placing the open brace in an ifdef, but not the closing brace, break auto-formatting and brace-detection.

mav marked an inline comment as done.Oct 11 2018, 9:15 PM
mav added inline comments.
vdev_indirect.c
1270 ↗(On Diff #49031)

That may be true, but I attempted to minimize code divergence.

vdev_indirect.c
1270 ↗(On Diff #49031)

I agree with mav, this ifdef is done the way that works best for future merges

This revision is now accepted and ready to land.Oct 12 2018, 2:00 AM
This revision was automatically updated to reflect the committed changes.