Skip to content

Commit

Permalink
FS-Cache: Fix operation handling
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: David Howells <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Akshat Aranya authored and torvalds committed Jan 14, 2011
1 parent acda472 commit ba28b93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/fscache/operation.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ int fscache_submit_exclusive_op(struct fscache_object *object,
object->n_ops++;
object->n_exclusive++; /* reads and writes must wait */

if (object->n_ops > 0) {
if (object->n_ops > 1) {
atomic_inc(&op->usage);
list_add_tail(&op->pend_link, &object->pending_ops);
fscache_stat(&fscache_n_op_pend);
Expand Down

0 comments on commit ba28b93

Please sign in to comment.