LU-3264 tests: support failover testing with ZFS

This patch improves test-framework.sh to support failover testing with
ZFS under shared storage configuration.

After formatting a ZFS target, "cachefile=none" property will be set
on the ZFS storage pool so that the pool is not automatically imported
on system startup. And then the pool will be exported so as to leave
the import and export operations handled by mount_facet() and stop().

For SOFT failure mode (unmount and mount), "zpool export …" will be
run on the active server node to export the ZFS storage pool, and
"zpool import -f …" will be run on the failover partner node to import
the pool.

For HARD failure mode (power off and on), since the "cachefile=none"
property has been set on the ZFS storage pool on the active server
node, after the node is power-cycled, the pool will not be imported.
Then on the failover partner node, "zpool import -f …" can be run to
import the pool.

Test-Parameters: envdefinitions=PTLDEBUG=-1,DEBUG_SIZE=128 \
mdtfilesystemtype=zfs mdsfilesystemtype=zfs ostfilesystemtype=zfs \
clientdistro=el6 serverdistro=el6 clientarch=x86_64 \
serverarch=x86_64 clientcount=4 osscount=2 mdscount=2 \
austeroptions=-R failover=true useiscsi=true \
testlist=recovery-double-scale

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I6b9646cb36f7fa4924af03a055ccb137187843a5
Reviewed-on: http://review.whamcloud.com/6258
Tested-by: Hudson
Reviewed-by: Li Wei <wei.g.li@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3269 build: Remove circular rpm dependency

The rpm package dependencies look a bit like this currently:

 lustre -> lustre-modules <-> lustre-osd-[ldiskfs|zfs] (via lustre-osd)

Note that the dependency between lustre-modules and lustre-osd-* goes both
ways.

We did that in the one direction because we need _something_ to
depend on the generic "Provides: lustre-osd" when we have server support
compiled in, so users will be clued in to the fact that they need to
select at least one of the lustre-osd-* packages.

In the other direction, the lustre-osd-* packages need to depend on
lustre-modules because the kernel modules contained in the lustre-osd-*
rpms really do use symbols from modules in the lustre-modules rpm.

RPM allows this circular dependency, but because of it the modules are not
necessarily installed in the order that we prefere.  Namely:

1) lustre
2) lustre-modules
3) lustre-osd-*

It can happen that the lustre-osd-* packages are installed before the
lustre-modules package, and then the sysadmin will see a screen full of
scary messages about missing symbols.

To fix that problem, we move the dependency on lustre-osd up one package
into the "lustre" package.  That makes the dependency graph look a bit
like:

   lustre -> lustre-modules
        |--> lustre-osd-[ldiskfs|zfs] (via lustre-osd)
   lustre-osd-[ldiskfs|zfs] -> lustre-modules

I by breaking the dependency loop, we get the desired package installation
order described above.

Change-Id: I7bab1d536e75ce4cf3eb70fa4569c435ec8b2d66
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/6259
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Brian J. Murrell <brian.murrell@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2979 lprocfs: use stats counter index for *pos

In lprocfs_stats_seq_{start,next,show,stop}() encode the counter index
(rather than the counter address) into *pos. Doing so simplifies these
functions and fixes a bug in the case of per-CPU stats where no stats
would be displayed at all if no events had yet occurred on CPU 0.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Id50f8ae480e151f8e16382db27eef8025ef69f15
Reviewed-on: http://review.whamcloud.com/6328
Tested-by: Hudson
Reviewed-by: wangdi <di.wang@intel.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3279 changelog: fix CL_LAYOUT, accept all types

In order to avoid compatibility issues with older ChangeLog consumers,
change the new CL_LAYOUT record to use the value previously assigned
to CL_IOCTL.  The CL_IOCTL type was never used anywhere, and it didn't
really make any sense as a ChangeLog record, since it could really
mean anything at all.

The changelog_show_cb() function is renamed to changelog_kkuc_cb(),
since it is really about consuming the ChangeLog and passing it up to
the kernel-user-coms interface.  At some point we should consider to
implement a DBUS-based ChangeLog interface as well.

The changelog_kkuc_cb() "sanity check" on cr_type was removed, since
there is no reason the client kernel needs to know every record type
that is being passed to userspace.  It is up to the client tool to
determine what records that it can process.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: Id8e6471827a89d8c62808e6b3cfd9693d6026431
Reviewed-on: http://review.whamcloud.com/6308
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Tested-by: Hudson
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Aurelien Degremont <aurelien.degremont@cea.fr>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>