HomeFreeBSD

Fix do_link portion of ctime test

Description

Fix do_link portion of ctime test

From the man page of dirname: " Both dirname() and basename()
may modify the contents of path, so it may be desirable to pass
a copy when calling one of these functions." And in fact on linux
using dirname actually changes the contents of the passed parameter as
evident from the following failure when running the ctime test:

link(/root/zfs-mount, /root/zfs-mount/link_file)

Fix this by creating a copy of the input parameter and passing that
to dirname, thus not compromising the original parameter, allowing
the creation of hard link to succeed.

Signed-off-by: Nikolay Borisov <n.borisov.lkml@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #4977

Details

Provenance
Nikolay Borisov <n.borisov.lkml@gmail.com>Authored on Aug 16 2016, 8:00 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Aug 16 2016, 10:30 PM
Parents
rGd9eea113f8b8: It is not necessary to zero struct dbuf_hold_impl_data
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG8658115c19f8: Fix do_link portion of ctime test (authored by Nikolay Borisov <n.borisov.lkml@gmail.com>).Aug 16 2016, 10:30 PM