From f337e67f75a3b2b180737760ded94a52d28984c5 Mon Sep 17 00:00:00 2001 From: liuzerun Date: Mon, 17 Jun 2024 08:34:03 +0000 Subject: [PATCH] add log Signed-off-by: liuzerun --- fs/hmdfs/hmdfs_device_view.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/fs/hmdfs/hmdfs_device_view.h b/fs/hmdfs/hmdfs_device_view.h index a1f792d9eb0f..3b0f489d5db8 100644 --- a/fs/hmdfs/hmdfs_device_view.h +++ b/fs/hmdfs/hmdfs_device_view.h @@ -201,6 +201,14 @@ int hmdfs_convert_lookup_flags(unsigned int hmdfs_flags, unsigned int *vfs_flags); static inline void hmdfs_get_lower_path(struct dentry *dent, struct path *pname) { + if (!hmdfs_d(dent)) { + hmdfs_err("private data is NULL"); + return; + } + if (!hmdfs_d(dent)->lower_path) { + hmdfs_err("lower_path is NULL"); + return; + } spin_lock(&hmdfs_d(dent)->lock); pname->dentry = hmdfs_d(dent)->lower_path.dentry; pname->mnt = hmdfs_d(dent)->lower_path.mnt; -- Gitee