infra: fix comparison

Under weird circumstances, when a new symlink contents was just a
shortened version (prefix) of the old one, the symlink was not updated.
This commit is contained in:
Thomas Schoebel-Theuer 2015-12-17 11:04:33 +01:00 committed by Thomas Schoebel-Theuer
parent d18c60f232
commit 3eedff125d

View File

@ -616,7 +616,7 @@ int get_inode(char *newpath, struct mars_dent *dent)
status = inode->i_op->readlink(path.dentry, link, len + 1);
link[len] = '\0';
if (status < 0 ||
(dent->new_link && !strncmp(dent->new_link, link, len))) {
(dent->new_link && !strcmp(dent->new_link, link))) {
brick_string_free(link);
} else {
MARS_IO("symlink '%s' -> '%s' (%s) status = %d\n", newpath, link, dent->new_link ? dent->new_link : "", status);