LU-2391 build: separate lustre-osd-[ldiskfs,zfs] RPMs

Add support for separate lustre-osd-[ldiskfs,zfs] RPMs creation in
lustre.spec.in template. This will prevent osd_[ldiskfs,zfs].ko
modules from being shipped as part of lustre-modules RPM and thus
avoids having many unsatisfied external references error messages
reported when either lustre-ldiskfs or zfs-modules RPMs are missing.
Users willing to build Lustre FSs on top of ldiskfs/zfs back-ends
will have to install the corresponding RPM.

Signed-off-by: Bruno Faccini <bruno.faccini@intel.com>
Change-Id: Ib406443186026ed5ac3dc7b3ec30db41aedac2a2
Reviewed-on: http://review.whamcloud.com/4869
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Brian J. Murrell <brian.murrell@intel.com>
Reviewed-by: Christopher J. Morrone <chris.morrone.llnl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2548 quota: don't apply migration on global index copy

Quota migration shouldn't be applied on the global index copy of
quota slave on mdt.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I9f36b79e867ede20562223765dfc56358a4f3831
Reviewed-on: http://review.whamcloud.com/5259
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
LU-2227 build: fix 'memory illegal access' errors

Fix 'memory illegal access' defects found by Coverity version
6.0.3:
Buffer not null terminated (BUFFER_SIZE_WARNING)
Calling strncpy with a certain maximum size argument on
destination array of same size might leave the destination string
unterminated.
Out-of-bounds read (OVERRUN_STATIC)
Overrunning static array with n elements, at position n.
String not null terminated (STRING_NULL)
Function does not terminate string.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: I5ded09054b2e0e5296ba17d7528518fed298fc89
Reviewed-on: http://review.whamcloud.com/4391
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2786 llite: allow setting pool name via fsetxattr()

Setting the pool name in the striping data of a file fails when the
fsetxattr() interface is used to store the lustre extended attributes,
while using ioctl() works as expected.  This is because ll_setxattr()
assumes the size of the lustre user metadata structure to be that of
the older v1 format which doesn't include a pool name field.  Fix this
by using the magic number to detect the format version and setting
the size accordingly when passing the user data down the stack.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Change-Id: I6f6969dfaf2149f268d52272f538fee05459697b
Reviewed-on: http://review.whamcloud.com/5313
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-2675 cleanup: make bitfield (un)signedness explicit

Fix this common sparse warning (dubious one-bit signed bitfield) in
case ones-complement machines come back or something.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I24ea468efedd8a1269ea92022d13e802f4838ba1
Reviewed-on: http://review.whamcloud.com/5166
Tested-by: Hudson
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Sebastien Buisson <sebastien.buisson@bull.net>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-2620 tests: Flush changes from test 5 in replay-ost-single

Use wait_delete_completed_mds to flush out and wait for all the
effects on kbytesavail from test 5 to finish before test 6 starts.

Test-Parameters: testlist=replay-ost-single envdefinitions=SLOW=yes

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: Id37cf23402dd609e6743c36a1aff8e71dd246776
Reviewed-on: http://review.whamcloud.com/5042
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2770 llite: specify ea_size for md_getattr_name

For nfs re-exported case, miss to set ea_size for md_getattr_name(),
then causes the ll_get_parent failure.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I99c8301f9b00cafdf79a6c15541f868f18e4a109
Reviewed-on: http://review.whamcloud.com/5455
Tested-by: Hudson
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2789 lod: initialize objects in a detached stripe array

Initializing the ldo_stripe member of lod_device in place exposes some
races with attribute setting so instead we use a detached array and
assign that to ldo_stripe once it's complete.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I63d57a21ed7402829d4b3889c1f32d4ddec1f096
Reviewed-on: http://review.whamcloud.com/5422
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2158 lvfs: move ldiskfs only functions to osd-ldiskfs

Currently a lot of functions exist in the lvfs layer
that really belongs to different parts of the stack.
This patch moves osd-ldiskfs specific code that
is located in the lvfs layer into the proper
location.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: Ia197391599cc7fffad396d487873edd9d6c0b1c4
Reviewed-on: http://review.whamcloud.com/5246
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-2158 lvfs: move obdclass related functions to obclass

Currently a lot of functions exist in the lvfs layer
that really belongs to different parts of the stack.
This patch moves obdclass specific code that is located
in the lvfs layer into the proper location.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I5be4dede1afdbbc4af0157cbcd13a5133ce7a1db
Reviewed-on: http://review.whamcloud.com/5250
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2642 osd-ldiskfs: Use __REQ_WRITE instead of BIO_RW.

Commit 7b6d91da removed BIO_RW and replaced it with __REQ_WRITE.
(v2.6.35)

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Change-Id: I33f87d1e7d8ffe90efcd8b173ad56d9ecf723d7a
Reviewed-on: http://review.whamcloud.com/5121
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-2729 mgs: fix cleanup of nonexistant MGSSELF_NAME proc file

The mgs teardown code gets invoked in the failure case but assumes
that the MGSSELF_NAME proc file has been created. If it hasn't been
created, the proc code issues a WARN_ON.

The setup code clears the FSDB_MGS_SELF from &fsdb->fsdb_flags when it
creates the proc file, so we can key off of that to decide whether to
remove it.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Change-Id: Idf58d1fa572eeced5dbaa72f03e38ee46a708166
Reviewed-on: http://review.whamcloud.com/5122
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-2739 mdt: Deny non-DNE client to access remote directory

Return EIO to old clients, if they try to access the remote
directory.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I1cc4e8fa6e0f3a4b31b5610642e204bd100c1743
Reviewed-on: http://review.whamcloud.com/5425
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>