LU-3015 osd-zfs: Fix a typo in udmu_objs_count_estimate

The typo is relatively straightforward given the diff below.
It leads to larger-than-actual average dnode size estimations,
which further causes overly conservative os_ffree (number of
available objects) values. For example, without this patch,
os_ffree values for "empty" 1 GB ZFS-based MDT/OSTs look like:

  [root@linux tests]# df -h
  Filesystem            Size  Used Avail Use% Mounted on
  [...]
  lustre-mdt1/mdt1      929M  3.0M  924M   1% /mnt/mds1
  lustre-ost1/ost1      929M  1.3M  926M   1% /mnt/ost1
  lustre-ost2/ost2      929M  1.3M  926M   1% /mnt/ost2
  linux@tcp:/lustre     1.9G  2.5M  1.9G   1% /mnt/lustre
  [root@linux tests]# df -i
  Filesystem            Inodes   IUsed   IFree IUse% Mounted on
  [...]
  lustre-mdt1/mdt1        7583     178    7405    3% /mnt/mds1
  lustre-ost1/ost1        7631     212    7419    3% /mnt/ost1
  lustre-ost2/ost2        7631     212    7419    3% /mnt/ost2
  linux@tcp:/lustre       7583     178    7405    3% /mnt/lustre

With this patch, they look like:

  [root@linux tests]# df -h
  Filesystem            Size  Used Avail Use% Mounted on
  [...]
  lustre-mdt1/mdt1      929M  2.9M  924M   1% /mnt/mds1
  lustre-ost1/ost1      929M  1.3M  926M   1% /mnt/ost1
  lustre-ost2/ost2      929M  1.3M  926M   1% /mnt/ost2
  linux@tcp:/lustre     1.9G  2.5M  1.9G   1% /mnt/lustre
  [root@linux tests]# df -i
  Filesystem            Inodes   IUsed   IFree IUse% Mounted on
  [...]
  lustre-mdt1/mdt1      161966     178  161788    1% /mnt/mds1
  lustre-ost1/ost1      223825     212  223613    1% /mnt/ost1
  lustre-ost2/ost2      223825     212  223613    1% /mnt/ost2
  linux@tcp:/lustre     161966     178  161788    1% /mnt/lustre

Only after fixing this typo could we evaluate how the intented
estimation algorithm works.

Test-Parameters: mdsfilesystemtype=zfs ostfilesystemtype=zfs mdtfilesystemtype=zfs
Signed-off-by: Li Wei <wei.g.li@intel.com>
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: Ic3cbe569261d2c0e4338001c47f3dd64c621621a
Reviewed-on: http://review.whamcloud.com/5806
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
LU-3232 build: Move fsfilt_ldiskfs.ko into lustre-osd-ldiskfs

The fsfilt_ldiskfs.ko module depends on symbols in osd_ldiskfs.ko and
ldiskfs.  However, osd_ldiskfs.ko is only part of the optional package
lustre-osd-ldiskfs, while fsfilt-ldiskfs.ko is in the non-optional
package lustre-modules.

This means that a person using only the lustre-osd-zfs osd will see a
screen full of warnings about missing ldiskfs-related symbols.

We remedy this problem by moving the fsfilt-ldiskfs.ko into the
lustre-osd-ldiskfs rpm.

Change-Id: I631a98dd56c7d4df69266e4f922f949132774d84
Signed-off-by: Christopher J. Morrone <morrone2@llnl.gov>
Reviewed-on: http://review.whamcloud.com/6260
Reviewed-by: Faccini Bruno <bruno.faccini@intel.com>
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Andreas Dilger <andreas.dilger@intel.com>
LU-3409 llite: silence lockdep warning in ll_md_blocking_ast

Got bellow lockdep warning during tests. It is false alarm though.

[ 1184.479097] =============================================
[ 1184.479187] [ INFO: possible recursive locking detected ]
[ 1184.479277] 3.10.0-rc3+ #13 Tainted: G         C
[ 1184.479355] ---------------------------------------------
[ 1184.479444] mkdir/2215 is trying to acquire lock:
[ 1184.479521]  (&(&dentry->d_lock)->rlock){+.+...}, at:
[<ffffffffa06cc27c>] ll_md_blocking_ast+0x55c/0x655 [lustre]
[ 1184.479801]
but task is already holding lock:
[ 1184.479895]  (&(&dentry->d_lock)->rlock){+.+...}, at:
[<ffffffffa06cc1b1>] ll_md_blocking_ast+0x491/0x655 [lustre]
[ 1184.480101]
other info that might help us debug this:
[ 1184.480206]  Possible unsafe locking scenario:

[ 1184.480300]        CPU0
[ 1184.480340]        ----
[ 1184.480380]   lock(&(&dentry->d_lock)->rlock);
[ 1184.480458]   lock(&(&dentry->d_lock)->rlock);
[ 1184.480536]
 *** DEADLOCK ***

[ 1184.480761]  May be due to missing lock nesting notation

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: I34c54ddc7a36dbef77564b1e4f14a16d848b2eaa
Reviewed-on: http://review.whamcloud.com/6469
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
LU-3384 llite: use READ, WRITE around ll_rw_stats_tally()

In vvp_io_write_start() the stats function ll_rw_stats_tally() was
incorrectly called with a rw argument of 0. Correct this and use the
macros READ and WRITE in and around ll_rw_stats_tally() for clarity.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Icca6cfcc102b2944761ff211f1b2c2734aae8ecf
Reviewed-on: http://review.whamcloud.com/6447
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Jinshan Xiong <jinshan.xiong@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
LU-3385 llite: missing last bit in ll_have_md_lock

Missing the last bit during INODELOCK check in ll_have_md_lock.

Signed-off-by: wang di <di.wang@intel.com>
Change-Id: I0801554904cab106513b76ace4f1467d14cfdf1a
Reviewed-on: http://review.whamcloud.com/6438
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-3054 build: fix 'program hangs' errors

Fix 'program hangs' defects found by Coverity version 6.5.1:
Missing unlock (LOCK)
Returning without unlocking.

Signed-off-by: Sebastien Buisson <sebastien.buisson@bull.net>
Change-Id: I96c2bb05a5875ed493ebe99587e9901baea80fc8
Reviewed-on: http://review.whamcloud.com/5870
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Keith Mannthey <DELETED>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-2753 llite: check alloc in ll_file_data_get, ll_dir_ioctl

In ll_file_data_get() and ll_dir_ioctl() return error on failed
allocations.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I122db2cede770261d75af209e92aa60d86ea85f2
Reviewed-on: http://review.whamcloud.com/5845
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Sebastien Buisson <sebastien.buisson@bull.net>
LU-3088 build: fix 'resource leak' errors

Fix 'resource leak' defects found by Coverity version 6.5.1:
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: I12312b081ea735118d5375c0dc9c20ead5ed9286
Reviewed-on: http://review.whamcloud.com/5918
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: John Hammond <johnlockwoodhammond@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
LU-2008 utils: quote TUNE2FS options in ldiskfs_label_lustre

This patch improves ldiskfs_label_lustre() to quote the options
for TUNE2FS in case the label contains space(s).

Test-Parameters: envdefinitions=SLOW=yes \
clientcount=4 osscount=2 mdscount=2 \
austeroptions=-R failover=true useiscsi=true \
testlist=mmp

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I3eaeb604517dba29e07f9750aeb3afed9443e94f
Reviewed-on: http://review.whamcloud.com/6077
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Li Wei <wei.g.li@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3174 build: missing noiokit option in lbuild

We can not use --noiokit since it's missing in options

Signed-off-by: Minh Diep <minh.diep@intel.com>
Change-Id: I155e5da94b67d1e4baa6613a787146174945246f
Reviewed-on: http://review.whamcloud.com/6073
Tested-by: Hudson
Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-3154: Fix plot-sgpdd to match new sgpdd-survey output format

The fields in sgpdd-survey output have changed. This updates plot-sgpdd to
work correctly. One field 'rsz' has changed from numeric to string, new
variable added to deal with that.
Fix for trailing tabs on two lines. Cleaned up tabs per Andreas.
Removed one more trailing tab.

Change-Id: I754d5fec6f6aebbc0882386d2734aa6805eb8de5
Signed-off-by: Cliff White <cliffwhi@intel.com>
Signed-off-by: Cliff White <cliffw@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/6023
Tested-by: Hudson
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Keith Mannthey <keith.mannthey@intel.com>