@@ -579,7 +579,8 @@ def __init__(self, pool, name, parent=None):
579579 # - M The path has been modified
580580 # - R The path has been renamed
581581 # - V The path has been moved
582- def get_diffs (self , snap_from , snap_to = None , include = None , exclude = None , file_type = None , chg_type = None , get_move :bool = False ):
582+ # ign_xattrdir - Filter out <xattrdir> entries
583+ def get_diffs (self , snap_from , snap_to = None , include = None , exclude = None , file_type = None , chg_type = None , get_move :bool = False , ign_xattrdir :bool = False ):
583584 self .assertHaveMounts ()
584585 assert self .mounted , "Cannot get diffs for Unmounted Dataset. Verify mounted flag on Dataset before calling"
585586
@@ -631,6 +632,10 @@ def __row(s):
631632 rows = list (map (lambda s : __row (s ), stdout .splitlines ()))
632633 diffs = []
633634 for i , row in enumerate (rows ):
635+
636+ if ign_xattrdir and row [3 ].find ('/<xattrdir>' ) > - 1 :
637+ continue
638+
634639 # if i == 429:
635640 # print("HERE")
636641 d = Diff (row , snap_left , snap_right , get_move = get_move )
@@ -832,14 +837,16 @@ def __init__(self, row, snap_left, snap_right, get_move:bool=False):
832837 else :
833838 raise Exception (f"Unexpected len: { len (row )} . Row = { row } " )
834839
840+ # Fix issue related to https://github.com/openzfs/zfs/issues/6318
841+ path = path .replace ("\\ 0040" , " " )
842+ if path_new :
843+ path_new = path_new .replace ("\\ 0040" , " " )
844+
835845 # Derrive Move change type
836846 if get_move and file_type == 'F' and chg_type == 'R' :
837847 if splitPath (path )[1 ] != splitPath (path_new )[1 ]:
838848 chg_type = 'V'
839849
840- # Fix issue related to https://github.com/openzfs/zfs/issues/6318
841- path = path .replace ("\\ 0040" , " " )
842-
843850 chg_time = datetime .fromtimestamp (int (inode_ts [:inode_ts .find ('.' )]))
844851 self .chg_ts = inode_ts
845852 self .chg_time = chg_time
0 commit comments