summaryrefslogtreecommitdiff
path: root/fs/netfs/fscache_cookie.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/netfs/fscache_cookie.c')
-rw-r--r--fs/netfs/fscache_cookie.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/netfs/fscache_cookie.c b/fs/netfs/fscache_cookie.c
index bce2492186d0..d4d4b3a8b106 100644
--- a/fs/netfs/fscache_cookie.c
+++ b/fs/netfs/fscache_cookie.c
@@ -741,6 +741,10 @@ again_locked:
spin_lock(&cookie->lock);
}
if (test_bit(FSCACHE_COOKIE_DO_LRU_DISCARD, &cookie->flags)) {
+ if (atomic_read(&cookie->n_accesses) != 0)
+ /* still being accessed: postpone it */
+ break;
+
__fscache_set_cookie_state(cookie,
FSCACHE_COOKIE_STATE_LRU_DISCARDING);
wake = true;