From 2957f3e301af1767731985f1b1124c71cc93fc80 Mon Sep 17 00:00:00 2001 From: Zach Brown Date: Thu, 27 May 2021 16:44:02 -0700 Subject: [PATCH] Avoid warnings when evict has signals pending Killing a task can end up in evict and break out of acquiring the locks to perform final inode deletion. This isn't necessarily fatal. The orphan task will come around and will delete the inode when it is truly no longer referenced. So let's silence the error and keep track of how many times it happens. Signed-off-by: Zach Brown --- kmod/src/counters.h | 1 + kmod/src/inode.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/kmod/src/counters.h b/kmod/src/counters.h index ba8885ba..e12c58d7 100644 --- a/kmod/src/counters.h +++ b/kmod/src/counters.h @@ -88,6 +88,7 @@ EXPAND_COUNTER(forest_read_items) \ EXPAND_COUNTER(forest_roots_next_hint) \ EXPAND_COUNTER(forest_set_bloom_bits) \ + EXPAND_COUNTER(inode_evict_intr) \ EXPAND_COUNTER(item_clear_dirty) \ EXPAND_COUNTER(item_create) \ EXPAND_COUNTER(item_delete) \ diff --git a/kmod/src/inode.c b/kmod/src/inode.c index 427ceba3..3911b74e 100644 --- a/kmod/src/inode.c +++ b/kmod/src/inode.c @@ -1593,9 +1593,15 @@ void scoutfs_evict_inode(struct inode *inode) scoutfs_unlock(sb, lock, SCOUTFS_LOCK_WRITE); scoutfs_unlock(sb, orph_lock, SCOUTFS_LOCK_WRITE_ONLY); } - if (ret < 0) + if (ret == -ERESTARTSYS) { + /* can be in task with pending, could be found as orphan */ + scoutfs_inc_counter(sb, inode_evict_intr); + ret = 0; + } + if (ret < 0) { scoutfs_err(sb, "error %d while checking to delete inode nr %llu, it might linger.", ret, ino); + } scoutfs_omap_dec(sb, ino);