Skip to contentSkip to conversation

xfs_repair: improved secondary sb search

PATCH In review Bill O'Donnell 4 participants 10 messages May 11, 2016 – May 30, 2016 Kbuild

lore
Share & tools
lore
#0 lore raw

v5 cover xfs_repair: improved secondary sb search

Hello -

New iteration (v5) of this series...

Current xfs_repair uses a brute force approach to find a valid secondary sb. This series optimizes the secondary sb search, using similar method to determine geometry as that of xfs_mkfs. If the faster method fails in its search, fall back to original brute force slower search.

version history:
----
v1: http://oss.sgi.com/archives/xfs/2016-02/msg00304.html
v2: patch 2 whitespace fixups
v3: patch 2 correct functionality; style fixups
v4: patch 1,2 properly see to style and whitespace fixups
v5: patch 1 rebase to latest
----

patch 1 has some general infrastructure adjustments, moving general topology functions from mkfs to libxcmd.

patch 2 adds the new secondary superblock search method.

Questions, comments are welcome.

Thanks-
Bill

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#8 lore raw

PATCH v5 2/2 xfs_repair: new secondary superblock search method

Optimize secondary sb search, using similar method to find fs geometry as that of xfs_mkfs. If this faster method fails in finding a secondary sb, fall back to original brute force slower search.

---
 Makefile        |  2 +-
 repair/Makefile |  4 ++--
 repair/sb.c     | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++----
 3 files changed, 70 insertions(+), 8 deletions(-)
Makefile +1 -1
index fca0a42..1d60d9c 100644
@@ -80,7 +80,7 @@ fsr: libhandle
 growfs: libxcmd
 io: libxcmd libhandle
 quota: libxcmd
-repair: libxlog
+repair: libxlog libxcmd
 copy: libxlog
 
 ifeq ($(HAVE_BUILDDEFS), yes)
repair/Makefile +2 -2
index 251722b..d24ab1f 100644
@@ -20,8 +20,8 @@ CFILES = agheader.c attr_repair.c avl.c avl64.c bmap.c btree.c \
 	progress.c prefetch.c rt.c sb.c scan.c threads.c \
 	versions.c xfs_repair.c
 
-LLDLIBS = $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD)
-LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG)
+LLDLIBS = $(LIBBLKID) $(LIBXFS) $(LIBXLOG) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD)
+LTDEPENDENCIES = $(LIBXFS) $(LIBXLOG) $(LIBXCMD)
 LLDFLAGS = -static-libtool-libs
 
 default: depend $(LTCOMMAND)
repair/sb.c +67 -5

97 lines not on this page · raw message

Signature · 6 lines
2.5.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#1 lore raw

PATCH v5 1/2 libxcmd: generalize topology functions

In reply to Bill O'Donnell

Move general topology functions from xfs_mkfs to new topology collection in libxcmd.

---
 include/Makefile   |   1 +
 include/libxcmd.h  |  56 +++++++++
 libxcmd/Makefile   |   2 +-
 libxcmd/topology.c | 342 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 mkfs/Makefile      |   2 +-
 mkfs/xfs_mkfs.c    | 327 +-------------------------------------------------
 6 files changed, 402 insertions(+), 328 deletions(-)
 create mode 100644 include/libxcmd.h
 create mode 100644 libxcmd/topology.c
include/Makefile +1 -0
index 5fb443a..36a9741 100644
@@ -20,6 +20,7 @@ include $(TOPDIR)/include/builddefs
 
 LIBHFILES = libxfs.h \
 	libxlog.h \
+	libxcmd.h \
 	atomic.h \
 	bitops.h \
 	cache.h \
include/libxcmd.h new file +56 -0

56 lines not on this page · raw message

libxcmd/Makefile +1 -1
index 7701ed9..aab8d6d 100644
@@ -10,7 +10,7 @@ LT_CURRENT = 0
 LT_REVISION = 0
 LT_AGE = 0
 
-CFILES = command.c input.c paths.c projects.c help.c quit.c
+CFILES = command.c input.c paths.c projects.c help.c quit.c topology.c
 
 ifeq ($(HAVE_GETMNTENT),yes)
 LCFLAGS += -DHAVE_GETMNTENT
libxcmd/topology.c new file +342 -0

342 lines not on this page · raw message

mkfs/Makefile +1 -1
index 63ba4ec..f0e4ce1 100644
@@ -10,7 +10,7 @@ LTCOMMAND = mkfs.xfs
 HFILES =
 CFILES = maxtrres.c proto.c xfs_mkfs.c
 
-LLDLIBS += $(LIBBLKID) $(LIBXFS) $(LIBUUID) $(LIBRT) $(LIBPTHREAD)
+LLDLIBS += $(LIBBLKID) $(LIBXFS) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD)
 LTDEPENDENCIES += $(LIBXFS)
 LLDFLAGS = -static-libtool-libs
 
mkfs/xfs_mkfs.c +1 -326

345 lines not on this page · raw message

Signature · 6 lines
2.5.5

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Reviewed-by on the v5 series
#9 lore raw
In reply to Bill O'Donnell

Ok, just a rebase, and all the code moves match current upstream, so for both patches:

Quoted 27 lines · Bill O'Donnell

Hello -

New iteration (v5) of this series...

Current xfs_repair uses a brute force approach to find a valid secondary sb. This series optimizes the secondary sb search, using similar method to determine geometry as that of xfs_mkfs. If the faster method fails in its search, fall back to original brute force slower search.

version history:
----
v1: http://oss.sgi.com/archives/xfs/2016-02/msg00304.html
v2: patch 2 whitespace fixups
v3: patch 2 correct functionality; style fixups
v4: patch 1,2 properly see to style and whitespace fixups
v5: patch 1 rebase to latest
----

patch 1 has some general infrastructure adjustments, moving general topology functions from mkfs to libxcmd.

patch 2 adds the new secondary superblock search method.

Questions, comments are welcome.

Quoted 8 lines

Thanks-
Bill

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#2 lore raw

Re: [PATCH v5 1/2] libxcmd: generalize topology functions

In reply to Bill O'Donnell

I still think libxfs would be the better place, but otherwise this looks fine in general.

libxcmd/topology.c line 24

Quoted 4 lines
libxcmd/topology.c new file +4 -0
+#ifdef ENABLE_BLKID
+#  include <blkid/blkid.h>
+#endif /* ENABLE_BLKID */
+#include "xfs_multidisk.h"

But what tree is this against? I can't find a xfs_multidisk.h in the master branch, nor in this patch?

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw

Re: [PATCH v5 1/2] libxcmd: generalize topology functions

Quoted 10 lines · Christoph Hellwig

I still think libxfs would be the better place, but otherwise this looks fine in general.

libxcmd/topology.c line 24

Quoted 4 lines
libxcmd/topology.c new file +4 -0
+#ifdef ENABLE_BLKID
+#  include <blkid/blkid.h>
+#endif /* ENABLE_BLKID */
+#include "xfs_multidisk.h"

But what tree is this against? I can't find a xfs_multidisk.h in the master branch, nor in this patch?

xfs_multidisk.h came about a few days ago (4a32b9e928b80)
git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#4 lore raw

Re: [PATCH v5 1/2] libxcmd: generalize topology functions

Quoted 2 lines · Bill O'Donnell

xfs_multidisk.h came about a few days ago (4a32b9e928b80)
git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git

Gah, looks like I'm stuck on the oss.sgi.com repo..

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#5 lore raw

Re: [PATCH v5 1/2] libxcmd: generalize topology functions

Quoted 5 lines · Christoph Hellwig
Quoted 2 lines · Bill O'Donnell

xfs_multidisk.h came about a few days ago (4a32b9e928b80)
git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git

Gah, looks like I'm stuck on the oss.sgi.com repo..

We really need to kill that.

-Eric

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#6 lore raw

Re: [PATCH v5 1/2] libxcmd: generalize topology functions

Quoted 8 lines · Eric Sandeen
Quoted 5 lines · Christoph Hellwig
Quoted 2 lines · Bill O'Donnell

xfs_multidisk.h came about a few days ago (4a32b9e928b80)
git://git.kernel.org/pub/scm/fs/xfs/xfsprogs-dev.git

Gah, looks like I'm stuck on the oss.sgi.com repo..

We really need to kill that.

I only update xfsprogs on oss at releases. All dev happens on the kernel.org repo. Before we kill oss.sgi.com we have to sort out how to get release tarballs up on kernel.org. I'm pretty we can do that 'kup', but I haven't had time to work out the process needed to do that. This is really the only thing keeping us on oss.sgi.com.

I'm also not sure what to do with all the tarballs from previous releases that are on oss. I think I can regenerate all the recent releases (e.g. 3.2.0 onwards) without much trouble, but the older releases might be more of an issue. More investigation needed.

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#7 lore raw

Re: [PATCH v5 1/2] libxcmd: generalize topology functions

In reply to Bill O'Donnell
Quoted 4 lines · Bill O'Donnell

Move general topology functions from xfs_mkfs to new topology collection in libxcmd.

FYI, this patch breaks 'make deb'.

I don't expect anyone to know this - the debian/rules build script has a special hand-rolled mkfs build for the debian installer. This new libxcmd dependency also needs to be described in that script. I've fixed that up, but it's also pointed out a couple of other things to do with dependencies:

mkfs/Makefile LTCOMMAND = mkfs.xfs · line 15

Quoted 12 lines
mkfs/Makefile +1 -1
index 63ba4ec..f0e4ce1 100644
@@ -10,7 +10,7 @@ LTCOMMAND = mkfs.xfs
 HFILES =
 CFILES = maxtrres.c proto.c xfs_mkfs.c
 
-LLDLIBS += $(LIBBLKID) $(LIBXFS) $(LIBUUID) $(LIBRT) $(LIBPTHREAD)
+LLDLIBS += $(LIBBLKID) $(LIBXFS) $(LIBUUID) $(LIBRT) $(LIBPTHREAD) $(LIBXCMD)
 LTDEPENDENCIES += $(LIBXFS)
 LLDFLAGS = -static-libtool-libs

mkfs.xfs also needs the build dependency on libxcmd to be expressed in LTDEPENDENCIES. It's just lucky that other targets have already expressed such "libxfs + libxcmd" dependencies as that ensured libxcmd was already built before mkfs tries to link against it. Blind luck strikes again!

Those top level build dependencies are expressed in the top level Makefile like so:

Makefile +1 -0
@@ -82,6 +82,7 @@ io: libxcmd libhandle
 quota: libxcmd
 repair: libxlog
 copy: libxlog
+mkfs: libxcmd
 
 ifeq ($(HAVE_BUILDDEFS), yes)
 include $(BUILDRULES)

I've fixed these problems because I need to build .deb packages to deploy changes for testing.

Cheers,

Dave.

Signature · 7 lines
Dave Chinner
[email protected]

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs