[LU-11507] lustre doesn't build against zfs master: refcount_add missing Created: 11/Oct/18  Updated: 07/Nov/18  Resolved: 06/Nov/18

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Upstream
Fix Version/s: Lustre 2.12.0

Type: Bug Priority: Critical
Reporter: Tony Hutter Assignee: Tony Hutter
Resolution: Fixed Votes: 0
Labels: None
Environment:

Centos 7


Attachments: File refcount_add.diff    
Issue Links:
Related
is related to LU-11393 Update ZFS Version to 0.7.11 Resolved
Epic/Theme: zfs
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

The latest lustre will not build against ZFS master:

  CC [M]  /home/hutter/lustre-release/lustre/osd-zfs/osd_handler.o
 In file included from /home/hutter/lustre-release/lustre/osd-zfs/osd_handler.c:52:0:
 /home/hutter/lustre-release/lustre/osd-zfs/osd_internal.h: In function 'osd_sa_handle_get':
 /home/hutter/lustre-release/lustre/osd-zfs/osd_internal.h:929:2: error: implicit declaration of function 'refcount_add' [-Werror=implicit-function-declaration]
  refcount_add(&dn->dn_bonus->db_holds, osd_obj_tag);

refcount_add was removed in ZFS in:

Linux 4.19-rc3+ compat: Remove refcount_t compat (https://github.com/zfsonlinux/zfs/pull/7932).

That patch is expected to be included in zfs-0.7.12 as well.

Lustre should be updated to use zfs_refcount_add() if it exists, and then fall back to refcount_add if not.



 Comments   
Comment by Tony Hutter [ 11/Oct/18 ]

I uploaded a patch that works for me against zfs master.  It also needs https://github.com/zfsonlinux/zfs/pull/8014 to completely build.  I will test it against an old zfs without that patch to test the case where zfs_refcount_add does not exist.

Comment by Peter Jones [ 11/Oct/18 ]

Tony

Can you push the patch into Gerrit so we can test/review easily and get this landed?

Peter

Comment by Tony Hutter [ 11/Oct/18 ]

Sure, I'll setup a gerrit account and I submit it

Comment by Gerrit Updater [ 12/Oct/18 ]

Tony Hutter (hutter2@llnl.gov) uploaded a new patch: https://review.whamcloud.com/33359
Subject: LU-11507 osd-zfs: Use zfs_refcount_add if available
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: f52d3e56f2338be435c434444243ae423ec06504

Comment by Gerrit Updater [ 06/Nov/18 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33359/
Subject: LU-11507 osd-zfs: Use zfs_refcount_add if available
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 89f8ee7f964d2598939ca483f522d6918915962c

Comment by Peter Jones [ 06/Nov/18 ]

Landed for 2.12

Comment by Gerrit Updater [ 07/Nov/18 ]

Nathaniel Clark (nclark@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/33605
Subject: LU-11507 osd-zfs: Use zfs_refcount_add if available
Project: fs/lustre-release
Branch: b2_10
Current Patch Set: 1
Commit: ea49a168ec676c9b35e6a48c56d5427f51a40894

Generated at Sat Feb 10 02:44:28 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.