All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] Initial support for badblock checking in xfs
@ 2016-06-17  1:03 ` Vishal Verma
  0 siblings, 0 replies; 21+ messages in thread
From: Vishal Verma @ 2016-06-17  1:03 UTC (permalink / raw)
  To: linux-nvdimm, xfs; +Cc: Jan Kara, Dave Chinner, Darrick J. Wong

These are early/RFC patches to add badblock support in xfs.

Patch 1 should be relatively straightforward - it adds a notifier chain
to badblocks that filesystems can register with.

Patch 2 is the beginnings of xfs support. So far, I have the notifier
registration and building the initial badblock list happening in
xfs_mountfs. The next steps (and I may need some help with this as I'm
no (x)fs developer :)) are to add this badblocks info to the reverse
mapping tree, and then to check for it before accessing the media.

Right now, this just prints the sector numbers/counts/{added, removed}
to the kernel log, for both the initial list, and subsequent notifier
hits.

While I've tested this with a fake pmem device using libnvdimm's
nfit_test framework, it should also work using badblock injection with
any block device:

# mkfs.xfs -f /dev/<device>
# echo 122 1 > /sys/block/<device>/badblocks
# echo 124 1 > /sys/block/<device>/badblocks
# mount -t xfs /dev/<device> /mnt
... in log:
[  +8.803776] XFS (pmem7): Mounting V4 Filesystem
[  +0.009633] XFS (pmem7): Ending clean mount
[  +0.001655] XFS (pmem7): got badblocks: sector 122, count 1
[  +0.002018] XFS (pmem7): got badblocks: sector 124, count 1

# echo 132 5 | > /sys/block/<device>/badblocks
[Jun16 18:56] XFS (pmem7): xfs badblock added sector 132 (count 5)

This is all based on Darrik's rmap work at:
https://github.com/djwong/linux/tree/rmap-reflink-devel

Since this is based on a v4.5-rc kernel, it lacks pmem support for
clearing badblocks on zeroing/writing, so those parts can't easily
be tested yet. The clearing work is in 4.7-rs kernels, and once we
rebase to that, that should also be available.


Vishal Verma (2):
  block, badblocks: add a notifier for badblocks
  xfs: initial/partial support for badblocks

 block/badblocks.c         |  79 +++++++++++++++++++++++++++++++++--
 fs/xfs/xfs_linux.h        |   1 +
 fs/xfs/xfs_mount.c        | 104 ++++++++++++++++++++++++++++++++++++++++++++++
 fs/xfs/xfs_mount.h        |   1 +
 include/linux/badblocks.h |  19 +++++++++
 5 files changed, 201 insertions(+), 3 deletions(-)

-- 
2.5.5

_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

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

end of thread, other threads:[~2016-06-24  1:41 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-17  1:03 [RFC PATCH 0/2] Initial support for badblock checking in xfs Vishal Verma
2016-06-17  1:03 ` Vishal Verma
2016-06-17  1:03 ` [RFC PATCH 1/2] block, badblocks: add a notifier for badblocks Vishal Verma
2016-06-17  1:03   ` Vishal Verma
2016-06-17  1:03 ` [RFC PATCH 2/2] xfs: initial/partial support " Vishal Verma
2016-06-17  1:03   ` Vishal Verma
     [not found]   ` <1466125419-17736-3-git-send-email-vishal.l.verma-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-17  2:26     ` Darrick J. Wong
2016-06-17  2:26       ` Darrick J. Wong
2016-06-17 19:26       ` Vishal Verma
     [not found]         ` <20160617192647.GC5893-PxNA6LsHknajYZd8rzuJLNh3ngVCH38I@public.gmane.org>
2016-06-17 19:53           ` Darrick J. Wong
2016-06-17 19:53             ` Darrick J. Wong
     [not found]             ` <20160617195345.GA5046-PTl6brltDGh4DFYR7WNSRA@public.gmane.org>
2016-06-17 20:32               ` Vishal Verma
2016-06-17 20:32                 ` Vishal Verma
     [not found]                 ` <20160617203237.GD5893-PxNA6LsHknajYZd8rzuJLNh3ngVCH38I@public.gmane.org>
2016-06-17 22:27                   ` Dan Williams
2016-06-17 22:27                     ` Dan Williams
     [not found] ` <1466125419-17736-1-git-send-email-vishal.l.verma-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-06-17  2:09   ` [RFC PATCH 0/2] Initial support for badblock checking in xfs Darrick J. Wong
2016-06-17  2:09     ` Darrick J. Wong
2016-06-20 18:48 ` Vishal Verma
2016-06-20 18:48   ` Vishal Verma
     [not found]   ` <20160620184812.GA21878-PxNA6LsHknajYZd8rzuJLNh3ngVCH38I@public.gmane.org>
2016-06-24  1:40     ` Darrick J. Wong
2016-06-24  1:40       ` Darrick J. Wong

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.