Bug 221133 - ZFS failure on partition resize
Summary: ZFS failure on partition resize
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 11.1-RELEASE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-fs mailing list
Keywords: regression
Depends on:
Reported: 2017-08-01 02:42 UTC by Jonathan Chen
Modified: 2019-12-07 18:40 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Chen 2017-08-01 02:42:32 UTC
ZFS on 11.1-RELEASE does not like resized partitions.

The following was done on a USB drive to demonstrate the failure-case, but it applies to any drive in general (as I found out with my root partition).

~,2:30pm# gpart show -l da0    
=>      34  30529469  da0  GPT  (15G)  
        34         6       - free -  (3.0K)  
        40   8388608    1  fat-shiv  (4.0G)  
   8388648  22140855       - free -  (11G)  
~,2:30pm# gpart add -t freebsd-zfs -s 5G -l test1 da0    
da0p2 added  
1.irontree:~,2:31pm# gpart show -l da0    
=>      34  30529469  da0  GPT  (15G)  
        34         6       - free -  (3.0K)  
        40   8388608    1  fat-shiv  (4.0G)  
   8388648  10485760    2  test1  (5.0G)  
  18874408  11655095       - free -  (5.6G)  
~,2:31pm# zpool create test1 gpt/test1    
~,2:31pm# zpool status test1    
  pool: test1  
 state: ONLINE  
  scan: none requested  
        NAME         STATE     READ WRITE CKSUM  
        test1        ONLINE       0     0     0  
          gpt/test1  ONLINE       0     0     0  
errors: No known data errors  
~,2:32pm# zpool export test1    
~,2:32pm# gpart resize -i2 da0    
da0p2 resized  
~,2:32pm# zpool import test1    
Assertion failed: (avl_find() succeeded inside avl_add()), file /usr/src/sys/cdd
l/contrib/opensolaris/common/avl/avl.c, line 649.  
Abort (core dumped)

The same set of commands will work with 10.3-RELEASE; which is what I had to do to recover my zpool.

The following entries were found in /var/log/messages:

Aug  1 14:32:50 irontree kernel: g_access(918): provider gpt/test1 has error
Aug  1 14:32:50 irontree last message repeated 2 times
Aug  1 14:32:50 irontree kernel: g_dev_taste: make_dev_p() failed (gp->name=gpt/test1, error=17)
Comment 1 Jonathan Chen 2018-08-13 01:54:28 UTC
Still fails in 11.2-STABLE at r337369
Comment 2 Jonathan Chen 2019-12-07 18:40:07 UTC
Restested on 12.1-STABLE, r354267; and it now works again.