[PATCH v3] btrfs: Use bd_dev to generate index when dev_state_hashtable add items.

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

 



From: Gu JinXiang <gujx@xxxxxxxxxxxxxx>

Fix missing modify of
commit f8f84b2dfda5 ("btrfs: index check-integrity state hash by a dev_t").
Function btrfsic_dev_state_hashtable_lookup use dev_t to generate hashval
when lookup a btrfsic_dev_state in hash table. So when add a
btrfsic_dev_state into hash table, it should also use dev_t.

Reproduce of this bug:
Use MOUNT_OPTIONS="-o check_int" when run xfstest, device can not be
mount successfully. So xfstest can not run. 

changelog:
v1->v2: Add how to reproduce this bug.
v2->v3: Add description of this bug.

Signed-off-by: Gu JinXiang <gujx@xxxxxxxxxxxxxx>
---
 fs/btrfs/check-integrity.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/check-integrity.c b/fs/btrfs/check-integrity.c
index 9d3854839038..86d79bc4cfb3 100644
--- a/fs/btrfs/check-integrity.c
+++ b/fs/btrfs/check-integrity.c
@@ -613,7 +613,7 @@ static void btrfsic_dev_state_hashtable_add(
 		struct btrfsic_dev_state_hashtable *h)
 {
 	const unsigned int hashval =
-	    (((unsigned int)((uintptr_t)ds->bdev)) &
+	    (((unsigned int)((uintptr_t)ds->bdev->bd_dev)) &
 	     (BTRFSIC_DEV2STATE_HASHTABLE_SIZE - 1));
 
 	list_add(&ds->collision_resolving_node, h->table + hashval);
-- 
2.13.5



--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" 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 NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux