Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions modules/cas_cache/classifier.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,11 @@ static void _cas_cls_directory_resolve(struct cas_classifier *cls,
int error;
int o_res;
unsigned long o_ino;
const struct super_block *o_sb;

o_res = ctx->resolved;
o_ino = ctx->i_ino;
o_sb = ctx->i_sb;

error = kern_path(ctx->pathname, LOOKUP_FOLLOW, &path);
if (error) {
Expand All @@ -349,13 +351,14 @@ static void _cas_cls_directory_resolve(struct cas_classifier *cls,

inode = path.dentry->d_inode;
ctx->i_ino = inode->i_ino;
ctx->i_sb = inode->i_sb;
ctx->resolved = 1;
path_put(&path);

if (!o_res) {
CAS_CLS_DEBUG_MSG("Resolved %s to inode: %lu\n", ctx->pathname,
ctx->i_ino);
} else if (o_ino != ctx->i_ino) {
} else if (o_ino != ctx->i_ino || o_sb != ctx->i_sb) {
CAS_CLS_DEBUG_MSG("Changed inode resolution for %s: %lu => %lu"
"\n", ctx->pathname, o_ino, ctx->i_ino);
}
Expand Down Expand Up @@ -423,7 +426,8 @@ static cas_cls_eval_t _cas_cls_directory_test(
dentry = _cas_cls_dir_get_inode_dentry(inode);
for (depth = 0; dentry && depth < CAS_CLS_DIR_MAX_DEPTH; depth++) {
d_ino = dentry->d_inode;
if (d_ino && d_ino->i_ino == ctx->i_ino) {
if (d_ino && d_ino->i_ino == ctx->i_ino &&
d_ino->i_sb == ctx->i_sb) {
result = cas_cls_eval_yes;
break;
}
Expand Down
4 changes: 4 additions & 0 deletions modules/cas_cache/classifier_defs.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/*
* Copyright(c) 2019-2021 Intel Corporation
* Copyright(c) 2026 Unvertical
* SPDX-License-Identifier: BSD-3-Clause
*/

Expand Down Expand Up @@ -140,6 +141,9 @@ struct cas_cls_directory {
/* Resolved inode */
unsigned long i_ino;

/* Superblock of resolved inode */
const struct super_block *i_sb;

/* Back pointer to classifier context */
struct cas_classifier *cls;

Expand Down
Loading