LU-4201 llite: clip page correctly for vvp_io_commit_sync

The original code was wrong which clipped page incorrectly for
partial pages started with zero.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I66ec542d5282fdfd68fe59f8056aca292b318c00
Reviewed-on: http://review.whamcloud.com/8531
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: wangdi <di.wang@intel.com>
LU-4365 quota: wait for global lock cancel

In qsd_qtype_fini(), we'd wait for the global lock cancel done.

Test-Parameters: envdefinitions=SLOW=yes,ENABLE_QUOTA=yes  mdtfilesystemtype=zfs mdsfilesystemtype=zfs ostfilesystemtype=zfs  testlist=recovery-small
Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: Ib51dba4e4e4b13693c49560162d53cb28937e253
Reviewed-on: http://review.whamcloud.com/8583
Tested-by: Jenkins
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
LU-4022 hsm: Set agent_actions start index from -1

aai_index was set to start from 0 which will cause the first entry
to be skipped. Set it to -1 instead.

Also take llog lock in proc_show() to avoid it from being changed
during the iteration.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I09013dbf8a85d198496d8470746e773b388d9bee
Reviewed-on: http://review.whamcloud.com/7879
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Aurelien Degremont <aurelien.degremont@cea.fr>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4321 build: Remove make_META.pl

This patch is a first pass at cleaning up version_tag.pl.

Primarily, it removes the strange "make_META.pl" symlink behavior.  It
is not at all clear to me why the symlink was being generated on the fly,
and then version_tag.pl changed its behavior based on its name.  Odd.

Instead version_tag.pl now take "--make_META" as the first option on
its command line.

Further, we haven't use CVS in a long time, so this patch removes
the cvs-related file and checks.

The is_git and is_cvs variables weren't even used, so those are removed
as well.

Change-Id: I651234bdf1d2d32db16151f332f2b3785ee123a0
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/8427
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3857 osd: cleanup procfs after osd_shutdown

Since osd_procfs_fini will try cleanup all proc entries,
and osd_shutdown/qsd_fini will try to cleanup procfs
itself, so osd_procfs_fini should be done after qsd_fini,
otherwise the qsd entries will be destoryed twice, and
caused panic

Call Trace:
 [<ffffffffa081cc45>] lprocfs_remove+0x25/0x40 [obdclass]
 [<ffffffffa0b23dd0>] qsd_fini+0x80/0x450 [lquota]
 [<ffffffffa0d2ec78>] osd_shutdown+0x38/0xe0 [osd_ldiskfs]
 [<ffffffffa0d36bf9>] osd_device_fini+0x129/0x190 [osd_ldiskfs]
 [<ffffffffa0834913>] class_cleanup+0x573/0xd30 [obdclass]
 [<ffffffffa081233c>] ? class_name2dev+0x7c/0xe0 [obdclass]
 [<ffffffffa083663a>] class_process_config+0x156a/0x1ad0 [obdclass]
 [<ffffffffa06be9b8>] ? libcfs_log_return+0x28/0x40 [libcfs]
 [<ffffffffa082f202>] ? lustre_cfg_new+0x312/0x6e0 [obdclass]
 [<ffffffffa0836d19>] class_manual_cleanup+0x179/0x6e0 [obdclass]
 [<ffffffffa06be9b8>] ? libcfs_log_return+0x28/0x40 [libcfs]
 [<ffffffffa0d378b4>] osd_obd_disconnect+0x174/0x1e0 [osd_ldiskfs]
 [<ffffffffa083926b>] lustre_put_lsi+0x1ab/0xeb0 [obdclass]
 [<ffffffffa08414d8>] lustre_common_put_super+0x5c8/0xbe0 [obdclass]
 [<ffffffffa087081d>] server_put_super+0x1bd/0xed0 [obdclass]
 [<ffffffffa0871bbb>] server_fill_super+0x68b/0x1630 [obdclass]
 [<ffffffffa0840bb8>] lustre_fill_super+0x1d8/0x530 [obdclass]
 [<ffffffffa08409e0>] ? lustre_fill_super+0x0/0x530 [obdclass]

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: If12cebf971583afeeaa031bd24f69bb0fe0cdf1a
Reviewed-on: http://review.whamcloud.com/8506
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3601 Do not create layout in lease-open

leases are not real opens so it makes no sense to create layouts
when the lease is taken.

Change-Id: Ica2d6a348c360bd20bb7bd27061839df84dae84b
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Reviewed-on: http://review.whamcloud.com/8084
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
LU-4152 mdt: Don't enqueue two locks on the same resource

Due to mechanics of ldlm internals, enqueueing two different ibits
lock on the same resource is deadlock prone.
As such change mdt_object_open_lock to release open lock if it becomes
necessary to get exclusive layout lock (to create objects).
It's ok to release the open lock right away as it's never guaranteed to
be issued anyway.

Change-Id: Ib669e68323ea72c75a0a8bea289d8bea079309b0
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: http://review.whamcloud.com/8083
Tested-by: Jenkins
Reviewed-by: Patrick Farrell <paf@cray.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
LU-3528 osd: check LOCAL sequence file in special directory

Check Local sequence file in special directory, otherwise
special file like fldb might be missing during upgrade.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I483151510b943ae9b9d9ba0b13f5ce67c4bfa5bb
Reviewed-on: http://review.whamcloud.com/8354
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4396 tests: Remove unnecessary skip in sanity test_31n

Since test_31n now uses the function free_fd to find an unused file
descriptor, it no longer depends on fd 173 being free.  This change
removes that test on whether fd 173 is in use.

Signed-off-by: Ryan Haasken <haasken@cray.com>
Change-Id: I3b68e278d4f3a8af42e57b073ccbe45b80e76ecd
Reviewed-on: http://review.whamcloud.com/8622
Reviewed-by: Chris Horn <hornc@cray.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Patrick Farrell <paf@cray.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-3528 mdt: check object exists for remote directory

Check whether the remote object exists before enqueue and
getattr to avoid LBUG.

Remove unnecssary remote object exist check in mdd_object_lock.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: Ia634a8c7b9cd2810515e854163c5fdd6bdf8716f
Reviewed-on: http://review.whamcloud.com/8371
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2789 mdt: ensure constant striping during chown()

Prevent concurrent setstripe and chown() operations on a file by
acquiring mot_lov_mutex in mdt_attr_set(). This is needed to maintain
consistency between the ownership of files and their sub-objects and
to ensure that attribute changes on sub-objects are properly declared.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I75fe3476a284dccde5312a5c3f79b3698610ef25
Reviewed-on: http://review.whamcloud.com/6070
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4379 procfs: dont always check max_pages_per_rpc alignement

If connection is not established yet, cli->cl_chunkbits is
uninitilized so we cannot use it to check max_pages_per_rpc
alignment.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: I4c782e2eeb5a2757d79194ee6ab6bff831a283fc
Reviewed-on: http://review.whamcloud.com/8558
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
LU-3700 tests: zfs: work around blocks check for sanity-hsm/21

The number of blocks for ZFS reflects the number of blocks
written to disk.  To get an accurate number, the file on the OST needs
to be fully flushed.

Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: I99ffac888a80b046b8c446021124e92f0f313f27
Reviewed-on: http://review.whamcloud.com/8575
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-4221 osd: add case LCFG_PARAM to osd_process_config

Some proc parameters were moved from ofd to osd module and only
their symlinks were kept in ofd for interoperability/compatibility.
To process this kind of config params passed by ofd, this patch is
to do the following fixes:
- add case LCFG_PARAM to osd_process_config() to process parameters
  with prefix both PARAM_OSD and PARAM_OST.
- since these parameters are not included by the static lprocfs var
  list, a pre-check is added for them to avoid "unknown param" error
  message confuses the uses. If they are matched in this check, they
  will be passed to the osd directly.
- get rid of lprocfs_osd_init_vars() and use struct lprocfs_vars
  lprocfs_osd_{obd,module}_vars[] instead.
- improve the error messages in class_process_proc_param() and
  class_process_proc_seq_param() a little.
- add conf-sanity.sh test_28a to verify the patch and skip this test
  for ZFS OSTs since ZFS has no such kind of parameters.

Signed-off-by: Emoly Liu <emoly.liu@intel.com>
Change-Id: I8f64dcc29017c3ed9da010ff0a3e40c02327f05c
Reviewed-on: http://review.whamcloud.com/8238
Tested-by: Jenkins
Tested-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
LU-4364 fld: add error handler in fldb_seq_start

Check return value for load/key in fldb_seq_start,
in case there are no entries in FLDB.

Only insert special entries to the local FLDB in MDT0,
since they are all in MDT0.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: If1281800ad75396c96bd47021742ea21da7abad8
Reviewed-on: http://review.whamcloud.com/8534
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Tested-by: Oleg Drokin <oleg.drokin@intel.com>
LU-793 ptlrpc: fix ptlrpc_request_change_export()

The ptlrpc_request_change_export() is incompatible with recent
changes related to LU-793. It moves requests having rq_exp_list
to the new export exp_hp_req list assuming only hp requests have
rq_exp_list used, but now all requests use it. That may cause
normal requests to be moved to the hp queue.

Patch checks rq_ops instead and move request into proper list.
Second change fixes CFS_FAIL_TIMEOUT define, it uses sec * 1000
but 'sec' can be expression so it must be (sec) * 1000

Signed-off-by: Mikhail Pershin <mike.pershin@intel.com>
Change-Id: I2c385a824453a7cfaeede80180b3a83f72fc0f5b
Reviewed-on: http://review.whamcloud.com/8582
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
LU-2875 mdt: use lu_name for rr_name and rr_tgt

In mdt_reint_record, use a struct lu_name for rr_name and
rr_tgt. Rename the rename target name rr_tgt to rr_tgt_name. Add a
function lu_name_is_valid() to check the validity of names. Remove
various assertions on the validity of names in MDT requests and
replace them with calls to mdt_reint_record() and returns of -EPROTO
on failure.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I6e0e207522a72eb8cec5d7918795c4aed5b9c4c2
Reviewed-on: http://review.whamcloud.com/7961
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2675 lov: remove unused lov llog code

Remove the unused functions lov_llog_init(), lov_llog_finish(),
their supporting functions, and the file lov_log.c.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I1eaad74bbea5849cc8b28388112b6bd86b7a9781
Reviewed-on: http://review.whamcloud.com/8539
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
LU-3386 lproc: improve osc/mdc "imports" connect data

Improve /proc/fs/lustre/{osc,mdc}/*/import files to print
the struct obd_connect_data data fields as "connect_data:"
in addition to the "connect_flags:" field.

Signed-off-by: Liu Ying <emoly.liu@intel.com>
Change-Id: If37043ee05c1ab387e0762f9ecb34fbe2602afc4
Reviewed-on: http://review.whamcloud.com/6588
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
LU-3963 libcfs: convert obdecho,obdclass code to atomics

This patch converts all cfs_atomic primitives in
target, obdclass and obdecho.

Signed-off-by: Liu Xuezhao <xuezhao.liu@emc.com>
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I6ab6d7a476f5192e6bdfb39d4956361ce2b3e987
Reviewed-on: http://review.whamcloud.com/7075
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>