LU-700 osc: Tally BRW_{READ,WRITE}_BYTES by bytes transferred.

Call ptlrpc_lprocfs_brw() in brw_interpret() rather than
osc_send_oap_rpc() and tally by the number of bytes transferred rather
than the number requested.

Change-Id: Ia7191972d9671f01d942a46eba069191f130f516
Signed-off-by: John L. Hammond <jhammond@tacc.utexas.edu>
Reviewed-on: http://review.whamcloud.com/1402
Tested-by: Hudson
Reviewed-by: Jinshan Xiong <jay@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-686 conf-sanity test 52 fails due to missing mount point

Create the mount point before mount

Change-Id: I6c813f5040e4636386eabb640526f3d1072f484b
Signed-off-by: HongChao Zhang <hongchao.zhang@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1379
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-4113 gss: uncatched error in gss_svc_upcall causes drops

Since kernel version 2.6.20 the function cache_check() in
net/sunrpc/cache.c can return the error -ETIMEDOUT. This
error should cause to recheck the cache. In current
implementation gss_svc_upcall_handle_init() is not
handling the error which causes to fall through the
switch statement returning GOTO(out, rc = SECSVC_DROP).
As a consequence this error is propagating to
ERROR:do_nego_rpc(): status: -110 (Unknown error 18446744073709551506)
ERROR:lgssc_negotiation(): negotiation rpc error: -85
ERROR:lgssc_kr_negotiate(): key 08786b66: failed to negotiation
and causes client hanging after switching to flavor krb5i/krb5p.

Signed-off-by: Thomas Stibor <thomas@stibor.net>
Change-Id: I7301bea70d96193e0f4a332c6e4b34ba326134ff
Reviewed-on: http://review.whamcloud.com/7960
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andrew Korty <ajk@iu.edu>
Reviewed-by: Ken Hornstein <kenh@cmf.nrl.navy.mil>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4100 utils: Remove extra space of lfs getstripe

'lfs getstripe $dir' command prints an extra space at the end of
the output line, which is particularly annoying for parsing in
scripts.

This patch fixes this problem.

Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: Iee50939f2b93bbd8d1c506bb90bc761a9f4dbeaf
Reviewed-on: http://review.whamcloud.com/7992
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4078 mdc: fix bad ERR_PTR usage in mdc_locks.c

In mdc_intent_open_pack() return an ERR_PTR() rather than NULL when
ldlm_prep_enqueue_req() fails. In mdc_intent_getattr_async() check the
return value of mdc_intent_getattr_pack() using IS_ERR(). Clean up the
includes in mdc_locks.c.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I89348389ccd102d1226caf16b315ac9b2a96b307
Reviewed-on: http://review.whamcloud.com/7886
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
LU-4050 llite: NFS reexport issue

Suppress erroneous/confusing messages when NFS
is out of sync and requests old data.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: Idf382769fe3b5b502ca6f545fab6b72fcc62527c
Reviewed-on: http://review.whamcloud.com/7850
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-3996 mgs: Don't close llog that we failed to open

Attempting to do so leads to a crash:
LustreError: 8136:0:(llog_osd.c:241:llog_osd_read_header()) MGS-osd: error reading log header from [0xa:0xa:0x0]: rc = -14
LustreError: 8136:0:(mgs_llog.c:1386:record_start_log()) MGS: can't start log lustre-params: rc = -14
BUG: unable to handle kernel NULL pointer dereference at 00000000000000b8
IP: [<ffffffffa07f9e99>] llog_handle_put+0x9/0x70 [obdclass]
PGD 8120c8067 PUD 7b8c65067 PMD 0
Oops: 0000 [#1] SMP
...
Call Trace:
 [<ffffffffa07f9f5d>] llog_close+0x5d/0x190 [obdclass]
 [<ffffffffa0e98e8d>] mgs_write_log_direct_all+0x28d/0x7a0 [mgs]
 [<ffffffffa06c8951>] ? libcfs_debug_msg+0x41/0x50 [libcfs]
 [<ffffffffa0e99d3d>] mgs_write_log_param+0x99d/0x2980 [mgs]
 [<ffffffff81167610>] ? cache_alloc_refill+0x1c0/0x240
 [<ffffffffa0ea00b0>] mgs_setparam+0xde0/0x11a0 [mgs]
 [<ffffffffa0e8c7e2>] mgs_iocontrol+0x10c2/0x16e0 [mgs]
 [<ffffffffa07f70a7>] ? obd_ioctl_getdata+0x477/0x1120 [obdclass]
 [<ffffffffa080e344>] class_handle_ioctl+0x12e4/0x1e70 [obdclass]
 [<ffffffffa06c8951>] ? libcfs_debug_msg+0x41/0x50 [libcfs]
 [<ffffffffa07f62ab>] obd_class_ioctl+0x4b/0x190 [obdclass]
 [<ffffffff81195352>] vfs_ioctl+0x22/0xa0
 [<ffffffff811954f4>] do_vfs_ioctl+0x84/0x580
 [<ffffffff81195a71>] sys_ioctl+0x81/0xa0
 [<ffffffff8100b072>] system_call_fastpath+0x16/0x1b

Change-Id: I2bd72c130a0530cc9d218556b5b6cc9c14efc2ea
Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-on: http://review.whamcloud.com/7742
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-3806 obdclass: add LCT_SERVER_SESSION for server session

Add LCT_SERVER_SESSION for server session, and separate the
server session flag from LCT_SESSION, so to avoid allocating
session info for client stack for each server request, if
client and server are on the same node.

Signed-off-by: Wang Di <di.wang@intel.com>
Change-Id: I808c3f58cd7a03ebc166e51fe1e32ea34ae0e3e8
Reviewed-on: http://review.whamcloud.com/7412
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Mike Pershin <mike.pershin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3021 ldiskfs: to not verify preallocation in umount path

When recovery test is running, device rdonly flag is set and all
updates will be erred out so on-disk data can be inconsistent with
memory data.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I69d3fa462c69f5f85978265075165b488661e863
Reviewed-on: http://review.whamcloud.com/5883
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2793 fld: send special seq lookup request to MDT0

Since almost all special sequence locates on MDT0, we should
send all seq lookup req to MDT0, especially in an evironment
where other MDTs might not be started at all.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: Ifda9cb434a217d1e54dc2ef4fcb7628fca049d9d
Reviewed-on: http://review.whamcloud.com/5319
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
LU-2726 procfs: Invalid assertion for counter_{add,sub}

lprocfs_stats::lc_sum_irq is only used for obd_memory for accurate
memory usage counting, other procfs stats counters do not need it,
even though they can be used in RCU callbacks.

Signed-off-by: Bobi Jam <bobijam.xu@intel.com>
Change-Id: I4c2dec50eecc0c63631f1915ba30a54a5da2fec1
Reviewed-on: http://review.whamcloud.com/5237
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John Hammond <johnlockwoodhammond@gmail.com>
Tested-by: Oleg Drokin <oleg.drokin@intel.com>
LU-250 lnet: Router random shuffling support

This is the last of the router improvements that where
developed at ORNL. This feature allows routes to be
randomly placed. Our results show a 20 percent
improvement with random shuffling.

Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I6862febebd6797fb35c003646f6d90f5d5d2b014
Reviewed-on: http://review.whamcloud.com/249
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Isaac Huang <Isaac_Huang@xyratex.com>
Reviewed-by: Liang Zhen <liang@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1944 ldlm: Add another net_latency to recoverry timer.

Add another net_latency to this request deadline, i.e.
we need add 2 net_latency to extend the recovery timer,
one for balance rq_deadline (see ptl_send_rpc), one for
resend the req to server.

Signed-off-by: Wang Di <di.wang@whamcloud.com>
Change-Id: I6cb6e57358f4fe32ae2ac8d982af6ce03b68014b
Reviewed-on: http://review.whamcloud.com/4351
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>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1940 ost: wait a while for OBD_FAIL_OST_EROFS

for OSC, -EROFS is a recoverable error, it will resend the failed
request at most cl_resends times (obd->u.cli.cl_resends), and
its default value is 10, then for test case, the failed request
will be resent repeatly without delay, and the cl_resends could be
not enough to handle, replaces OBD_FAIL_CHECK with OBD_FAIL_TIMEOUT
will introduce some delay for -EROFS.

Signed-off-by: Hongchao Zhang <hongchao.zhang@whamcloud.com>
Change-Id: Ic2a8fe6f2d75e74f30d007940a8fd631997135e4
Reviewed-on: http://review.whamcloud.com/4622
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yu Jian <yujian@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-1364 utils: add lfs 'poollist' subcommand

Instead of adding a new subcommand this updates
the lfs man page.  pool_list is the preferred usage,
we just make all the docs match.

Signed-off-by: Bob Glossman <bogl@whamcloud.com>
Change-Id: I3f0a6692923e4ff8359afc8a3558ee404ffc4365
Reviewed-on: http://review.whamcloud.com/2734
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Richard Henwood <rhenwood@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1351 llapi: Handle special file types in llapi_path2fid()

In llapi_path2fid() check for errors from open() and ioctl() that
occur on special file types (device, socket, fifo).  Add a test in
sanity.sh that lfs path2fid will handle each type.

Change-Id: Ib411038179b3eff4191e25ac7320558a0ee1c76b
Signed-off-by: John L. Hammond <jhammond@tacc.utexas.edu>
Reviewed-on: http://review.whamcloud.com/2606
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Revert "MRP-487 VM_FAULT_ERROR causes false OOM"

This reverts commit 4651bb525aa21bc395bc37224306ddddec1a9084.

Change-Id: I078f762e3872cbe668857c12fbde2938b3765a29
LU-1299 clio: a combo patch to fix cl_lock

In this patch, the following issues are fixed:
* redefine cl_lock_error(). There are two kinds of error when
  enqueuing a cl_lock: internal errors return from server side and
  local error for example interrupted by signal when waiting for a
  lock. Obviously the latter one is not fatal so we shouldn't err the
  lock out;
* for fault handling, only signal SIGKILL and SIGTERM is not allowed;
* handle return code of ll_fault correctly;
* redefine ->unuse() to release resource it held if enqueuing lock
  failed;
* in cl_lock_hold_release(), only CLS_CACHED mode lock will be cached,
  for locks in other states, they will be cancelled voluntarily;
* fix the problem that cfs_block_sigs() is wrongly used as
  cfs_restore_sigs() and implementation of cfs_block_sigs() was wrong
* other minor fixes.

Signed-off-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Change-Id: Ice6d237d367c54bfd84a4a33cea8a4c1081e7696
Reviewed-on: http://review.whamcloud.com/2654
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Niu Yawei <niu@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
LU-1163 llite: never try to invalidate a dirty page

When ll_page_mkwrite() detects page's covering lock is being canceled,
it should write the page back before invalidating it. Otherwise, it
will cause data corruption.

Signed-off-by: Jinshan Xiong <jinshan.xiong@whamcloud.com>
Change-Id: I345728daacf50edc154cd434dea392410f8cc782
Reviewed-on: http://review.whamcloud.com/2243
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
LU-181 ptlrpc: align fields of ptlrpc_request

Size of ptlrpc_request_buffer_desc is 1048 which means we need 2K
slab for allocating rqbd. This can be changed after we align
fields in ptlrpc_reques to decrease size of ptlrpc_requestt,
because each rqbd has an embedded ptlrpc_request.
We also aligned fields of lu_context because it's embedded in
ptlrpc_request.

With this simple change, size of rqbd is 1008 bytes, and we
can save at least tens of MBs on server.

Signed-off-by: Liang Zhen <liang@whamcloud.com>
Change-Id: Iac292e4375421843785fdae083b1aa667d43b3a7
Reviewed-on: http://review.whamcloud.com/3352
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Bobi Jam <bobijam@whamcloud.com>