Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 352149 - FS-CACHE has operation handling error
Summary: FS-CACHE has operation handling error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL: http://git.kernel.org/?p=linux/kernel...
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2011-01-19 19:28 UTC by Justin Lecher (RETIRED)
Modified: 2011-03-21 00:45 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Lecher (RETIRED) gentoo-dev 2011-01-19 19:28:31 UTC
Those to mails came around on the cachefiled ml and upstream hasn't fixed this yet. Could we include the fix in the gentoo sources?

I am not really sure, hwo the actuall result is, but I experienced some kind of "not working" behaviour on cachfilesd, which I couldn't explain. I think this is related to this bug, that after some time the cache gets locked.


From: Akshat Aranya <aranya@nec-labs.com>

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>
---

 fs/fscache/operation.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/fscache/operation.c b/fs/fscache/operation.c
index b9f34ea..48a18f1 100644
--- a/fs/fscache/operation.c
+++ b/fs/fscache/operation.c
@@ -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);


fscache_submit_exclusive_op() adds an operation to the pending list if
other operations are pending.  Fixed the check for pending ops.

Signed-off-by: Akshat Aranya <aranya@nec-labs.com>
---
 fs/fscache/operation.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/fscache/operation.c b/fs/fscache/operation.c
index b9f34ea..48a18f1 100644
--- a/fs/fscache/operation.c
+++ b/fs/fscache/operation.c
@@ -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);
-- 1.7.1
Comment 1 Mike Pagano gentoo-dev 2011-02-01 19:30:01 UTC
where is this patch from? Was it ever submitted upstream?
Comment 2 Justin Lecher (RETIRED) gentoo-dev 2011-02-02 07:48:50 UTC
It was on the cachefilesd ml with linus and some other kernel guys CCed. But no comment on that from them.
Comment 3 Justin Lecher (RETIRED) gentoo-dev 2011-03-15 15:13:52 UTC
Applied in upstream .38
Comment 4 Mike Pagano gentoo-dev 2011-03-21 00:45:12 UTC
Release in gentoo-sources-2.6.37-r3