ORI-162 osd-zfs: add dnode to directory entry

to maintain compatibility with ZPL we put dnode as a first
integer in a directory entry.
to export OST legacy object, add them to O/ mapping

Change-Id: I09f4ce588174a242750755043c5572bb6bc53c25
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/2002
Tested-by: Hudson
ORI-553 config: cfg_instance should be 'sb' on client

Don't use lsi as instance on client

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
ORI-553 test: fix test 61 in conf-sanity

update test according with Orion changes

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
ORI-549 mgc: fix incorrect config log name

mgc_apply_recover_logs() builds log names incorrectly, it should
use 'osp' only on MDS and 'osc' otherwise.

Signed-off-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Change-Id: I925bfad92ee66170fbe0a8fb73cbf383cacae343
Reviewed-on: http://review.whamcloud.com/2258
ORI-85 osd: fix several lost changes

- return back lost support for ACL and user xattr. ZFS OSD wasn't
  updated to support ddp_mntopts in dt_device_param properly and
  support for ACL and user xattr wasn't seen by upper layers.
- fix lost changes for osd_fid2oi(). Keep it in sync with master.

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Change-Id: I4ef9075e3c0b131d85ebeac38db7bcdb05a9d66c
Reviewed-on: http://review.whamcloud.com/2281
ORI-565 osd: fixes for the local storage lib

- replace assertion with error handling
- do new fid allocation and disk update atomically

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Change-Id: I842d566f54fb735affe6eaa03913cda9affe8ba5
Reviewed-on: http://review.whamcloud.com/2280
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
ORI-491 llog: Fix object references of named logs

The llog module inserts named logs into loc_dir but does not add
corresponding references.  This causes link count problems that are
visible when running e2fsck against an ldiskfs-based MDT.  This patch
adds the missing reference when creating a named log.

Change-Id: I5a4ca34ed897f0ff8b42c263f1dfe38f2422b74b
Signed-off-by: Li Wei <liwei@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/2225
Tested-by: Hudson
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
ORI-487 tests: print verbose fsx logs, run less

Because dual-mount fsx is taking so long to complete (average only
0.5 operation per second) it is desirable to figure out if there is
a particular operation that is causing the slowdown or not.  Enable
status updates for every operation on ZFS to monitor slow operations.

Also, in order to allow subtests after test_16 to be run, reduce
the number of operations to 500 for ZFS test runs until this bug
is fixed.

Conversely, for SLOW=yes runs on ldiskfs it is desirable to run fsx
longer, since this is a very valuable test for corner cases.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I339bca0f5857c17d958a781d1648ed34e040cf92
Reviewed-on: http://review.whamcloud.com/2253
Tested-by: Hudson
ORI-393 zfs-osd: basic zerocopy support

osd_get_bufs_read() grabs dbufs and list corresponding pages
in local niobuf array.

osd_get_bufs_write() loan an arc buffer for full block writes,
then assign them into arc (in commit path). in case of partial
block write osd_get_bufs_write() just allocate pages and use
them in bulks as before.

Change-Id: I4c9837491fe234bfc1751fc92e0f4d48f1178d98
Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/2141
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Tested-by: Hudson
ORI-507 osd-zfs: Multiple OIs

This change implements multiple OIs for ZFS OSDs.  While it was
based on what was done for ldiskfs that actual implementation
differs.  However, at the core the implementation still relies
on a simple power of two lookup table to map fids->OIs.

This issue is related LU-822, see commit 4db03b9 which contains
the original ldiskfs implemenation.

Change-Id: I16164ae2805e391556fa38f4684a7802a25df105
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-on: http://review.whamcloud.com/2173
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
LU-1205 tests: add timestamps to sanityn 18 mmap

The sanityn.sh test_18 mmap_sanity.c test sometimes takes over
an hour to run, and sometimes only seconds.  Add timestamps to
the subtest results so that it is possible to debug where that
time is being spent.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ie33c46d9b72083c79112455ac9df6f357dc7be7a
Reviewed-on: http://review.whamcloud.com/2289
Tested-by: Hudson
LLNL-xxx Support the lustre.spec in the Chaos 5 BuildFarm

Make spec search /usr/src/kernels for the files installed by RHEL's
kernel-devel package, instead of looking in /lib/modules/`uname -r`.
This will allow lustre to build in a minimal mock environment.

Change-Id: I67f00d285692b525707705f5ea0bce6867730428
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
LU-107 Add scripts for implementing heartbeat v1 failover

/usr/sbin/ldev - list devices, determine validity, etc.
/usr/sbin/lhbadm - wrapper for heartbeat utils for failover/failback/status
/etc/ha.d/resource.d/Lustre - heartbeat resource agent (wraps init script)
/etc/init.d/lustre - lustre init script
/etc/init.d/lnet - lnet init script
/usr/sbin/haconfig - helper script for building heartbeat config files

The scripts use two configuration files:
 /etc/ldev.conf - maps hostnames to failover partners, devices, and labels
 /etc/nids - hostnames to lustre NIDS

In addition to heartbeat support, the ldev script enables parallel
execution of commands against all luns configured on a server.  The
lustre init script supports devices backed by Linux software RAID, ZFS,
or traditional block devices.

NOTE: these scripts presume the udev rules for persistent block device
naming are in place, in particular that lustre labels can be mapped to
block devices in /dev/disk/by-id.

Change-Id: I160cab7fed36cf87f0dbc51c6df817bbe0cde584
Signed-off-by: Ned Bass <bass6@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
LU-936 Remove LUSTRE_KERNEL_VERSION

Patched kernels are no longer an absolute requirement for
Lustre servers.  Remove the LC_LUSTRE_VERSION_H autoconf
check and all usage of the LUSTRE_KERNEL_VERSION #define.
Going forward any specific kernel dependency should be
expressed with an explicit, clearly documented, autoconf
test.

As part of this change the check for automatically disabling
lustre server support has been moved to the ldiskfs autoconf
checks.  Previously this was done by checking for the
existance of a patched kernel.

Change-Id: Ifb5dcaf62638146a190f5d7417b9462177c5730d
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
LU-251 Fix gcc configure warnings

Newer versions of gcc are getting smart enough to detect the sloppy
syntax used for the autoconf tests.  It is now generating warnings for
unused or uninitialized variables.  Newer versions of gcc even have the
-Wunused-but-set-variable option set by default.  This isn't a problem
except when -Werror is set and they get promoted to an error.  In this
case the autoconf test will return an incorrect result which will result
in a build failure or runtime error later on.

To handle this I'm tightening up many of the autoconf tests to
explicitly mark variables as unused to suppress the gcc warning.  Tests
emitting uninitialized variable errors are updated to initialize
pointers to NULL, and some variables are converted to pointers to
accomodate this.  'Argument makes integer from pointer without a cast'
errors were fixed by passing 0 for the offending argument in cases where
we are not explicitly testing the argument type.  0 is accepted as both
an integer and a pointer.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Change-Id: Idaa04b04308e3cd994b0d802a5ee1eb5c90f9be6
LU-521 lnet: make LST support variable page size

LNet selftest can't support variable page size because it sends
number of pages over the wire.
We have to change wire format to fix this but it will have
compatibility issue, so this patch also implemented "session version"
for LST to resolve compatibility issue, only new version LST
can understand new bulk RPC format, although new LST nodes still can
communicate with old LST nodes.

This feature requires all nodes in the cluster are running with the
same session version, which means if there are some nodes are running
old version LST, those nodes with new LST also have to run with
compatible old version by setting env variable LST_VERSION.

Please see the Jira ticket (LU-521) for more details.

Change-Id: I4a552a3310cf0ed0a2f5ae29eaf789469e1c245a
Signed-off-by: Liang Zhen <liang@whamcloud.com>
LU-981 llite: fix loop back device writeback

In vvp_mmap_locks(), we should distinguish if the write is from
loopback device, and to not try to find mmap region in this case.

Signed-off-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Change-Id: I4409e460b77576e07e279200ccc69f62cc48ad0f
LU-1095 debug: Standardize, suppress mount/umount messages

Standardize mount/umount console message to include profile name,
and optionally suppress them with the 'quiet' mount option.  We
have been using private namespaces for testing and mounting then
umounting the FS as needed for each job.  In this context these
messages end up causing alot of syslog noise.

Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Change-Id: I7514f6016c337a358e5e31146644810dff292d02
LU-1095 debug: Common client/server message standardization

Enhance and standardize several common messages.  In particular
when a peer is involved ensure peers nid is in the message, and
on the server include the obd name in the message.

Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Change-Id: Iaea477e7dab240866a10c1863886d21d674e293d
LU-1095 debug: Quiet/cleanup various common console messages

Turn off several common message we always observe when restarting
servers assuming they are for the expected return code.  Simply
move others which are not helpful to an administrator to the
internal debug kernel log.  Less noise means your more likely
to spot the important error messages.

Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Change-Id: I523eacfe3c72480d62c915537427aa6c99428647