[LU-2231] ZFS OSD not setting dnode parent field Created: 30/Mar/12  Updated: 19/Apr/13  Resolved: 14/Mar/13

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

Type: Bug Priority: Major
Reporter: Andreas Dilger Assignee: Mikhail Pershin
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates LU-2449 ZFS osd to fix . and .. handling Resolved
Story Points: 2
Severity: 3
Project: Orion
Rank (Obsolete): 2966

 Description   

File foo created from a lustre client:

Object  lvl   iblk   dblk  dsize  lsize   %full  type
   197    1    16K   128K     1K   128K    0.00  ZFS plain file
                                    192   bonus  System attributes
    dnode flags: USED_BYTES USERUSED_ACCOUNTED SPILL_BLKPTR
    dnode maxblkid: 0
    path    ???<object#197>
    uid     840000038
    gid     840000038
    atime   Fri Mar 30 01:51:12 2012
    mtime   Fri Mar 30 01:51:23 2012
    ctime   Fri Mar 30 01:51:23 2012
    crtime  Fri Mar 30 01:51:12 2012
    gen     1015
    mode    100644
    size    0
    parent  0
    links   1
    pflags  0
    rdev    0x0000000000000000

It appears that the SA_ZPL_PARENT() is used in several places to process directories (e.g. avoiding circular directory references), so it definitely needs to be set for directories. It also seems to be set for regular files, but it is difficult to determine if it is required or not.

Since there is only a single parent directory field, we should determine what the behaviour of the parent field is for hard links and renames:

mkdir a b
ls -li       # get inode numbers
zdb {check parent} .
touch a/foo
zdb {check parent} a/foo
ln a/foo b/bar
zdb {check parent} b/bar
rm {link from current parent}
zdb {check parent of other link}

touch a/baz
zdb {check parent} a/baz
mv a/baz b/baz
zdb {check parent} b/baz

I suspect that the parent will be updated on rename (it would have to be for directories), but I'm unsure what will happen if the current parent link will be dropped. I suspect it will be set to 0.



 Comments   
Comment by Johann Lombardi (Inactive) [ 30/Mar/12 ]

Andreas, isn't this bug the same as ORI-610? Or maybe you wanted to focus on the parent field in this one?

Comment by Andreas Dilger [ 30/Mar/12 ]

Sorry, I thought "clone" would include the comments. This one is only for the parent field.

Comment by Johann Lombardi (Inactive) [ 05/Apr/12 ]

Reassign to Mike as per Ian.

Comment by Alex Zhuravlev [ 14/Mar/13 ]

I think this has been fixed in master yet.

Comment by Andreas Dilger [ 14/Mar/13 ]

Fixed by Alex as part of LU-2449.

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