Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347835
b: refs/heads/master
c: 7ef001e
h: refs/heads/master
i:
  347833: de8b748
  347831: 1bc5bd3
v: v3
  • Loading branch information
David Howells committed Dec 20, 2012
1 parent 66dbb5b commit fad10d9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9c04caa81b876faee5f1cc6eaad76dd7021ab8ff
refs/heads/master: 7ef001e937e8b9cbedb2fc1c31dd681ac3b31927
22 changes: 20 additions & 2 deletions trunk/fs/fscache/page.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,9 +699,27 @@ static void fscache_write_op(struct fscache_operation *_op)
spin_lock(&object->lock);
cookie = object->cookie;

if (!fscache_object_is_active(object) || !cookie) {
if (!fscache_object_is_active(object)) {
/* If we get here, then the on-disk cache object likely longer
* exists, so we should just cancel this write operation.
*/
spin_unlock(&object->lock);
_leave("");
op->op.state = FSCACHE_OP_ST_CANCELLED;
_leave(" [inactive]");
return;
}

if (!cookie) {
/* If we get here, then the cookie belonging to the object was
* detached, probably by the cookie being withdrawn due to
* memory pressure, which means that the pages we might write
* to the cache from no longer exist - therefore, we can just
* cancel this write operation.
*/
spin_unlock(&object->lock);
op->op.state = FSCACHE_OP_ST_CANCELLED;
_leave(" [cancel] op{f=%lx s=%u} obj{s=%u f=%lx}",
_op->flags, _op->state, object->state, object->flags);
return;
}

Expand Down

0 comments on commit fad10d9

Please sign in to comment.