Skip to content

Commit ba28b93

Browse files
Akshat Aranyatorvalds
authored andcommitted
FS-Cache: Fix operation handling
fscache_submit_exclusive_op() adds an operation to the pending list if other operations are pending. Fix the check for pending ops as n_ops must be greater than 0 at the point it is checked as it is incremented immediately before under lock. Signed-off-by: Akshat Aranya <aranya@nec-labs.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent acda472 commit ba28b93

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/fscache/operation.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ int fscache_submit_exclusive_op(struct fscache_object *object,
101101
object->n_ops++;
102102
object->n_exclusive++; /* reads and writes must wait */
103103

104-
if (object->n_ops > 0) {
104+
if (object->n_ops > 1) {
105105
atomic_inc(&op->usage);
106106
list_add_tail(&op->pend_link, &object->pending_ops);
107107
fscache_stat(&fscache_n_op_pend);

0 commit comments

Comments
 (0)