代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/dpu-utilities 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From 607c1e329ac107087fdadca0c997d3e0f66b3b06 Mon Sep 17 00:00:00 2001
From: yangxin <245051644@qq.com>
Date: Thu, 8 Jun 2023 06:54:09 +0000
Subject: modify qtfs_dentry_revalidate
Signed-off-by: yangxin <245051644@qq.com>
---
qtfs/qtfs/sb.c | 32 ++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)
diff --git a/qtfs/qtfs/sb.c b/qtfs/qtfs/sb.c
index b6bb3d7..2038c55 100644
--- a/qtfs/qtfs/sb.c
+++ b/qtfs/qtfs/sb.c
@@ -1510,29 +1510,41 @@ const struct xattr_handler *qtfs_xattr_handlers[] = {
int qtfs_dentry_revalidate(struct dentry *dentry, unsigned int flags)
{
struct qtfs_conn_var_s *pvar = NULL;
- struct qtreq_mount *req = NULL;
- struct qtrsp_mount *rsp = NULL;
-
- // 1 means valid; 0 means invalid
- if (dentry && dentry->d_inode && S_ISDIR(dentry->d_inode->i_mode)) {
+ struct qtreq_getattr *req;
+ struct qtrsp_getattr *rsp;
+ struct inode *inode = dentry->d_inode;
+ if (dentry && dentry->d_inode) {
if (jiffies - dentry->d_time < 2000)
return 1;
-
pvar = qtfs_conn_get_param();
- if (!pvar)
+ if (!pvar) {
+ qtfs_err("Failed to get qtfs sock var\n");
return 0;
+ }
req = pvar->conn_ops->get_conn_msg_buf(pvar, QTFS_SEND);
qtfs_fullname(req->path, dentry, PATH_MAX);
- rsp = qtfs_remote_run(pvar, QTFS_REQ_MOUNT, strlen(req->path));
- if (IS_ERR_OR_NULL(rsp) || rsp->ret != QTFS_OK) {
+ req->request_mask = STATX_BASIC_STATS;
+ req->query_flags = 0;
+
+ rsp = qtfs_remote_run(pvar, QTFS_REQ_GETATTR, QTFS_SEND_SIZE(struct qtreq_getattr, req->path));
+ if (IS_ERR_OR_NULL(rsp)) {
+ qtfs_conn_put_param(pvar);
+ return 0;
+ }
+ if (rsp->ret) {
qtfs_conn_put_param(pvar);
return 0;
}
+ if (!inode || inode->i_ino != rsp->stat.ino || inode->i_mode != rsp->stat.mode) {
+ if (inode->i_nlink > 0)
+ drop_nlink(inode);
+ qtfs_conn_put_param(pvar);
+ return 0;
+ }
qtfs_conn_put_param(pvar);
dentry->d_time = jiffies;
- return 1;
}
return 1;
}
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。