From 7346bdff4366b2ea41714341bb7ed0dc0d3f4426 Mon Sep 17 00:00:00 2001 From: liqiang Date: Wed, 20 Dec 2023 16:33:17 +0800 Subject: [PATCH 6/6] fix bug in get link Signed-off-by: liqiang --- qtfs/qtfs/sb.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/qtfs/qtfs/sb.c b/qtfs/qtfs/sb.c index 71aba49..77ff15b 100644 --- a/qtfs/qtfs/sb.c +++ b/qtfs/qtfs/sb.c @@ -1453,10 +1453,7 @@ const char *qtfs_getlink(struct dentry *dentry, qtfs_conn_put_param(pvar); return ERR_PTR(-ENOENT); } - if (fsinfo->mnt_path) - len = strlen(fsinfo->mnt_path) + strlen(rsp->path) + 1; - else - len = strlen(rsp->path) + 1; + len = strlen(rsp->path) + 1; if (len > MAX_PATH_LEN || len == 0) { qtfs_err("qtfs getlink failed. path name too long:%s - %s\n", fsinfo->mnt_path, rsp->path); qtfs_conn_put_param(pvar); @@ -1468,8 +1465,6 @@ const char *qtfs_getlink(struct dentry *dentry, return ERR_PTR(-ENOMEM); } memset(link, 0, len); - if (rsp->path[0] == '/' && fsinfo->mnt_path) - strcat(link, fsinfo->mnt_path); strcat(link, rsp->path); qtfs_info("get link success <%s>\n", link); -- 2.37.1 (Apple Git-137.1)