zfs-0.6.1-avoid-zdb-abort.patch 844 B

12345678910111213141516171819202122232425262728293031
  1. From 5d3dc3fb72518a4c191e3a014622b74365eb3a74 Mon Sep 17 00:00:00 2001
  2. From: Mike Leddy <mike.leddy@gmail.com>
  3. Date: Thu, 4 Jul 2013 01:02:05 -0300
  4. Subject: [PATCH] Avoid abort() in vn_rdwr(): libzpool/kernel.c
  5. Make sure that buffer is aligned to 512 bytes on linux so that
  6. pread call combined with O_DIRECT does not return EINVAL.
  7. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
  8. Closes #1570
  9. ---
  10. cmd/zdb/zdb.c | 2 +-
  11. 1 file changed, 1 insertion(+), 1 deletion(-)
  12. diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
  13. index 936974b..a2b6bfe 100644
  14. --- a/cmd/zdb/zdb.c
  15. +++ b/cmd/zdb/zdb.c
  16. @@ -2844,7 +2844,7 @@
  17. psize = size;
  18. lsize = size;
  19. - pbuf = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
  20. + pbuf = umem_alloc_aligned(SPA_MAXBLOCKSIZE, 512, UMEM_NOFAIL);
  21. lbuf = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
  22. BP_ZERO(bp);
  23. --
  24. 1.8.1.6