LU-3892 ofd: setattr doesn't need to return attributes

the root cause of the problem is that getattr finds the
object being already destroyed, so we have transno from
preceeding setattr and -ENOENT from getattr and this
confuses OSP.

there is actually no need in attributes in the reply.

Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Change-Id: Ib059a443af164d0def58fdfbf41ab545c057cd10
Reviewed-on: http://review.whamcloud.com/7672
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
LU-3490 autoconf: disable GSS when required libraries missing

Add 'auto' functionality to GSS keyring configuration to match
GSS configuration.

When using the 'auto' setting for GSS and GSS keyring, set
enable_gss/enable_gss_keyring to 'yes' if configuration tests pass
so GSS is actually built.

Disable GSS/KRB5 if both krb5_derive_key and krb5int_derive_key
are missing. In some distro such as Sles11sp1 and Ubuntu 10.04,
both of these libraries are missing

Remove #ifdef HAVE_STRUCT_CRED since it's not defined anywhere.
This is due to incomplete cleanup of autoconf from LU-2800

Signed-off-by: Patrick Farrell <paf@cray.com>
Signed-off-by: Minh Diep <minh.diep@intel.com>
Change-Id: I36eb1370afe42cbac3ac924ca8100acaa25558d9
Reviewed-on: http://review.whamcloud.com/7622
Tested-by: Hudson
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-3698 ptlrpc: skip rpcs that fail ptl_send_rpc

ptl_send_rpc is not dealing with -ENOMEM in some
situations.  When the ptl_send_rpc fails we need
set error and skip further processing or trigger
and LBUG

Original patch from Peng Tao.

Signed-off-by: Keith Mannthey <keith.mannthey@intel.com>
Change-Id: Ib90cb7841cd0866bcf08f6dcd702d65804992e1d
Reviewed-on: http://review.whamcloud.com/7411
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: Oleg Drokin <oleg.drokin@intel.com>
LU-3915 osd-ldiskfs: don't assert on possible upgrade

There are some cases possible during upgrade to the Lustre 2.5
from older versions which need workaround instead assertion.
The osd_object_ref_del() shouldn't assert on nlink == 0 if
object is local file but produce error message.

The underlying ext4_unlink() code doesn't treat decref on an
inode with nlink == 0 as a fatal error either, so only print
an error in the non-upgrade case for regular objects.

Signed-off-by: Mikhail Pershin <mike.pershin@intel.com>
Change-Id: I5aa1cc3d9a6d6210e8ce9f55193a4f25507b0986
Reviewed-on: http://review.whamcloud.com/7673
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3817 llite: Truncate to restore file

Truncate up is safe so it won't trigger restore.

Copy optimization for truncate down - only copy the part under
truncate length. If a file is truncated to zero usually it'll be
followed by write so I choose to restore the file and set correct
stripe information.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I5e64893bdeaeb7323566154e3469f3a0ce7797d4
Reviewed-on: http://review.whamcloud.com/7505
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Reviewed-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-by: Aurelien Degremont <aurelien.degremont@cea.fr>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3986 build: eliminate redundant kernel config files

fix lbuild to stop using two different names for kernel config files
delete redundant sles kernel config files

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: Idb214c67579028069ad1ad95eba621d80c44c661
Reviewed-on: http://review.whamcloud.com/7713
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2757 dynlocks: move into osd-ldiskfs

Commit 43603bd1 (LU-1548 osd: move i_htree_lock to iam container)
eliminated the use of dynlocks inside ldiskfs. Now that it's only
used in the osd-ldiskfs code, we can move it under osd-ldiskfs/,
and eliminate a patch we apply during build. Long term dynlocks
will never merged into the ext4 work so it makes sense to move it
to the osd-ldisk layer. Also the mdd layer was carrying techinical
debt of dynlocks as well so this patch removes it from that layer.
This work helps us move forward to a patchless ldiskfs in the
future.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I3d2ca2317426df3a7f3855d85a834a37091a78bd
Reviewed-on: http://review.whamcloud.com/5282
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-3249 tests: build POSIX test suite on FC18

While building POSIX test suite, some required header files are
not in the /usr/include directory on Fedora 18 distribution. On
FC18, only arm-gp2x-linux-glibc-2.3.6-11.fc18.noarch.rpm contains
those header files. This patch links those header files to the
standard system directory so as to make the building pass.

Test-Parameters: envdefinitions=SLOW=yes \
clientdistro=fc18 serverdistro=el6 clientarch=x86_64 \
serverarch=x86_64 testlist=posix

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: Idf622606d730d80a44e341bf7317dda37ea6bf82
Reviewed-on: http://review.whamcloud.com/7644
Reviewed-by: Minh Diep <minh.diep@intel.com>
Tested-by: Hudson
Reviewed-by: Wei Liu <wei3.liu@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3928 ost: update OST export connection flags

LU-1623 introduce atomically update export connection flags for MDT.
The same issue exist for OST. In any case the flags would be updated
for export, even if error handling code path occured.

Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com>
Xyratex-bug-id: MRP-1306
Change-Id: I4f93ff88cd94467cfe6d6fdb9d7214c727c43db2
Reviewed-on: http://review.whamcloud.com/7611
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-1480 lov: avoid subobj's coh_parent race

* during a file lov object initialization, we need protect the access
  and change of its subobj->coh_parent, since it could be another
  layout change race there, which makes an unreferenced lovsub obj in
  the site object hash table.

* dump lovsub objects in the site if the lovsub device reference > 0
  during its finalization phase.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: I5d4b79f25a13258cf04f04459f3f1780246b0144
Reviewed-on: http://review.whamcloud.com/6105
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3587 changelogs: Correct KUC code max changelog msg size

The kernel to userspace communication routines (KUC) allocate
and limit the maximum cs_buf size to CR_MAXSIZE.  However this
fails to account for the fact that the buffer is assumed to begin
with a struct kuc_hdr.  To allocate and account for that space,
we introduce a new define, KUC_CHANGELOG_MSG_MAXSIZE.

Change-Id: I623746126dd64c8016366ee5fdce094129e4103e
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/7406
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Revert "LU-3682 tunefs: prevent tunefs running on a mounted device"

This totally kills zfs testing and also prevents local testing even with ldiskfs.

This reverts commit 66858bc059362504d201262202549099185e69ba

Change-Id: I07a82203173b3ddff67f1def953a26e5009f0f2f
Reviewed-on: http://review.whamcloud.com/7748
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Tested-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3876 hsm: proc agent_actions fix up

In the original implementation, it will return ENOMEM if there
exists too many llog entries.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I48089bae566f28fd0128f749ce1581b1fc26d45b
Reviewed-on: http://review.whamcloud.com/7589
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: jacques-Charles Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3934 scrub: detect upgraded from 1.8 correctly

The OI scrub should has the capability to detect the case of the MDT
device upgraded from lustre-1.8 and trigger full OI scrub to process
IGIF mapping into OI files.

Originally, we detect that by checking /ROOT/.lustre via initial OI
scrub, but if the MDT is upgraded to lustre-2.1 firstly, and then
continue to lustre-2.4, the such detect mechanism will be failed.
Because lustre-2.1 does not support OI scrub, but will create the
/ROOT/.lustre.

The new detect mechanism will combine the checking OI file name and OI
scrub successfully scan count: if there is old OI file "oi.16" and OI
scrub has never successfully run on the device, then it is regarded as
upgrading case.

Test-Parameters: testlist=sanity-scrub
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I69d9b4f93797bb5589609d7ee0911ffd4262d0cb
Reviewed-on: http://review.whamcloud.com/7719
Tested-by: Hudson
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-3935 scrub: support dryrun mode OI scrub

The administrator can detect whether there are any inconsistent
OI mappings but without repairing them via the command:
lctl lfsck_start --dryrun on -M <$device>

Under default mode, dryrun is "off". When the device is mounted,
the initial OI scrub will detect whether there are upgrade case,
or file-level backup/resotre case, or OI file(s) recreated case.
If found some inconsistency, it will trigger non-dryrun mode OI
scrub automatically. If the administrator does NOT want to such
auto non-dryrun OI scrub to avoid some unexpected repairing, he
(or she) can specify "-o noscrub" when mount the device.

Test-Parameters: testlist=sanity-scrub
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: If00433aa40b43f0be284215009a2b01898fbad35
Reviewed-on: http://review.whamcloud.com/7720
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-3856 mount: fix volume label update

The -n|--nomtab options is used to do not update
/etc/mtab after mount, but this option prevents to
update volume label also. This patch resolve this issue.

Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com>
Xyratex-bug-id: MRP-1325
Change-Id: Ib39de6a64c0aaeb4eff1b8d88fd7c9d4514c6c7e
Reviewed-on: http://review.whamcloud.com/7712
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Hudson
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3976 tests: sanity-hsm test_9a is buggy

After a file is successfully archived, it's HSM status is
EXIST and ARCHIVED so 0x00000009
Also add a generic function to test the minimum count of clients
needed by a test

Test-Parameters: clientcount=4
Signed-off-by: JC Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Change-Id: I878e994d1a903646adc1c55e706ea9118196c0a1
Reviewed-on: http://review.whamcloud.com/7723
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
LU-3894 mdt: return EXDEV for cross-MDT rename

If target does not exist, and source directory is remote
directory, it should return -EXDEV.

Add test in test_24x to verify it.

Create local directory for test_214, since cross-MDT rename
is not allowed yet.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I0d4d8d96249ec23fcea5ab6ac5fce196728e8e73
Reviewed-on: http://review.whamcloud.com/7579
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-3719 ldiskfs: adjust s_mb_prealloc_table_size correctly

When mb prealloc table item value is not valid, the
s_mb_prealloc_table_size should be adjust accordingly.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: I17c0d440e4c89cae1780de63ca2b3a0d69de298b
Reviewed-on: http://review.whamcloud.com/7591
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alexander Boyko <alexander_boyko@xyratex.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
LU-3931 hsm: reprocess LDLM resource in mdt_hsm_release()

In mdt_hsm_release() manually reprocess the LDLM resource (the file
being released) after cancelling the lease (exclusive open lock on the
same file).

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Idc2333bc14432f24ef45d5f5d59c8518717c99c2
Reviewed-on: http://review.whamcloud.com/7621
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>