Page MenuHomeFreeBSD

Fix panic when resizing zvol
ClosedPublic

Authored by smh on Dec 12 2014, 10:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 28 2024, 8:19 AM
Unknown Object (File)
Dec 23 2023, 9:17 AM
Unknown Object (File)
Nov 28 2023, 7:10 PM
Unknown Object (File)
Nov 26 2023, 10:32 AM
Unknown Object (File)
Nov 25 2023, 9:25 PM
Unknown Object (File)
Nov 22 2023, 10:05 PM
Unknown Object (File)
Nov 21 2023, 8:05 PM
Unknown Object (File)
Nov 21 2023, 8:00 PM
Subscribers
None

Details

Reviewers
xmj
delphij
mav
smh
Summary

Fix zvol resize panic due to recursion on dp_config_rwlock

This change elimiates additional differences from upstream including changes missed during the merge of upstream

The upstream change "3464 zfs synctask code needs restructuring" restructured zvol_set_volsize to avoid the recursion on dp_config_rwlock, but this was missed when originally merged in by r248571.

These changes also relied on bring in changes from upstream:
3557 dumpvp_size is not updated correctly when a dump zvol's size is changed
which where also not present.

Additionally performed a direct comparision and diff minimisation from current upstream version (b515258), including using a #define to map zfsdev_state_lock to spa_namespace_lock.

Finally this reverts the change to the uio_loffset validation checks in zvol_read and zvol_write as the processing loops would never process uio_loffset = volsize made by r264145.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

smh retitled this revision from to Fix panic when resizing zvol.
smh updated this object.
smh edited the test plan for this revision. (Show Details)
smh updated this object.
smh added a reviewer: mav.

@mav is it right to revert the change to the validation of uio_loffset?

I can confirm that this patch fixes the issue I saw with FreeBSD 11.0-CURRENT builds with the GENERIC and debug stuff (WITNESS, INVARIANTS):

Before, I saw the following assert error and kernel panic when doing 'zfs set volsize=2*(current volsize) zpool/path/to/zvol':

solaris assert: !rrw_held(&dp->dp_config_rwlock, RW_READER), file: /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_po ..

Now, it works fantastically. :-)

xmj edited edge metadata.
This revision is now accepted and ready to land.Dec 14 2014, 9:05 PM

For reference on the uio_offset change I've found the following which indicates this was fixed upstream, so it could be a miss-merge on our part:
https://github.com/illumos/illumos-gate/commit/73ec3d9c430feaac0947f81e1a6e8f3df2a13894
6596419 zvol character (raw) devices allow read/write past the end of the device

Looking to get this committed early next week, if anyone needs more time to look though this please lmk, otherwise based on xmj's positive feedback I'll get this into the tree.

smh edited edge metadata.

Previous fix to uio_loffset by r264145 was correct, it fixes broken EOF detection in upstream.

This revision now requires review to proceed.Dec 22 2014, 2:49 PM
smh added a reviewer: smh.
This revision is now accepted and ready to land.Dec 22 2014, 6:43 PM

This is closed by:

  • r276069
  • r276066
  • r276063