Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 347825
b: refs/heads/master
c: b4cf1e0
h: refs/heads/master
i:
  347823: 5c60ad8
v: v3
  • Loading branch information
David Howells committed Dec 20, 2012
1 parent 6febf1f commit 37bf530
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 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: de242c0b8b365a9e348bf53143e18e9d8c9cfae8
refs/heads/master: b4cf1e08c8ac95eff65faa53904f7f13ac78194b
14 changes: 10 additions & 4 deletions trunk/fs/cachefiles/rdwr.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,10 @@ static int cachefiles_read_backing_file_one(struct cachefiles_object *object,

read_error:
_debug("read error %d", ret);
if (ret == -ENOMEM)
if (ret == -ENOMEM) {
fscache_retrieval_complete(op, 1);
goto out;
}
io_error:
cachefiles_io_error_obj(object, "Page read error on backing file");
fscache_retrieval_complete(op, 1);
Expand Down Expand Up @@ -551,6 +553,7 @@ static int cachefiles_read_backing_file(struct cachefiles_object *object,
if (ret < 0) {
if (ret == -EEXIST) {
page_cache_release(netpage);
fscache_retrieval_complete(op, 1);
continue;
}
goto nomem;
Expand Down Expand Up @@ -627,6 +630,7 @@ static int cachefiles_read_backing_file(struct cachefiles_object *object,
if (ret < 0) {
if (ret == -EEXIST) {
page_cache_release(netpage);
fscache_retrieval_complete(op, 1);
continue;
}
goto nomem;
Expand All @@ -645,9 +649,9 @@ static int cachefiles_read_backing_file(struct cachefiles_object *object,

/* the netpage is unlocked and marked up to date here */
fscache_end_io(op, netpage, 0);
fscache_retrieval_complete(op, 1);
page_cache_release(netpage);
netpage = NULL;
fscache_retrieval_complete(op, 1);
continue;
}

Expand Down Expand Up @@ -682,15 +686,17 @@ static int cachefiles_read_backing_file(struct cachefiles_object *object,
nomem:
_debug("nomem");
ret = -ENOMEM;
goto out;
goto record_page_complete;

read_error:
_debug("read error %d", ret);
if (ret == -ENOMEM)
goto out;
goto record_page_complete;
io_error:
cachefiles_io_error_obj(object, "Page read error on backing file");
ret = -ENOBUFS;
record_page_complete:
fscache_retrieval_complete(op, 1);
goto out;
}

Expand Down
2 changes: 2 additions & 0 deletions trunk/fs/fscache/page.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ static int fscache_wait_for_retrieval_activation(struct fscache_object *object,
return -ENOBUFS;
}
if (unlikely(fscache_object_is_dead(object))) {
pr_err("%s() = -ENOBUFS [obj dead %d]", __func__, op->op.state);
fscache_cancel_op(&op->op);
fscache_stat(stat_object_dead);
return -ENOBUFS;
}
Expand Down

0 comments on commit 37bf530

Please sign in to comment.