mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 12:10:52 -04:00
FS-Cache: fscache_object_is_dead() has wrong logic, kill it
fscache_object_is_dead() returns true only if the object is marked dead and the cache got an I/O error. This should be a logical OR instead. Since two of the callers got split up into handling for separate subcases, expand the other callers and kill the function. This is probably the right thing to do anyway since one of the subcases isn't about the object at all, but rather about the cache. Signed-off-by: David Howells <[email protected]> Reviewed-by: Steve Dickson <[email protected]> Acked-by: Jeff Layton <[email protected]>
This commit is contained in:
parent
f09b443d0e
commit
8702152630
3 changed files with 6 additions and 9 deletions
|
|
@ -327,7 +327,8 @@ static int fscache_alloc_object(struct fscache_cache *cache,
|
|||
|
||||
object_already_extant:
|
||||
ret = -ENOBUFS;
|
||||
if (fscache_object_is_dead(object)) {
|
||||
if (fscache_object_is_dying(object) ||
|
||||
fscache_cache_is_broken(object)) {
|
||||
spin_unlock(&cookie->lock);
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -377,11 +377,13 @@ check_if_dead:
|
|||
_leave(" = -ENOBUFS [cancelled]");
|
||||
return -ENOBUFS;
|
||||
}
|
||||
if (unlikely(fscache_object_is_dead(object))) {
|
||||
pr_err("%s() = -ENOBUFS [obj dead %d]\n", __func__, op->state);
|
||||
if (unlikely(fscache_object_is_dying(object) ||
|
||||
fscache_cache_is_broken(object))) {
|
||||
enum fscache_operation_state state = op->state;
|
||||
fscache_cancel_op(op, do_cancel);
|
||||
if (stat_object_dead)
|
||||
fscache_stat(stat_object_dead);
|
||||
_leave(" = -ENOBUFS [obj dead %d]", state);
|
||||
return -ENOBUFS;
|
||||
}
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue