Page MenuHomeFreeBSD

loader: update symlink support in zfs reader
ClosedPublic

Authored by tsoome on Feb 21 2017, 8:27 PM.
Tags
None
Referenced Files
F81580406: D9706.diff
Thu, Apr 18, 10:51 AM
Unknown Object (File)
Mon, Apr 15, 11:35 PM
Unknown Object (File)
Mon, Apr 15, 11:35 PM
Unknown Object (File)
Mon, Apr 15, 10:57 PM
Unknown Object (File)
Mon, Apr 15, 10:57 PM
Unknown Object (File)
Mon, Apr 15, 10:57 PM
Unknown Object (File)
Mon, Apr 15, 1:40 PM
Unknown Object (File)
Mar 20 2024, 1:20 AM
Subscribers

Details

Summary

As the current zfs file system is providing symlink via system attributes, need to update the code accordingly.

Test Plan

Tested by browsing and reading different symlinks and by using names like /usr/bin/../lib, bin/.., etc/., etc/./inet, ./bin

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 7626
Build 7774: arc lint + arc unit

Event Timeline

tsoome retitled this revision from to loader: update symlink support in zfs reader.
tsoome updated this object.
tsoome edited the test plan for this revision. (Show Details)
tsoome added reviewers: allanjude, imp.
avg edited edge metadata.

LGTM

This revision is now accepted and ready to land.Feb 22 2017, 8:20 AM
smh requested changes to this revision.Feb 22 2017, 9:31 AM
smh edited edge metadata.
smh added inline comments.
sys/boot/zfs/zfsimpl.c
2273

All of the above are only used in == DMU_OT_SA case so could be moved into that block with char *p;

2294

Does the boot code make use of SET_ERROR, I'm guessing not?

2382

Missing space

This revision now requires changes to proceed.Feb 22 2017, 9:31 AM
tsoome added inline comments.
sys/boot/zfs/zfsimpl.c
2294

no, it does not.

tsoome edited edge metadata.
tsoome marked an inline comment as done.

Fixes suggested by smh.

sys/boot/zfs/zfsimpl.c
2282

Just spotted that if you invert the condition you get an arguably cleaner flow e.g.

 else {
    if ((dn->dn_flags & DNODE_FLAG_SPILL_BLKPTR) == 0)
        return (EIO);

    blkptr_t *bp = &dn->dn_spill;

    size = BP_GET_LSIZE(bp);
    ...
}
tsoome edited edge metadata.

svn update; and clean up the inverted if statement.

smh edited edge metadata.

LGTM

This revision is now accepted and ready to land.Feb 22 2017, 1:42 PM
allanjude edited edge metadata.

Approved By: allanjude

This revision was automatically updated to reflect the committed changes.