浏览代码

FS-Cache: Reduce cookie ref count if submit fails.

I've been seeing issues with disposing cookies under vma pressure. The symptom
is that the refcount gets out of sync. In this case we fail to decrement the
refcount if submit fails. I found this while auditing the error in and around
cookie operations.

Signed-off-by: Milosz Tanski <milosz@adfin.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Milosz Tanski 11 年之前
父节点
当前提交
920bce20d7
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      fs/fscache/object.c

+ 1 - 0
fs/fscache/object.c

@@ -982,6 +982,7 @@ nomem:
 submit_op_failed:
 	clear_bit(FSCACHE_OBJECT_IS_LIVE, &object->flags);
 	spin_unlock(&cookie->lock);
+	fscache_unuse_cookie(object);
 	kfree(op);
 	_leave(" [EIO]");
 	return transit_to(KILL_OBJECT);