Re: fscache kernel crash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'll give it a try as soon as possible, I'll hope to find it in 6.5 =)

I've modified and applied the patch for the last centos kernel (2.6.32-358.6.2.el6.x86_64), but I still have the problem.

It seems that the page.c differs to much between the kernel HEAD and the Centos one, maybe my modifications were not correct (very likely :D).

Any plans to backport the patch in redhat 6 kernel ?

Jean-Baptiste

diff -rup linux-2.6.32-358.6.2.el6/fs/fscache/page.c linux-2.6.32-358.6.2.el6-fscachepatch/fs/fscache/page.c
--- linux-2.6.32-358.6.2.el6/fs/fscache/page.c	2013-05-14 21:09:30.000000000 +0200
+++ linux-2.6.32-358.6.2.el6-fscachepatch/fs/fscache/page.c	2013-05-29 14:05:00.000000000 +0200
@@ -254,7 +254,7 @@ static void fscache_release_retrieval_op
 
 	_enter("{OP%x}", op->op.debug_id);
 
-	ASSERTCMP(op->n_pages, ==, 0);
+	ASSERTCMP(atomic_read(&op->n_pages), ==, 0);
 
 	fscache_hist(fscache_retrieval_histogram, op->start_time);
 	if (op->context)
@@ -410,7 +410,7 @@ int __fscache_read_or_alloc_page(struct 
 		return -ENOMEM;
 	}
 	fscache_set_op_name(&op->op, "RetrRA1");
-	op->n_pages = 1;
+	atomic_set(&op->n_pages, 1);
 
 	spin_lock(&cookie->lock);
 
@@ -537,7 +537,7 @@ int __fscache_read_or_alloc_pages(struct
 	if (!op)
 		return -ENOMEM;
 	fscache_set_op_name(&op->op, "RetrRAN");
-	op->n_pages = *nr_pages;
+	atomic_set(&op->n_pages, *nr_pages);
 
 	spin_lock(&cookie->lock);
 
@@ -668,7 +668,7 @@ int __fscache_alloc_page(struct fscache_
 	if (!op)
 		return -ENOMEM;
 	fscache_set_op_name(&op->op, "RetrAL1");
-	op->n_pages = 1;
+	atomic_set(&op->n_pages, 1);
 
 	spin_lock(&cookie->lock);
 
diff -rup linux-2.6.32-358.6.2.el6/include/linux/fscache-cache.h linux-2.6.32-358.6.2.el6-fscachepatch/include/linux/fscache-cache.h
--- linux-2.6.32-358.6.2.el6/include/linux/fscache-cache.h	2013-05-14 21:09:30.000000000 +0200
+++ linux-2.6.32-358.6.2.el6-fscachepatch/include/linux/fscache-cache.h	2013-05-29 12:42:50.000000000 +0200
@@ -177,7 +177,7 @@ struct fscache_retrieval {
 	void			*context;	/* netfs read context (pinned) */
 	struct list_head	to_do;		/* list of things to be done by the backend */
 	unsigned long		start_time;	/* time at which retrieval started */
-	unsigned		n_pages;	/* number of pages to be retrieved */
+	atomic_t		n_pages;	/* number of pages to be retrieved */
 };
 
 typedef int (*fscache_page_retrieval_func_t)(struct fscache_retrieval *op,
@@ -221,15 +221,14 @@ static inline void fscache_enqueue_retri
 static inline void fscache_retrieval_complete(struct fscache_retrieval *op,
 					      int n_pages)
 {
-	op->n_pages -= n_pages;
-	if (op->n_pages <= 0)
+	atomic_sub(n_pages, &op->n_pages);
+	if (atomic_read(&op->n_pages) <= 0)
 		fscache_op_complete(&op->op);
 }
 
 /**
  * fscache_put_retrieval - Drop a reference to a retrieval operation
  * @op: The retrieval operation affected
- * @n_pages: The number of pages to account for
  *
  * Drop a reference to a retrieval operation.
  */
--
Linux-cachefs mailing list
Linux-cachefs@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/linux-cachefs

[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]
  Powered by Linux