Skip to content

Commit 9696952

Browse files
committed
FS-Cache: Add transition to handle invalidate immediately after lookup
Add a missing transition to the FS-Cache object state machine to handle an invalidation event occuring between the back end completing the object lookup by calling fscache_obtained_object() (which moves to state OBJECT_AVAILABLE) and the backend returning to fscache_lookup_object() and thence to fscache_object_state_machine() which then does a goto lookup_transit to handle the transition - but lookup_transit doesn't handle EV_INVALIDATE. Without this, the following BUG can be logged: FS-Cache: Unsupported event 2 [5/f7] in state OBJECT_AVAILABLE ------------[ cut here ]------------ kernel BUG at fs/fscache/object.c:357! Where event 2 is EV_INVALIDATE. Signed-off-by: David Howells <dhowells@redhat.com>
1 parent 8c209ce commit 9696952

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎fs/fscache/object.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,9 @@ static void fscache_object_state_machine(struct fscache_object *object)
284284
case FSCACHE_OBJECT_EV_ERROR:
285285
new_state = FSCACHE_OBJECT_LC_DYING;
286286
goto change_state;
287+
case FSCACHE_OBJECT_EV_INVALIDATE:
288+
new_state = FSCACHE_OBJECT_INVALIDATING;
289+
goto change_state;
287290
case FSCACHE_OBJECT_EV_REQUEUE:
288291
goto done;
289292
case -1:

0 commit comments

Comments
 (0)