LU-1881 mdd: cleanup partial modification

Usually, the modification triggered by client will be split into
several sub-operations in MDD layer and processed one by one. If
some step failed, we should rollback the former sub-operation(s)
to avoid partial modification the target(s) in RAM or on disk.

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: I02559618d252f65cd3ae3b26bd186b77c9f42dcc
Reviewed-on: http://review.whamcloud.com/3981
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
LU-1303 osp: Basic OSP device implementation

Initial OSP code: osp_device, osp_object and structures

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Change-Id: I21ea3d0cdfe07634278d8e7fee9a7c3fef79f81e
Reviewed-on: http://review.whamcloud.com/3958
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
LU-1303 osp: code to update per-OST last_id in OSP

Store and Update last_id - per OST counter of created objects.

Signed-off-by: Mikhail Pershin <tappro@whamcloud.com>
Change-Id: Iedd84afceb692f1b545c6dfe8e035de184952b18
Reviewed-on: http://review.whamcloud.com/3961
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
LU-1919 mount: do not access vfs mnt directly

from obd_mount.c - it's under OSD control now and at umount time
the structure can disappear with OSD, sooner then lustre umount
is completed.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I91bae528bc229cd4e0e191e61eae8a7854494c8f
Reviewed-on: http://review.whamcloud.com/3982
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-1301 lu: local objects library

set of functions working on top of OSD API to create/access
local objects by name.
the library maintains own top device to be able to work in
multi-service environment (mds + mgs).

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I26cc47b866bb0925be4f4419ac663a1d42520e02
Reviewed-on: http://review.whamcloud.com/3665
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
LU-1854 ptlrpc: track culled request seq

Ptlrpc service should track highest culled request-seq by storing
it in ptlrpc_servce_part::scp_hist_seq_culled, however, there is
a missed case in ptlrpc_server_drop_request(): if rq_reply_state of
the request is pre-allocated and it should be freed immediately,
ptlrpc_server_drop_request() will unlink the request from history
list w/o track sequence number, and it can be the reason of
hitting LASSERT while reading req_history.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I74ed9c7f00e77707628d628792bf9583c4bc4259
Reviewed-on: http://review.whamcloud.com/3916
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: wangdi <di.wang@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1856 build: fix 'out-of-bounds write' errors

Fix 'out-of-bounds write' defects found by Coverity version 6.0.3:
Out-of-bounds write (OVERRUN_DYNAMIC or OVERRUN_STATIC)
Overrunning array at too high offset.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: Idb2ed5f814bb0c4c9418cedffb8e01efae0f4bd7
Reviewed-on: http://review.whamcloud.com/3903
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Keith Mannthey <keith@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1905 build: Always create libcfs.a

Lustre and LNET utilites have become dependent on libcfs.a but
one can easily disable libcfs.a from being built by disabling
liblustre creation. This patch have Lustre always build libcfs.a.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: Id80f9baa16da238eca708409e0b5d5248e437c5a
Reviewed-on: http://review.whamcloud.com/3953
Tested-by: Hudson
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Brian J. Murrell <brian@whamcloud.com>
Reviewed-by: Artem Blagodarenko <artem_blagodarenko@xyratex.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-1747 osd-zfs: Return zero when deleting nonexistent EAS

sanity 103 with ZFS targets fails:

[22] $ strace -o /tmp/tmo.strace cp -rp h i -- failed
 ~                                     ? cp: preserving permissions
for `i/x': No such file or directory
 ~                                     ? cp: preserving permissions
for `i': No such file or directory

The ENOENTs came from osd-zfs's osd_xattr_del(), when MDD tried to
delete "system.posix_acl_access".

Test-Parameters: envdefinitions=USE_OFD=yes,LOAD_MODULES_REMOTE=true
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Change-Id: I3736b1a89bec3174f7e0a6a848870adfa248d186
Reviewed-on: http://review.whamcloud.com/3833
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Wei <liwei@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-1746 osd-zfs: fix LU_BUF_NULL in osd_xattr_list()

== sanity test 17k: symlinks: rsync with xattrs enabled
=========================== 17:49:09 (1344332949)
sending incremental file list
rsync: get_xattr_names: llistxattr(".",0) failed: Numerical
result out of range (34)
[...]

It happened like this:

  osd_sa_xattr_list()
  osd_xattr_list()
  ...
  mdt_getxattr_pack_reply()
  mdt_getxattr()

mdt_getxattr_pack_reply() passed LU_BUF_NULL as lu_buf to
learn how big the buffer should be.  osd_xattr_list() does
not support such queries with NULL buffers.

Test-Parameters: envdefinition=USE_OFD=yes,LOAD_MODULES_REMOTE=true
Signed-off-by: Minh Diep <minh.diep@intel.com>
Change-Id: I1aa63d9774770c14db2b332e634734cda3a160b6
Reviewed-on: http://review.whamcloud.com/3863
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Li Wei <liwei@whamcloud.com>
LU-1095 debug: quiet unnecessary console chatter

Quiet warning when configuring non-default CPT partitions, since this
will happen whenever the module parameter is changed.  Only complain
if the number of partitions is more than the number of cores, or if
it is more than 4x the recommended number.

Running racer.sh provokes a lot of messages from mdd_readdir(),
because it is doing "ls" in a directory that has been unlinked.
This is legal under POSIX and should not generate a console message.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I33afab093e9a03324a579244ce5177708735e7cc
Reviewed-on: http://review.whamcloud.com/3894
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Liang Zhen <liang@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1884 build: fix 'resource leak' errors

Fix 'resource leak' defects found by Coverity version 6.0.3:
Resource leak (RESOURCE_LEAK)
Variable going out of scope leaks the storage it points to.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: I6fe04d30c209d164ac8c741497c675a33ffcca6d
Reviewed-on: http://review.whamcloud.com/3934
Tested-by: Hudson
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Keith Mannthey <keith@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1842 quota: ldiskfs local enforcement

Quota local enforcement for ldiskfs osd

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: Ica4c1ae74c4af5a913691e60c080cb431e273c3c
Reviewed-on: http://review.whamcloud.com/3915
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
LU-1842 quota: zfs local enforcement

Quota local enforcement for zfs osd.

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: I91d6698cc5a3f1eb42dd7fc9120f83b70d2a7a6f
Reviewed-on: http://review.whamcloud.com/3933
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1756 kernel: cleanup lustre_compat25.h

1. unused functions:
   ll_remove_suid(), labs()
2. abs() is always defined
3. use SLAB_DESTROY_BY_RCU directly
4. call sb_any_quota_loaded() directl

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: Ic52e1a75f3d71887ae91f03a465112ab6c08c746
Reviewed-on: http://review.whamcloud.com/3688
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>