]> granicus.if.org Git - zfs/commit
Fix do_link portion of ctime test
authorNikolay Borisov <n.borisov.lkml@gmail.com>
Tue, 16 Aug 2016 20:00:16 +0000 (23:00 +0300)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 16 Aug 2016 22:30:20 +0000 (15:30 -0700)
commit8658115c19f84b30d68402c32a33a2157c97e4f1
treec26f5c5515bec93c6e365798a62e5c283c149a01
parentd9eea113f8b8988a8ec4f9c73b717c7311322348
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
tests/zfs-tests/tests/functional/ctime/ctime_001_pos.c