diff options
author | David Howells <dhowells@redhat.com> | 2012-12-05 08:34:49 -0500 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2012-12-20 17:19:22 -0500 |
commit | 969695215f9a865cbf64c4ce3742ac9fc57fffed (patch) | |
tree | c46829a111afa436a2a1b18495a46348ccee04f3 | |
parent | 8c209ce721444a61b61d9e772746c721e4d8d1e8 (diff) |
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>
-rw-r--r-- | fs/fscache/object.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/fscache/object.c b/fs/fscache/object.c index 2c512cbac380..50d41c180211 100644 --- a/fs/fscache/object.c +++ b/fs/fscache/object.c | |||
@@ -284,6 +284,9 @@ lookup_transit: | |||
284 | case FSCACHE_OBJECT_EV_ERROR: | 284 | case FSCACHE_OBJECT_EV_ERROR: |
285 | new_state = FSCACHE_OBJECT_LC_DYING; | 285 | new_state = FSCACHE_OBJECT_LC_DYING; |
286 | goto change_state; | 286 | goto change_state; |
287 | case FSCACHE_OBJECT_EV_INVALIDATE: | ||
288 | new_state = FSCACHE_OBJECT_INVALIDATING; | ||
289 | goto change_state; | ||
287 | case FSCACHE_OBJECT_EV_REQUEUE: | 290 | case FSCACHE_OBJECT_EV_REQUEUE: |
288 | goto done; | 291 | goto done; |
289 | case -1: | 292 | case -1: |