Skip to content

Commit b64a331

Browse files
committed
cachefiles: Trace active-mark failure
Add a tracepoint to log failure to apply an active mark to a file in addition to tracing successfully setting and unsetting the mark. Also include the backing file inode number in the message logged to dmesg. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Jeff Layton <jlayton@kernel.org> cc: linux-cachefs@redhat.com Link: https://lore.kernel.org/r/164251404666.3435901.17331742792401482190.stgit@warthog.procyon.org.uk/ # v1
1 parent 8c39b8b commit b64a331

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

fs/cachefiles/namei.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ static bool __cachefiles_mark_inode_in_use(struct cachefiles_object *object,
2525
trace_cachefiles_mark_active(object, inode);
2626
can_use = true;
2727
} else {
28-
pr_notice("cachefiles: Inode already in use: %pd\n", dentry);
28+
trace_cachefiles_mark_failed(object, inode);
29+
pr_notice("cachefiles: Inode already in use: %pd (B=%lx)\n",
30+
dentry, inode->i_ino);
2931
}
3032

3133
return can_use;

include/trace/events/cachefiles.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,27 @@ TRACE_EVENT(cachefiles_mark_active,
573573
__entry->obj, __entry->inode)
574574
);
575575

576+
TRACE_EVENT(cachefiles_mark_failed,
577+
TP_PROTO(struct cachefiles_object *obj,
578+
struct inode *inode),
579+
580+
TP_ARGS(obj, inode),
581+
582+
/* Note that obj may be NULL */
583+
TP_STRUCT__entry(
584+
__field(unsigned int, obj )
585+
__field(ino_t, inode )
586+
),
587+
588+
TP_fast_assign(
589+
__entry->obj = obj ? obj->debug_id : 0;
590+
__entry->inode = inode->i_ino;
591+
),
592+
593+
TP_printk("o=%08x B=%lx",
594+
__entry->obj, __entry->inode)
595+
);
596+
576597
TRACE_EVENT(cachefiles_mark_inactive,
577598
TP_PROTO(struct cachefiles_object *obj,
578599
struct inode *inode),

0 commit comments

Comments
 (0)