From 03a44c52e46277b9b4a0e595005430ebe0bca78b Mon Sep 17 00:00:00 2001 From: yangxin <245051644@qq.com> Date: Thu, 15 Dec 2022 10:26:31 +0800 Subject: [PATCH] Fix inode sync error between client and server. Signed-off-by: yangxin <245051644@qq.com> (cherry picked from commit e556669024b48179538e59c99b02bc8f1fd1bbe1) --- ...sync-error-between-client-and-server.patch | 42 +++++++++++++++++++ dpu-utilities.spec | 5 ++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 0004-Fix-inode-sync-error-between-client-and-server.patch diff --git a/0004-Fix-inode-sync-error-between-client-and-server.patch b/0004-Fix-inode-sync-error-between-client-and-server.patch new file mode 100644 index 0000000..4a58f17 --- /dev/null +++ b/0004-Fix-inode-sync-error-between-client-and-server.patch @@ -0,0 +1,42 @@ +From 86c4ef6bc5d845b0c1919ddb80702f2896a75d4f Mon Sep 17 00:00:00 2001 +From: yangxin <245051644@qq.com> +Date: Thu, 15 Dec 2022 10:14:53 +0800 +Subject: [PATCH 4/4] Fix inode sync error between client and server. + +Signed-off-by: yangxin <245051644@qq.com> +--- + qtfs/qtfs/sb.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/qtfs/qtfs/sb.c b/qtfs/qtfs/sb.c +index 5fd2c8f..aad153b 100644 +--- a/qtfs/qtfs/sb.c ++++ b/qtfs/qtfs/sb.c +@@ -1146,6 +1146,7 @@ int qtfs_getattr(const struct path *path, struct kstat *stat, u32 req_mask, unsi + struct qtfs_sock_var_s *pvar = qtfs_conn_get_param(); + struct qtreq_getattr *req; + struct qtrsp_getattr *rsp; ++ struct inode *inode = path->dentry->d_inode; + int ret; + + if (!pvar) { +@@ -1172,8 +1173,14 @@ int qtfs_getattr(const struct path *path, struct kstat *stat, u32 req_mask, unsi + return ret; + } + *stat = rsp->stat; +- qtfs_debug("qtfs getattr success:<%s> blksiz:%u size:%lld mode:%o ino:%llu pathino:%lu.\n", req->path, rsp->stat.blksize, +- rsp->stat.size, rsp->stat.mode, rsp->stat.ino, path->dentry->d_inode->i_ino); ++ qtfs_debug("qtfs getattr success:<%s> blksiz:%u size:%lld mode:%o ino:%llu pathino:%lu. %s\n", req->path, rsp->stat.blksize, ++ rsp->stat.size, rsp->stat.mode, rsp->stat.ino, inode->i_ino, rsp->stat.ino != inode->i_ino ? "delete current inode" : ""); ++ if (inode->i_ino != rsp->stat.ino) { ++ if (inode->i_nlink > 0){ ++ drop_nlink(inode); ++ } ++ d_invalidate(path->dentry); ++ } + qtfs_conn_put_param(pvar); + return 0; + } +-- +2.33.0 + diff --git a/dpu-utilities.spec b/dpu-utilities.spec index 0bef0f2..3a6ec0a 100644 --- a/dpu-utilities.spec +++ b/dpu-utilities.spec @@ -1,7 +1,7 @@ Name: dpu-utilities Summary: openEuler dpu utilities Version: 1.1 -Release: 2 +Release: 3 License: GPL-2.0 Source: https://gitee.com/openeuler/dpu-utilities/repository/archive/v%{version}.tar.gz ExclusiveOS: linux @@ -15,6 +15,7 @@ BuildRequires: golang Patch0: 0001-add-path-put-in-xattr-set.patch Patch1: 0002-Add-drop-link-and-dentry-invalid-in-unlink-and-rmdir.patch Patch2: 0003-enable-rexec-read-net-addr-from-config-file.patch +Patch3: 0004-Fix-inode-sync-error-between-client-and-server.patch %description This package contains the software utilities on dpu. @@ -107,6 +108,8 @@ sed -i '/# product cut_conf/a\dpuos kiwi/minios/cfg_dpuos yes' /opt/imageT sed -i '//a\dpuos 1 rpm-dir euler_base' /opt/imageTailor/repos/RepositoryRule.conf %changelog +* Thu Dec 15 2022 YangXin <245051644@qq.com> 1.1-3 +- Fix inode sync error between client and server. * Thu Dec 08 2022 YangXin <245051644@qq.com> 1.1-2 - Fix error of qtfs and modify rexec to enable reading net addr from file. * Mon Nov 28 2022 Weifeng Su 1.1-1 -- Gitee