LU-6055 hsm: improve error handling in sanity-hsm

In path2fid() propagate errors from 'lfs path2fid'.  In
file_creation_failure() redirect the output of df to stderr so that it
is not captured by command substitution.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I7fabf46af4aa36c6affef45cf8c9b044a7aa29dd
Reviewed-on: http://review.whamcloud.com/13154
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
LU-3727 nfs: Fix ll_get_parent() LBUG caused by permission

When ll_get_parent() is trying to get the attributes of parent
directory, EACCES will be returned if NFS daemon user does not
have the execute permission of the child directory. This patch
fixes the problem by skipping permission check for ll_get_parent().

Signed-off-by: Li Xi <lixi@ddn.com>
Change-Id: Id922d170c89519b755f69a2818d6ed53f8cc7ad9
Reviewed-on: http://review.whamcloud.com/7327
Reviewed-by: Bobi Jam <bobijam@gmail.com>
Tested-by: Jenkins
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4239 mdt: Optimize fid2path

On directory paths 100 or more deep, fid2path
gives a spurious:
ioctl err -75: Value too large for defined data type

This bug occurs because all of the fids found during
a path lookup are stored in pli_fids and the
array is too small for very deep paths.

The stored fids are not used except for the last one, so
this array is not necessary.

Additionally, from Frank Zago:

It is not necessary to copy back and forth the fid, linkno,
and path.
Keep the input getinfo_fid2path, and remove

struct path_lookup_info

which was mostly a copy of getinfo_fid2path. This saves
several copies and a memory allocation.

The fid to be returned back to user space is stored in
fp->gf_fid.

Also added doxygen comments and replaced an 'EXIT' and
'return rc' with 'RETURN(rc)'.

Signed-off-by: Patrick Farrell <paf@cray.com>
Signed-off-by: Frank Zago <fzago@cray.com>
Change-Id: I357b4d91b9c65a836d289d5815c763306ac34565
Reviewed-on: http://review.whamcloud.com/10717
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-1399 config: check lustre_cfg_new() return

Check if lustre_cfg_new() fails its allocation and pass that error
on to the caller instead of dereferencing the NULL pointer.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I8a934777ea68a866f5f087a6c0948a6dbc3ebbe5
Reviewed-on: http://review.whamcloud.com/10739
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Tested-by: Jenkins
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2675 llite: remove some cl wrappers

In llite remove the wrapper functions and macros:
  cl_i2info()
  cl_i2sbi()
  cl_iattr2fd()
  cl_inode_info
  cl_inode_mode()
  cl_inode_{a,m,c}time()
  cl_isize_{lock,unlock}()
  cl_isize_{read,write,write_nolock}()

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I310c16c842781cbec741a7c43b746b582546badd
Reviewed-on: http://review.whamcloud.com/12850
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-6027 osd-zfs: Preserve lu_buf when listing EAs

Current osd_xattr_list() in osd-zfs modifies its lu_buf argument,
leaving lu_buf::lb_buf pointing to the end of the original buffer.
This behavior is unnecessary and counter-intuitive.  This patch
preserves the content of the lu_buf argument and updates OSD API to
reduce the chance of future regressions.

Change-Id: I0d3e334848734ca6f44778e87b5ff3b044826784
Signed-off-by: Li Wei <wei.g.li@intel.com>
Reviewed-on: http://review.whamcloud.com/12880
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-6027 mdd: Don't list "trusted.link" for orphans

Commit 09fe679 prevents mdd_xattr_get() from accessing XATTR_NAME_LINK
EAs of orphan objects but leaves mdd_xattr_list() unchanged.  This is
problematic for fgetxattr() calls on orphan objects when EA cache
refills are involved.  To respond to such a refill, mdt lists all of
the object's EA names and gets the value for each name.  In the case
of an orphan, XATTR_NAME_LINK EA will be listed, but corresponding
mdd_xattr_get() call will return -ENOENT, causing the fgetxattr() call
to fail eventually.  This patch updates mdd_xattr_list() to filter out
XATTR_NAME_LINK EAs for orphan objects as well, following commit
09fe679.

Change-Id: Ie59e4c9342056bacf57a82cf9bf77cfdedc99f6d
Signed-off-by: Li Wei <wei.g.li@intel.com>
Reviewed-on: http://review.whamcloud.com/12884
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
LU-2675 lnet: remove lnet/include/lnet/linux/

Remove the linux specific headers from lnet/include/lnet/linux/,
moving whatever was worthwhile from them to their parent headers or
elsewhere. Also remove lnet/klnds/socklnd/socklnd_lib-linux.h and
rename lnet/klnds/socklnd/socklnd_lib-linux.c to socklnd_lib.c.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Id10683e95277791f9c99492907369a608b28a1fb
Reviewed-on: http://review.whamcloud.com/12932
Tested-by: Jenkins
Reviewed-by: Isaac Huang <he.huang@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5905 tests: add version check codes to conf-sanity test 56

This patch adds Lustre version check codes into conf-sanity test
56 to make the test interoperate with servers that do not have
the following changes:

Lustre-commit: 3dc232918c7c9b95398ac6a0dc4c2130adc2851d
Lustre-change: http://review.whamcloud.com/12145
or
Lustre-commit: e6745116cc372647f785c4063389734620c92e91
Lustre-change: http://review.whamcloud.com/12319

Test-Parameters: alwaysuploadlogs envdefinitions=ONLY=56 \
ossjob=lustre-b2_6 mdsjob=lustre-b2_6 ossbuildno=2 mdsbuildno=2 \
testlist=conf-sanity

Signed-off-by: Jian Yu <jian.yu@intel.com>
Change-Id: I8c1b41f6912c006d4bb9edd756af3fa345dd55f3
Reviewed-on: http://review.whamcloud.com/13045
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Li Wei <wei.g.li@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-2675 obd: remove linux/obd.h

Remove the now unneeded header lustre/include/linux/obd.h.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: I70c0b40fded991b1e871bf8624cb91f39e065ea7
Reviewed-on: http://review.whamcloud.com/13123
Tested-by: Jenkins
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-5478 style: get rid of obd_* typedefs

We have a bunch of typedefs for common things that made no sense
and hid the actual type from plain view.
Replace them with proper uXX or sXX types.
Exception is in lustre_idl.h and lustre_ioctl.h where
they are replaced with __uXX and __sXX to be able to be included
in userspace

First patch in series: modify main includes

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I49f53ea25e28b1af31dd7d4cd36b27cf644464fc
Reviewed-on: http://review.whamcloud.com/13140
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
LU-5478 mdc: get rid of obd_* typedefs

We have a bunch of typedefs for common things that made no sense
and hid the actual type from plain view.
Replace them with proper uXX or sXX types.
Exception is in lustre_idl.h and lustre_ioctl.h where
they are replaced with __uXX and __sXX to be able to be included
in userspace

patch 4 in series: modify mdc/mdt/mgc

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I35b51c3e722f7463b7bab04a5fb2e19544b47178
Reviewed-on: http://review.whamcloud.com/13145
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
LU-5478 obdclass: get rid of obd_* typedefs

We have a bunch of typedefs for common things that made no sense
and hid the actual type from plain view.
Replace them with proper uXX or sXX types.
Exception is in lustre_idl.h and lustre_ioctl.h where
they are replaced with __uXX and __sXX to be able to be included
in userspace

patch 5 in series: modify obdclass/obdecho/ofd

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I674972390c808001249ce3c23a9f58888c13d1be
Reviewed-on: http://review.whamcloud.com/13146
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
LU-5478 osd: get rid of obd_* typedefs

We have a bunch of typedefs for common things that made no sense
and hid the actual type from plain view.
Replace them with proper uXX or sXX types.
Exception is in lustre_idl.h and lustre_ioctl.h where
they are replaced with __uXX and __sXX to be able to be included
in userspace

patch 7 in series: modify osd-ldiskfs/osd-zfs

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I9809d57ae8665fb7a932645cc2258d3adc1a0ff1
Reviewed-on: http://review.whamcloud.com/13149
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
LU-5478 utils: get rid of obd_* typedefs

We have a bunch of typedefs for common things that made no sense
and hid the actual type from plain view.
Replace them with proper uXX or sXX types.
Exception is in lustre_idl.h and lustre_ioctl.h where
they are replaced with __uXX and __sXX to be able to be included
in userspace

patch 8 in series: modify utils and ptlrpc

Signed-off-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I618e6e8465c845951f4735ac7ff2743544534809
Reviewed-on: http://review.whamcloud.com/13150
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>