LU-4243 mgs: use proper uuid in mgs_write_log_failnids()

This patch revert the changes to mgs_write_log_failnids() in the
commit d9d27cad, which introduced a regression of that when multiple
'--servicenode' or '--failnode' option specified, the uuid from
first option will be wrongly used for all other connections.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: Ibd989de67fe6851cc75569be3f64dadaec5e6f8c
Reviewed-on: http://review.whamcloud.com/8372
Tested-by: Jenkins
Reviewed-by: Erich Focht <efocht@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
LU-4101 mdt: protect internal xattrs

In mdt_reint_setxattr() require CAP_SYS_ADMIN to modify a trusted
xattr and silently disallow modification those trusted xattrs used by
Lustre internally.

Signed-off-by: John L. Hammond <john.hammond@intel.com>
Change-Id: Ic616dca74a90da0aedb0ec2624618f91ac6fcaf4
Reviewed-on: http://review.whamcloud.com/7943
Reviewed-by: Andrew Perepechko <andrew_perepechko@xyratex.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Revert "LU-4249 lquota: Add diagnostic LBUG on lqe_getref/putref"

This reverts commit 0293de73aed65bd7b8666adcf4bf5556ec6cb0db.
LU-3484 llite: Anonymous dentry incorrectly identified as root

When exporting Lustre via NFS on SLES11SP2, this check incorrectly identifies
anonymous dentries as root dentries.  This is due to a change in SLES11SP2
which makes the d_name.name for anonymous dentries the same as that for root
dentries.  (Details in LU-3484.)

This changes the check to directly compare the value of the dentry pointer
to the root dentry pointer found in the superblock, rather than using the name.

Signed-off-by: Patrick Farrell <paf@cray.com>
Change-Id: I18a60a7610b02d1b0580f9a0af4aeb81b5cca9b1
Reviewed-on: http://review.whamcloud.com/6726
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Peng Tao <bergwolf@gmail.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Alexey Shvetsov <alexxy@gentoo.org>
LU-3460 quota: don't schedule adjust when qsd stopped

When the qsd is stopped, we should not schedule quota adjust or
index update anymore, because the writeback thread has been stopped,
and those scheduled requests will never be processed.

Lustre-commit: 76ddf87488010a38a3e7b0b5923e0fe8e725326a
Lustre-change: http://review.whamcloud.com/6731

Signed-off-by: Bob Glossman <bob.glossman@intel.com>
Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Change-Id: I7c10c79db4176b3af8c7741dd438a2095ddb9bb5
Reviewed-on: http://review.whamcloud.com/8169
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
LU-4249 quota: lqe reference debug patch

Debug lqe reference.

Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I3c2e9bfe20ce6f4714c855652f6e856afb49ede9
LU-4611 osd: improve credits calculation

- llog catalog do not declare records twice (for old and new objects)
  this might be an issue on ZFS with full debug enabled..
- llog to specify append by pos=-1, so OSD can take this into account
- object create/destroy should not include OI, this is calculated yet
- EA declaration to improve few specific cases
- osd_declare_write() to recognize overwrite optimistically,
  using inode size and i_blocks
- osd_declare_write() to optimize very specific cases, like legacy
  blockmaps with small offsets and allocated indirects
- index delete modify just a single block

preliminary testing on a local setup with 7 OSTs:
1360 credits before and 436 credits after.

llog declarations and index inserts (part of llog object creation)
still consume about 70% (7 OSTs):
   create: 7/28, destroy: 1/4
   attr_set: 2/2, xattr_set: 8/21
   write: 37/179, punch: 14/56, quota 2/2
   insert: 8/135, delete: 2/5
   ref_add: 1/1, ref_del: 3/3

This patch is back-ported from the following one:
Lustre-commit: 3902ff4c54925b2f1fcb732a32ed7ee5428e9f77
Lustre-change: http://review.whamcloud.com/9258

Signed-off-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I765eaeb78534a62deec7effe865eca5ef37b2db8