lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1502725652-26280-27-git-send-email-jsimmons@infradead.org>
Date:   Mon, 14 Aug 2017 11:46:54 -0400
From:   James Simmons <jsimmons@...radead.org>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        devel@...verdev.osuosl.org,
        Andreas Dilger <andreas.dilger@...el.com>,
        Oleg Drokin <oleg.drokin@...el.com>
Cc:     Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Lustre Development List <lustre-devel@...ts.lustre.org>,
        James Simmons <jsimmons@...radead.org>,
        James Simmons <uja.ornl@...oo.com>
Subject: [PATCH 26/64] staging: lustre: uapi: remove need for libcfs.h from lustre_cfg.h

Several libcfs.h macros are present in lustre_cfg.h, but libcfs.h
is not available so lets replace those macros with real code.
The header libcfs.h also provides errno.h so with libcfs.h gone
include errno.h directly.

Signed-off-by: James Simmons <uja.ornl@...oo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: https://review.whamcloud.com/26966
Reviewed-by: Quentin Bouget <quentin.bouget@....fr>
Reviewed-by: Ben Evans <bevans@...y.com>
Reviewed-by: Oleg Drokin <oleg.drokin@...el.com>
Signed-off-by: James Simmons <jsimmons@...radead.org>
---
 .../staging/lustre/include/uapi/linux/lustre/lustre_cfg.h | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h
index a762aab..a45d167 100644
--- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h
+++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_cfg.h
@@ -33,6 +33,8 @@
 #ifndef _LUSTRE_CFG_H
 #define _LUSTRE_CFG_H
 
+#include <linux/errno.h>
+#include <linux/kernel.h>
 #include "../../../../lustre/include/lustre/lustre_user.h"
 
 /** \defgroup cfg cfg
@@ -48,7 +50,7 @@
 #define LUSTRE_CFG_MAX_BUFCOUNT 8
 
 #define LCFG_HDR_SIZE(count) \
-	cfs_size_round(offsetof(struct lustre_cfg, lcfg_buflens[(count)]))
+	__ALIGN_KERNEL(offsetof(struct lustre_cfg, lcfg_buflens[(count)]), 8)
 
 /** If the LCFG_REQUIRED bit is set in a configuration command,
  * then the client is required to understand this parameter
@@ -165,7 +167,7 @@ static inline void *lustre_cfg_buf(struct lustre_cfg *lcfg, __u32 index)
 
 	offset = LCFG_HDR_SIZE(lcfg->lcfg_bufcount);
 	for (i = 0; i < index; i++)
-		offset += cfs_size_round(lcfg->lcfg_buflens[i]);
+		offset += __ALIGN_KERNEL(lcfg->lcfg_buflens[i], 8);
 	return (char *)lcfg + offset;
 }
 
@@ -188,9 +190,9 @@ static inline __u32 lustre_cfg_len(__u32 bufcount, __u32 *buflens)
 
 	len = LCFG_HDR_SIZE(bufcount);
 	for (i = 0; i < bufcount; i++)
-		len += cfs_size_round(buflens[i]);
+		len += __ALIGN_KERNEL(buflens[i], 8);
 
-	return cfs_size_round(len);
+	return __ALIGN_KERNEL(len, 8);
 }
 
 static inline void lustre_cfg_init(struct lustre_cfg *lcfg, int cmd,
@@ -206,7 +208,10 @@ static inline void lustre_cfg_init(struct lustre_cfg *lcfg, int cmd,
 	ptr = (char *)lcfg + LCFG_HDR_SIZE(lcfg->lcfg_bufcount);
 	for (i = 0; i < lcfg->lcfg_bufcount; i++) {
 		lcfg->lcfg_buflens[i] = bufs->lcfg_buflen[i];
-		LOGL((char *)bufs->lcfg_buf[i], bufs->lcfg_buflen[i], ptr);
+		if (bufs->lcfg_buf[i]) {
+			memcpy(ptr, bufs->lcfg_buf[i], bufs->lcfg_buflen[i]);
+			ptr += __ALIGN_KERNEL(bufs->lcfg_buflen[i], 8);
+		}
 	}
 }
 
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ