[PATCH] SQUASHME: DEBUG: pnfs-submit: define and use BUG_ON_UNLOCKED_INO

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

 



in pnfs_alloc_layout there's no layout yet so we can't use
BUG_ON_UNLOCKED_LO. Checking spin_is_lock does not work well too
as it always returns false for uni-processors with no DEBUG_SPINLOCK.

Signed-off-by: Benny Halevy <bhalevy@xxxxxxxxxxx>
---
 fs/nfs/pnfs.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 8b26104..6382cc6 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -310,9 +310,12 @@ pnfs_unregister_layoutdriver(struct pnfs_layoutdriver_type *ld_type)
  * pNFS client layout cache
  */
 #if defined(CONFIG_SMP)
+#define BUG_ON_UNLOCKED_INO(ino) \
+	BUG_ON(!spin_is_locked(&ino->i_lock))
 #define BUG_ON_UNLOCKED_LO(lo) \
-	BUG_ON(!spin_is_locked(&PNFS_INODE(lo)->i_lock))
+	BUG_ON_UNLOCKED_INO(PNFS_INODE(lo))
 #else /* CONFIG_SMP */
+#define BUG_ON_UNLOCKED_INO(lo) do {} while (0)
 #define BUG_ON_UNLOCKED_LO(lo) do {} while (0)
 #endif /* CONFIG_SMP */
 
@@ -871,7 +874,7 @@ pnfs_alloc_layout(struct inode *ino)
 
 	dprintk("%s Begin ino=%p layout=%p\n", __func__, ino, nfsi->layout);
 
-	BUG_ON(!spin_is_locked(&ino->i_lock));
+	BUG_ON_UNLOCKED_INO(ino);
 	if (likely(nfsi->layout))
 		return nfsi->layout;
 
-- 
1.7.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux