LU-921 llite: warning in case of discarding dirty pages

when a client is evicted, dirty pages may get silently discarded,
the caller of successful write(2) will not know that the data he
wrote have been discarded due to eviction before it can be flushed
to the OSS.

Signed-off-by: Hongchao Zhang <hongchao.zhang@whamcloud.com>
Change-Id: Iecfbf096548ff08cdd6064d53ad8c688343fcddc
Reviewed-on: http://review.whamcloud.com/1908
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-2211 quota: cap how long a thread can wait for quota

Change qsd_op_begin() path to wait for quota space for less than
obd_timeout / 2.
This patch also abandons the qsd_ops enum in favor of a more generic
qsd_adjust() implementation which will always do the same processing
even if adjustment is delayed because of a quota request in flight.

Signed-off-by: Johann Lombard <johann.lombardi@intel.com>
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: I5faf637c5330ca7f503c292e0e28edb84458ee89
Reviewed-on: http://review.whamcloud.com/4314
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
LU-2152 iam: it->load fix

Current iam it->load for lfix doesn't work properly because
iam_lfix_ilookup() isn't implemented at all.

This patch also added one more reintegration test for quota to
test the global index transfer in multiple bulks, and proc entry
for global index copy is added to verify the limits on slaves
easily.

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: Ifb1dca0551b2aa4db3d37ff4ac6b3fcded34b7cc
Reviewed-on: http://review.whamcloud.com/4266
Tested-by: Hudson
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-2226 osp: dump statfs data via lprocfs

register another set of vars to be accessed with
data=dt device. use existing lprocfs_osd_rd_*() helpers.

Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Change-Id: Ib2fed358866847d8abb0e818c1d40494c0642681
Reviewed-on: http://review.whamcloud.com/4390
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
LU-1169 mgs: Fix race during new fsdb creation.

Lock fsdb_mutex until the fsdb is loaded from llogs.
It fixes race between loading data from llog into fsdb
and obtaining data form it.

Xyratex-bug-id: MRP-230
Signed-off-by: Andriy Skulysh <andriy_skulysh@xyratex.com>
Reviewed-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
Reviewed-by: Andrew Perepechko <andrew_perepechko@xyratex.com>
Reviewed-by: Bruce Korb <Bruce_Korb@us.xyratex.com>
Change-Id: I8c29040a182f363e83e61e57d3e20756f40300ea
Reviewed-on: http://review.whamcloud.com/2251
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-1279 utils: mount.lustre load ptlrpc module if necessary

When LNET modules have not loaded, and mounting multiple targets at
the same time could fail. Use mount.lustre to load the network modules
if necessary.

Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I9d7a4007cc5b233055a4a985237b01ff0874cf54
Reviewed-on: http://review.whamcloud.com/4292
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
LU-845 tests: automate large LUN testing

a. run llverdev on the raw device to verify there is no driver issue
b. run llverfs on OST ldiskfs filesystem
c. use up free inodes on the OST with mdsrate
d. run llverfs on lustre filesystem

Change-Id: I021009647d2053fa53cff1067f8f2bc83d12ce45
Signed-off-by: Wei Liu <sarah@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1700
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1337 osc: fix -Werror=unused-result

Newer Fedora kernels build using -Werror=unused-result.  It appears
that GOTO() isn't correctly assigning rc in this instance.  The
unused PTR_ERR() is generating warning which is upgraded to an error.

Signed-off-by: chas williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Change-Id: I66d730d4d0e20f0f1c7671dc00acefdf7ed1fbe9
Reviewed-on: http://review.whamcloud.com/3638
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1994 kernel: v3.5 defines INVALID_UID

With kernel commit 7a4e7408, Lustre doesn't need to redefine
INVALID_UID.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: I96b854cc51db735d8c985528c879fbeb5b049ab9
Reviewed-on: http://review.whamcloud.com/3755
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1337 build: remove unnecessary includings of system.h

<asm/system.h> is removed in kernel 3.4, and it is indeed not needed.

Signed-off-by: Liu Xuezhao <xuezhao.liu@emc.com>
Change-Id: Ic4d0a086656c5dfb05669aae40680b41e8ea00c7
Reviewed-on: http://review.whamcloud.com/3575
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-2153 quota: several fixes for reintegration

- On master side, never delete the id entry from the global/slave
  index, otherwise, those deleted entries will not be transfered
  during reintegration, and improved test_7a for this change;
- When start reintegration thread, if there is any pending
  updates, abort and try to start reintegration later;
- Set rq_no_retry_einprogress for quota request;
- When master found quota acquire for not enforced ID, return
  -ESRCH to slave instead of -EINPROGRESS;
- Check free inodes in test_2;

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: I64037f6aff6be686250272eda53c027bf5ba47c2
Reviewed-on: http://review.whamcloud.com/4275
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
LU-1337 llite: kernel 3.1 kills inode->i_alloc_sem

Kernel 3.1 kills inode->i_alloc_sem, use i_dio_count and
inode_dio_wait/inode_dio_done instead.
(kernel commit bd5fe6c5eb9c548d7f07fe8f89a150bb6705e8e3).

Add HAVE_INODE_DIO_WAIT to differentiate it.

Signed-off-by: Liu Xuezhao <xuezhao.liu@emc.com>
Change-Id: Ife36e07a85c76153985a4a86ee1973262c4c0e27
Reviewed-on: http://review.whamcloud.com/3582
Tested-by: Hudson
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-928 fid: add comments describing different FIDs

Add comments to the code describing various FID types, from
http://wiki.lustre.org/index.php/Architecture_-_Interoperability_fids_zfs

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I325b48a0e85fb25ed8c3a3709e623978969d8d4a
Reviewed-on: http://review.whamcloud.com/4102
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Ned Bass <bass6@llnl.gov>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1279 utils: Silence modprobe ptlrpc output in mount.lustre

Patch d8d9b78a5c08eb1d938ab9e3bdaf7f756bfbb5ec introduced
this modprobe, but order of redirects was reversed which results
in printing spurios messages like "FATAL: Module ptlrpc not found."
when mountig lustre from local build dir.

Change-Id: I688d073ad3b0565f73c29a50c2b81383adfd7a48
Signed-off-by: Oleg Drokin <green@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/4449
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-930 utils: minor fixes to lfs_migrate.1 man page

Fix the formatting of the lfs_migrate.1 man page SYNOPSIS section,
since ".Blfs_migrate" is not the same as ".B lfs_migrate", and hence
the synopsis was missing the actual name of the command it described.

Also fix some minor grammar issues.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ie0d8e3cd6fbab0663562b6a99f124ead953ebbe5
Reviewed-on: http://review.whamcloud.com/4440
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Reviewed-by: Richard Henwood <richard.henwood@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1337 llite: kernel 3.1 changes open_to_namei_flags

Kernel 3.1 changes the translation from open_flag to namei_flag,
(kernel commit 8a5e929dd2e05ab4d3d89f58c5e8fca596af8f3a).

So after 3.1, kernel's nameidata.intent.open.flags is different
with lustre's lookup_intent.it_flags, as lustre's it_flags'
lower bits equal to FMODE_xxx while kernel doesn't transliterate
lower bits of nameidata.intent.open.flags to FMODE_xxx.

This patch keeps lustre it_flags' semantics and add
ll_namei_to_lookup_intent_flag for translation.

Signed-off-by: Liu Xuezhao <xuezhao.liu@emc.com>
Change-Id: I408685040688bae574d04cf288abb6ca967607df
Reviewed-on: http://review.whamcloud.com/3583
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1337 llite: provides ll_get_acl to ->i_op->get_acl

Since kernel 3.1 generic_permission() has lost the check_acl
argument, ACL checking has been taken to VFS and filesystems
need to provide a non-NULL ->i_op->get_acl to read an ACL
from disk.

This patch is a complementarity to http://review.whamcloud.com/3397
(d018b087c962b8c66e8dc479fc66e964a2e5fd94), to fix failure of test_25
of sanityn.sh.

Signed-off-by: Liu Xuezhao <xuezhao.liu@emc.com>
Change-Id: Ica96adac03c1792e2e8b668b959457a4ffec9a43
Reviewed-on: http://review.whamcloud.com/3885
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1951 mdd: fix for error handler of mdd_rename

If mdd_rename() failed to unlink target file/dir, it will try to
revert everything including insert target file/dir back into target
directory, but it didn't restore nlink count of target, which will
leave a file/dir under target directory with wrong nlink number.

Another thing is fixed by this patch is, mdd_attr_check_set_internal()
didn't release mdd_write_lock() while jumping to error handler.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Change-Id: I601f0569de87b71d032f86ed1082c27d5bf5adaf
Reviewed-on: http://review.whamcloud.com/4405
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1840 ldlm: fix mutex leak in ldlm_resource_get

We created resource with lr_lvb_mutex locked. Need to drop
it before returning.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: Id81f792605d864b9d3236498f063d6c003d8cd77
Reviewed-on: http://review.whamcloud.com/3883
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1714 lnet: Properly initialize sg_magic value

When the CONFIG_DEBUG_SG flag is enabled in the kernel, we must ensure
the sg_magic field is properly initialized. Otherwise, internal kernel
assertions will fail when trying to verify this field. As a result,
certain calls to sg_* function had to be changed or inserted to ensure
the sg_init_table function would be called, initializing the magic
value. Also, we need to ensure this value isn't zeroed out in the
kiblnd_setup_rd_kiov function.

Signed-off-by: Prakash Surya <surya1@llnl.gov>
Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com>
Reviewed-by: Alexander Zarochentsev <alexander_zarochentsev@xyratex.com>
Reviewed-by: Andrew Perepechko <andrew_perepechko@xyratex.com>
Change-Id: I5b6b265a4a8dd37408bb78decd79ed54e0f9251b
Reviewed-on: http://review.whamcloud.com/3709
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>