All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SQUASHME: pnfs-obj: panlayout: Fix very old BUG_ONs on ol_state.status
@ 2010-05-27 14:52 Boaz Harrosh
  2010-05-27 15:26 ` Staubach_Peter
  2010-05-27 18:08 ` Benny Halevy
  0 siblings, 2 replies; 4+ messages in thread
From: Boaz Harrosh @ 2010-05-27 14:52 UTC (permalink / raw)
  To: Benny Halevy, open-osd, NFS list


OK This is definitely my stupidity when converting panfs_shim to the
new objlayout_read/write_done() API. But that was very, very long
time ago. Did we not test panlayout since then.

So I fixed the stale check on ol_state.status which is never set
until much later inside the call to generic layer.

While at it I converted the BUG_ONs to WARN_ONs because it could
be data corruption but otherwise it will not crush the Kernel.
Better continue to be able to debug it better. (And added missing
information to the WARN_ON)

Congratulation, I've successfully ran all tests over
panfs-export/panfs_shim over real Panasas HW. With latest code.
[ This is with the new panfs-export that is also compatible with
  the std objects layout driver. Patches to that will follow]

TODO:
  I should also simulate/cause some IO errors and see that
  errors are reported at layout_return

Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
---
 fs/nfs/objlayout/panfs_shim.c |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/fs/nfs/objlayout/panfs_shim.c b/fs/nfs/objlayout/panfs_shim.c
index 414831e..c34fb5c 100644
--- a/fs/nfs/objlayout/panfs_shim.c
+++ b/fs/nfs/objlayout/panfs_shim.c
@@ -421,9 +421,12 @@ panfs_shim_read_done(
 		rc = res_p->result;
 	if (rc == PAN_SUCCESS) {
 		status = res_p->length;
-		BUG_ON(state->ol_state.status < 0);
-		BUG_ON((pan_stor_len_t)state->ol_state.status !=
-		       state->u.read.res.length);
+		WARN_ON(status < 0);
+		if (WARN_ON((pan_stor_len_t)status != state->u.read.res.length))
+			printk(KERN_ERR
+			      "%s: status(0x%llx) != read.res.length(0x%llx)\n",
+			       __func__, (u64)status,
+			       (u64)state->u.read.res.length);
 	} else {
 		status = -panfs_export_ops->convert_rc(rc);
 		dprintk("%s: pan_sam_read rc %d: status %Zd\n",
@@ -499,9 +502,13 @@ panfs_shim_write_done(
 	if (rc == PAN_SUCCESS) {
 		state->ol_state.committed = NFS_FILE_SYNC;
 		status = res_p->length;
-		BUG_ON(state->ol_state.status < 0);
-		BUG_ON((pan_stor_len_t)state->ol_state.status !=
-		       state->u.write.res.length);
+		WARN_ON(status < 0);
+		if (WARN_ON((pan_stor_len_t)status != state->u.write.res.length))
+			printk(KERN_ERR
+			     "%s: status(0x%llx) != write.res.length(0x%llx)\n",
+			     __func__, (u64)status,
+			    (u64)state->u.write.res.length);
+
 		objlayout_add_delta_space_used(&state->ol_state,
 					       res_p->delta_capacity_used);
 	} else {
-- 
1.6.6.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-05-27 18:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-27 14:52 [PATCH] SQUASHME: pnfs-obj: panlayout: Fix very old BUG_ONs on ol_state.status Boaz Harrosh
2010-05-27 15:26 ` Staubach_Peter
     [not found]   ` <BF3BB6D12298F54B89C8DCC1E4073D80F2C566-1Zg0zMUlrbd9m/dOYFj4Yjjd7nCn89gW@public.gmane.org>
2010-05-27 16:31     ` Benny Halevy
2010-05-27 18:08 ` Benny Halevy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.