Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Akshat Aranya and committed by
Linus Torvalds
ba28b93a acda4721

+1 -1
+1 -1
fs/fscache/operation.c
··· 101 101 object->n_ops++; 102 102 object->n_exclusive++; /* reads and writes must wait */ 103 103 104 - if (object->n_ops > 0) { 104 + if (object->n_ops > 1) { 105 105 atomic_inc(&op->usage); 106 106 list_add_tail(&op->pend_link, &object->pending_ops); 107 107 fscache_stat(&fscache_n_op_pend);