LU-1095 debug: fix missing CDEBUG() newline

The console message cleanup 389fde827be2ee6fb4ee08e955d773a2a16e70c6
lost a newline in one of the messages, which itself generates a
warning on the console.

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Ie5eed2977e496e082d5b8e62bfc39e0df93fcab0
Reviewed-on: http://review.whamcloud.com/3134
Reviewed-by: Li Wei <liwei@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-56 lnet: split lnet_commit_md and cleanup

Briefly, LNet has two types of operations: 1) resource operations
on EQ, MD and ME; 2) network operations on credits, peer, NI etc.
Most of them are in different logic blocks, but there are still
a few functions have mixed operations, lnet_commit_md() is one of
these functions.

This patch is a key step for LNet SMP improvements, lnet_commit_md()
of current LNet did two things: 1) consume MD threshold and commit
it to network; 2) attach the message on active message list to show
it might have taken LNet message credits. This patch split it into
two sets of functions, lnet_msg_attach/detach_md and
lnet_msg_commit/decommit,

We need to call lnet_msg_attach_md and lnet_msg_comit before deliver
a message to network, call lnet_msg_detach_md and lnet_msg_decommit
while finalizing a message. These two sets of functions will be
protected by different locks in upcoming patches.

Another change in this patch is, we moved most counters operations
into lnet_msg_decommit, this will make code cleaner and easier for
the next step work. The reason that we put counters operations in
lnet_msg_decommit instead of lnet_msg_commit is because we can't
guarantee lnet_msg_commit is always called after lnet_msg_attach_md,
and counters need information filled by lnet_msg_attach_md, which
means lnet_msg_commit might not have enough information for counters.
The thing we know for sure is lnet_msg_decommit is always called
after lnet_msg_attach_md, so it's safe to put counter operations
inside lnet_msg_decommit.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: Iee961fbff6e6e39ed76c14c0bd5b6560a7730af9
Reviewed-on: http://review.whamcloud.com/2997
Tested-by: Hudson
Reviewed-by: Doug Oucharek <doug@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-56 lnet: code cleanup for lib-md.c

This patch just did some code cleanup for lib-md.c, it's an
intermediate patch for LNet SMP improvements.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I5d162852008284ae08f3b9e7935c9251b245fb5c
Reviewed-on: http://review.whamcloud.com/3010
Tested-by: Hudson
Reviewed-by: Doug Oucharek <doug@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-56 lnet: match-table for Portals

Create sub-object named as "match-table" for each Portal, MEs will
be attached match-table instead of Portal.
Although we only have one match-table for each Portal in this patch,
but in upcoming changes, we will create multiple match-tables
for each Portal:
- unique-match Portal
  MEs will be scattered to different match-tables by match info
- wildcard Portal
  LND threads just grab ME/MD from match-table corresponding to
  current CPT (CPU partition).

We also did some code cleanup for delayed message in this patch.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I2b24723c3bd2a6664f2b241840de19d5f43be11f
Reviewed-on: http://review.whamcloud.com/3043
Reviewed-by: Doug Oucharek <doug@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-56 lnet: code cleanup for lib-move.c

Most changes in this patch are just code cleanup:
- remove one unnecessary lock dance for message forwarding
- move some code blocks to make functions cleaner
- rename lnet_ni_peer_alive to lnet_ni_query_locked

It's an intermediate patch LNet SMP improvements.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: Ia7cfe37a5a4f896be4fcc7f6c5cf9c27268de9ba
Reviewed-on: http://review.whamcloud.com/3048
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Doug Oucharek <doug@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-957 scrub: osd-ldiskfs itable based iteration

Implement inode table based object iteration in osd-ldiskfs.
It is implemented as DT iteration APIs, which can be used by
up layer LFSCK to scan the whole device sequentially.

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: I3d80bb4a174d47429764e5cca35e4f07be52d50b
Reviewed-on: http://review.whamcloud.com/2553
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-1438 quota: quota active checking is missed on slave

On quota slave, we missed checking if quota is enabled in the
quota_check_common() and several other places. Which could cause
slave retry acquire quota in quota_chk_acq_common() infinitely
when the quota is already turned off on master.

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: Iaa48c7cca05daf595b6d3b7e4025c7650e460918
Reviewed-on: http://review.whamcloud.com/3097
Tested-by: Hudson
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
LU-1493 quota: extra release caused by race

There is a race between the check_cur_qunit() and the
dqacq_completion(): check_cur_qunit() read hardlimit
and calculate how much quota need be acquired/released
based on the hardlimit, however, the hardlimit can be
changed by the dqacq_completion() at anytime. So that
could result in extra quota acquire/release when there
is inflight dqacq.

In general, such extra dqacq dosen't bring fatal error,
unless an extra release is going to release more than
'hardlimit' quota.

To minimize the code changes (anyway, it'll be totally
rewritten in the new quota design), we just do one more
check here to avoid the extra release which could bring
fatal error. A better solution could be calculating the
qd_count here and removing the lqs_blk/ino_rec stuff.

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: I0ad5ff0f32e39f32872c201ad1d545fbd9d1a57d
Reviewed-on: http://review.whamcloud.com/3074
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
LU-1459 llite: Don't LBUG when import has LUSTRE_IMP_NEW state

When a disabled OSC/OST is configured in the system at mount
time, a client will LBUG if calling "lfs check servers".
Disabling the LBUG causes client to return -EIO instead.

Signed-off-by: Jeremy Filizetti <jeremy.filizetti@gmail.com>
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Change-Id: I1844b66e56259da28129df2c60d2542e9c95aeee
Reviewed-on: http://review.whamcloud.com/2998
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-957 scrub: trigger OI scrub if found bad OI entry

If some RPC involves OI lookup and finds inconsistent OI mapping,
it should trigger OI scrub to check and repair the inconsistency.

Known issues:
When the fid is returned to client, the OI mapping corresponding
to such fid may be not updated, or not committed to disk yet. If
server crashed before OI scrub completed, then recovery with the
fid corresponding to inconsistent OI mapping may fail or blocked.

Signed-off-by: Fan Yong <yong.fan@whamcloud.com>
Change-Id: I9709386aa6d42954b619f6b1342adae59a2ec5a9
Reviewed-on: http://review.whamcloud.com/2554
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-56 ptlrpc: partition data for ptlrpc service

We will have multiple partition data & threads for ptlrpc service,
this patch is the first step work, we moved quite a lot members
of ptlrpc_service to a new structure ptlrpc_service_part.
Now we only create one instance of ptlrpc_service_part for each
service, but we will have multiple instances for each service
very soon (instance per CPT, CPU ParTion).

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: I63d816bdf44a22528c6097fe348060f57d862df3
Reviewed-on: http://review.whamcloud.com/2895
Tested-by: Hudson
Reviewed-by: wangdi <di.wang@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
LU-1305 osd: osd_handler.c for osd-zfs

functions to setup/mount zfs backend

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I200709e0c86e4f7aae35528cbae7f7b08e094f47
Reviewed-on: http://review.whamcloud.com/2963
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>