2015-11-08 16:35:16

by James Simmons

[permalink] [raw]
Subject: [PATCH v2] staging: lustre: remove IOC_LIBCFS_PING_TEST ioctl

The ioctl IOC_LIBCFS_PING_TEST has not been used in
ages. The recent nidstring changes which moved all
the nidstring operations from libcfs to the LNet
layer but this ioctl code was still using an
nidstring operation that was causing an circular
dependency loop between libcfs and LNet.

Signed-off-by: James Simmons <[email protected]>
---
.../lustre/include/linux/libcfs/libcfs_ioctl.h | 1 -
drivers/staging/lustre/lustre/libcfs/module.c | 17 -----------------
2 files changed, 0 insertions(+), 18 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
index f5d741f..485ab26 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
@@ -110,7 +110,6 @@ struct libcfs_ioctl_handler {
#define IOC_LIBCFS_CLEAR_DEBUG _IOWR('e', 31, long)
#define IOC_LIBCFS_MARK_DEBUG _IOWR('e', 32, long)
#define IOC_LIBCFS_MEMHOG _IOWR('e', 36, long)
-#define IOC_LIBCFS_PING_TEST _IOWR('e', 37, long)
/* lnet ioctls */
#define IOC_LIBCFS_GET_NI _IOWR('e', 50, long)
#define IOC_LIBCFS_FAIL_NID _IOWR('e', 51, long)
diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c
index 570f05c..89038ed 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -274,23 +274,6 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile, unsigned long cmd,
}
break;

- case IOC_LIBCFS_PING_TEST: {
- extern void (kping_client)(struct libcfs_ioctl_data *);
- void (*ping)(struct libcfs_ioctl_data *);
-
- CDEBUG(D_IOCTL, "doing %d pings to nid %s (%s)\n",
- data->ioc_count, libcfs_nid2str(data->ioc_nid),
- libcfs_nid2str(data->ioc_nid));
- ping = symbol_get(kping_client);
- if (!ping)
- CERROR("symbol_get failed\n");
- else {
- ping(data);
- symbol_put(kping_client);
- }
- return 0;
- }
-
default: {
struct libcfs_ioctl_handler *hand;

--
1.7.1


2015-11-08 16:36:45

by James Simmons

[permalink] [raw]
Subject: [PATCH] staging: lustre: Handle nodemask on UMP machines

For UMP and SMP machines the struct cfs_cpt_table are
defined differently. In the case handled by this patch
nodemask is defined as a integer for the UMP case and
as a pointer for the SMP case. This will cause a problem
for ost_setup which reads the nodemask directly. Instead
we create a UMP version of cfs_cpt_nodemask and use that
in ost_setup.

Signed-off-by: James Simmons <[email protected]>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4199
Reviewed-on: http://review.whamcloud.com/9219
Reviewed-by: Liang Zhen <[email protected]>
Reviewed-by: Li Xi <[email protected]>
Reviewed-by: Andreas Dilger <[email protected]>

Starting in 3.14 kernels nodemask_t was changed from a
a unsigned long to a linux bitmap so more than 32 cores
could be supported. Using set_bit in cfs_cpt_table_alloc
no longer compiles so this patch backports bits of the
node management function that use a linux bitmap back
end. Cleaned up libcfs bitmap.h to use the libcfs layers
memory allocation function. This was pulling in lustre
related code that was not defined.

Signed-off-by: James Simmons <[email protected]>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4993
Reviewed-on: http://review.whamcloud.com/10332
Reviewed-by: Liang Zhen <[email protected]>
Reviewed-by: Bob Glossman <[email protected]>
Reviewed-by: Oleg Drokin <[email protected]>
---
drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c b/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c
index 933525c..ba97c79 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c
@@ -58,6 +58,7 @@ cfs_cpt_table_alloc(unsigned int ncpt)
LIBCFS_ALLOC(cptab, sizeof(*cptab));
if (cptab != NULL) {
cptab->ctb_version = CFS_CPU_VERSION_MAGIC;
+ node_set(0, cptab->ctb_nodemask);
cptab->ctb_nparts = ncpt;
}

@@ -111,6 +112,13 @@ cfs_cpt_online(struct cfs_cpt_table *cptab, int cpt)
}
EXPORT_SYMBOL(cfs_cpt_online);

+nodemask_t *
+cfs_cpt_nodemask(struct cfs_cpt_table *cptab, int cpt)
+{
+ return &cptab->ctb_nodemask;
+}
+EXPORT_SYMBOL(cfs_cpt_cpumask);
+
int
cfs_cpt_set_cpu(struct cfs_cpt_table *cptab, int cpt, int cpu)
{
--
1.7.1

2015-11-08 16:35:21

by James Simmons

[permalink] [raw]
Subject: [PATCH] staging: lustre: add sparse locking annotations

From: frank zago <[email protected]>

Adds __acquires / __releases / __must_hold sparse locking annotations to
several functions.

Fixes sparse warnings such as:

libcfs/libcfs/hash.c:127:1: warning: context imbalance in 'cfs_hash_spin_lock'
- wrong count at exit
libcfs/libcfs/hash.c:133:1: warning: context imbalance in 'cfs_hash_spin_unlock'
- unexpected unlock
libcfs/libcfs/hash.c:141:9: warning: context imbalance in 'cfs_hash_rw_lock'
- wrong count at exit
include/linux/rwlock_api_smp.h:221:9: warning: context imbalance in
'cfs_hash_rw_unlock' - unexpected unlock

Signed-off-by: frank zago <[email protected]>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396
Reviewed-on: http://review.whamcloud.com/11295
Reviewed-by: John L. Hammond <[email protected]>
Reviewed-by: Patrick Farrell <[email protected]>
Reviewed-by: Oleg Drokin <[email protected]>
---
.../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 3 +--
.../staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 1 +
drivers/staging/lustre/lustre/libcfs/libcfs_lock.c | 2 ++
drivers/staging/lustre/lustre/osc/osc_cache.c | 3 +++
drivers/staging/lustre/lustre/ptlrpc/client.c | 1 +
5 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
index 8989e36..f43e825 100644
--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -750,8 +750,7 @@ kiblnd_setup_rd_kiov(lnet_ni_t *ni, kib_tx_t *tx, kib_rdma_desc_t *rd,

static int
kiblnd_post_tx_locked(kib_conn_t *conn, kib_tx_t *tx, int credit)
- __releases(conn->ibc_lock)
- __acquires(conn->ibc_lock)
+ __must_hold(&conn->ibc_lock)
{
kib_msg_t *msg = tx->tx_msg;
kib_peer_t *peer = conn->ibc_peer;
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
index 477b385..a0955d2 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
@@ -2336,6 +2336,7 @@ ksocknal_flush_stale_txs(ksock_peer_t *peer)

static int
ksocknal_send_keepalive_locked(ksock_peer_t *peer)
+ __must_hold(&ksocknal_data.ksnd_global_lock)
{
ksock_sched_t *sched;
ksock_conn_t *conn;
diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
index 94bc007..d37e457 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
@@ -90,6 +90,7 @@ EXPORT_SYMBOL(cfs_percpt_lock_alloc);
*/
void
cfs_percpt_lock(struct cfs_percpt_lock *pcl, int index)
+ __acquires(pcl->pcl_locks)
{
int ncpt = cfs_cpt_number(pcl->pcl_cptab);
int i;
@@ -124,6 +125,7 @@ EXPORT_SYMBOL(cfs_percpt_lock);
/** unlock a CPU partition */
void
cfs_percpt_unlock(struct cfs_percpt_lock *pcl, int index)
+ __releases(pcl->pcl_locks)
{
int ncpt = cfs_cpt_number(pcl->pcl_cptab);
int i;
diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c
index cfb83bc..fb1a60f 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -1938,6 +1938,7 @@ static int get_write_extents(struct osc_object *obj, struct list_head *rpclist)
static int
osc_send_write_rpc(const struct lu_env *env, struct client_obd *cli,
struct osc_object *osc)
+ __must_hold(osc)
{
LIST_HEAD(rpclist);
struct osc_extent *ext;
@@ -2010,6 +2011,7 @@ osc_send_write_rpc(const struct lu_env *env, struct client_obd *cli,
static int
osc_send_read_rpc(const struct lu_env *env, struct client_obd *cli,
struct osc_object *osc)
+ __must_hold(osc)
{
struct osc_extent *ext;
struct osc_extent *next;
@@ -2083,6 +2085,7 @@ static struct osc_object *osc_next_obj(struct client_obd *cli)

/* called with the loi list lock held */
static void osc_check_rpcs(const struct lu_env *env, struct client_obd *cli)
+ __must_hold(&cli->cl_loi_list_lock)
{
struct osc_object *osc;
int rc = 0;
diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c
index a9f1bf5..b6691cc 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -353,6 +353,7 @@ static int unpack_reply(struct ptlrpc_request *req)
* If anything goes wrong just ignore it - same as if it never happened
*/
static int ptlrpc_at_recv_early_reply(struct ptlrpc_request *req)
+ __must_hold(&req->rq_lock)
{
struct ptlrpc_request *early_req;
time64_t olddl;
--
1.7.1

2015-11-08 16:36:25

by James Simmons

[permalink] [raw]
Subject: [PATCH] staging: lustre: added debugging ability for LFSCK

From: Fan Yong <[email protected]>

Add the ability to debug LFSCK to libcfs. This is
broken out of patch http://review.whamcloud.com/6321.

Signed-off-by: Fan Yong <[email protected]>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2914
Reviewed-on: http://review.whamcloud.com/6321
Reviewed-by: Alex Zhuravlev <[email protected]>
Reviewed-by: Andreas Dilger <[email protected]>
---
.../lustre/include/linux/libcfs/libcfs_debug.h | 2 +-
drivers/staging/lustre/lustre/libcfs/debug.c | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
index a1787bb..98430e7 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
@@ -106,7 +106,7 @@ struct ptldebug_header {
#define S_LOV 0x00020000
#define S_LQUOTA 0x00040000
#define S_OSD 0x00080000
-/* unused */
+#define S_LFSCK 0x00100000
/* unused */
/* unused */
#define S_LMV 0x00800000 /* b_new_cmd */
diff --git a/drivers/staging/lustre/lustre/libcfs/debug.c b/drivers/staging/lustre/lustre/libcfs/debug.c
index e56785a..3c914bf 100644
--- a/drivers/staging/lustre/lustre/libcfs/debug.c
+++ b/drivers/staging/lustre/lustre/libcfs/debug.c
@@ -271,6 +271,8 @@ libcfs_debug_subsys2str(int subsys)
return "lquota";
case S_OSD:
return "osd";
+ case S_LFSCK:
+ return "lfsck";
case S_LMV:
return "lmv";
case S_SEC:
--
1.7.1

2015-11-08 16:36:04

by James Simmons

[permalink] [raw]
Subject: [PATCH] staging: lustre: enum lu_object_header_flags comma style fix

From: Fan Yong <[email protected]>

Cleanup the a style issues for the lu_object_header_flags
enum by adding a comma for the last field. This is
broken out of patch http://review.whamcloud.com/6321.

Signed-off-by: Fan Yong <[email protected]>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2914
Reviewed-on: http://review.whamcloud.com/6321
Reviewed-by: Alex Zhuravlev <[email protected]>
Reviewed-by: Andreas Dilger <[email protected]>
---
drivers/staging/lustre/lustre/include/lu_object.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lu_object.h b/drivers/staging/lustre/lustre/include/lu_object.h
index fa78689..c5a56a8 100644
--- a/drivers/staging/lustre/lustre/include/lu_object.h
+++ b/drivers/staging/lustre/lustre/include/lu_object.h
@@ -488,7 +488,7 @@ enum lu_object_header_flags {
/**
* Mark this object has already been taken out of cache.
*/
- LU_OBJECT_UNHASHED = 1
+ LU_OBJECT_UNHASHED = 1,
};

enum lu_object_header_attr {
--
1.7.1

2015-11-08 16:35:29

by James Simmons

[permalink] [raw]
Subject: [PATCH] staging: lustre: export cfs_str2mask

We need cfs_str2mask exported for our server code.
Even with the server code not available upstream
it would be nice to use the upstream code on Lustre
servers.

Signed-off-by: James Simmons <[email protected]>
---
.../staging/lustre/lustre/libcfs/libcfs_string.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
index d40be53..05630f8 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
@@ -111,6 +111,7 @@ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
*oldmask = newmask;
return 0;
}
+EXPORT_SYMBOL(cfs_str2mask);

/* get the first string out of @str */
char *cfs_firststr(char *str, size_t size)
--
1.7.1

2015-11-08 16:35:32

by James Simmons

[permalink] [raw]
Subject: [PATCH] staging: lustre: add libcfs version of cfs_strrstr

From: Fan Yong <[email protected]>

Create a kernel side function that does the same
thing as userland strrstr. This is from patch
http://review.whamcloud.com/7666.

Signed-off-by: Fan Yong <[email protected]>
ntel-bug-id: https://jira.hpdd.intel.com/browse/LU-3951
Reviewed-on: http://review.whamcloud.com/7666
Reviewed-by: Andreas Dilger <[email protected]>
Reviewed-by: Alex Zhuravlev <[email protected]>
Reviewed-by: Oleg Drokin <[email protected]>
---
.../lustre/include/linux/libcfs/libcfs_string.h | 1 +
.../staging/lustre/lustre/libcfs/libcfs_string.c | 27 ++++++++++++++++++++
2 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
index d8d2e7d..052f684 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_string.h
@@ -44,6 +44,7 @@
#define __LIBCFS_STRING_H__

/* libcfs_string.c */
+char *cfs_strrstr(const char *haystack, const char *needle);
/* string comparison ignoring case */
int cfs_strncasecmp(const char *s1, const char *s2, size_t n);
/* Convert a text string to a bitmask */
diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
index 05630f8..4e399ef 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
@@ -42,6 +42,33 @@

#include "../../include/linux/libcfs/libcfs.h"

+char *cfs_strrstr(const char *haystack, const char *needle)
+{
+ char *ptr;
+
+ if (unlikely(!haystack || !needle))
+ return NULL;
+
+ if (strlen(needle) == 1)
+ return strrchr(haystack, needle[0]);
+
+ ptr = strstr(haystack, needle);
+ if (ptr) {
+ while (1) {
+ char *tmp;
+
+ tmp = strstr(&ptr[1], needle);
+ if (!tmp)
+ return ptr;
+
+ ptr = tmp;
+ }
+ }
+
+ return NULL;
+}
+EXPORT_SYMBOL(cfs_strrstr);
+
/* Convert a text string to a bitmask */
int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
int *oldmask, int minmask, int allmask)
--
1.7.1

2015-11-09 11:09:01

by Oleg Drokin

[permalink] [raw]
Subject: Re: [lustre-devel] [PATCH] staging: lustre: export cfs_str2mask


On Nov 8, 2015, at 11:34 AM, James Simmons wrote:

> We need cfs_str2mask exported for our server code.
> Even with the server code not available upstream
> it would be nice to use the upstream code on Lustre
> servers.
>
> Signed-off-by: James Simmons <[email protected]>
> ---
> .../staging/lustre/lustre/libcfs/libcfs_string.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
> index d40be53..05630f8 100644
> --- a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
> +++ b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
> @@ -111,6 +111,7 @@ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
> *oldmask = newmask;
> return 0;
> }
> +EXPORT_SYMBOL(cfs_str2mask);

If this is the case of it being used out of tree, I suspect a comment here to that effect would be
useful, otherwise next person running a script to eliminate unused EXPORT_SYMBOLs would kill it again.

>
> /* get the first string out of @str */
> char *cfs_firststr(char *str, size_t size)
> --
> 1.7.1
>
> _______________________________________________
> lustre-devel mailing list
> [email protected]
> http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

2015-11-09 11:19:48

by Sudip Mukherjee

[permalink] [raw]
Subject: Re: [PATCH] staging: lustre: Handle nodemask on UMP machines

On Sun, Nov 08, 2015 at 11:34:55AM -0500, James Simmons wrote:
> For UMP and SMP machines the struct cfs_cpt_table are
> defined differently. In the case handled by this patch
> nodemask is defined as a integer for the UMP case and
> as a pointer for the SMP case. This will cause a problem
> for ost_setup which reads the nodemask directly. Instead
> we create a UMP version of cfs_cpt_nodemask and use that
> in ost_setup.
>
> Signed-off-by: James Simmons <[email protected]>
> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4199
> Reviewed-on: http://review.whamcloud.com/9219
> Reviewed-by: Liang Zhen <[email protected]>
> Reviewed-by: Li Xi <[email protected]>
> Reviewed-by: Andreas Dilger <[email protected]>

Signed-off-by: and Reviewed-by: tags entered two times. Once here.
>
> Starting in 3.14 kernels nodemask_t was changed from a
> a unsigned long to a linux bitmap so more than 32 cores
> could be supported. Using set_bit in cfs_cpt_table_alloc
> no longer compiles so this patch backports bits of the
> node management function that use a linux bitmap back
> end. Cleaned up libcfs bitmap.h to use the libcfs layers
> memory allocation function. This was pulling in lustre
> related code that was not defined.
>
> Signed-off-by: James Simmons <[email protected]>
> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4993
> Reviewed-on: http://review.whamcloud.com/10332
> Reviewed-by: Liang Zhen <[email protected]>
> Reviewed-by: Bob Glossman <[email protected]>
> Reviewed-by: Oleg Drokin <[email protected]>

And then again here.

regards
sudip

2015-11-10 00:44:55

by Simmons, James A.

[permalink] [raw]
Subject: RE: [lustre-devel] [PATCH] staging: lustre: export cfs_str2mask

>> We need cfs_str2mask exported for our server code.
>> Even with the server code not available upstream
>> it would be nice to use the upstream code on Lustre
>> servers.
>>
>> Signed-off-by: James Simmons <[email protected]>
>> ---
>> .../staging/lustre/lustre/libcfs/libcfs_string.c | 1 +
>> 1 files changed, 1 insertions(+), 0 deletions(-)
>>
>> diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
>> index d40be53..05630f8 100644
>> --- a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
>> +++ b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
>> @@ -111,6 +111,7 @@ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
>> *oldmask = newmask;
>> return 0;
>> }
>> +EXPORT_SYMBOL(cfs_str2mask);
>
>If this is the case of it being used out of tree, I suspect a comment here to that effect would be
>useful, otherwise next person running a script to eliminate unused EXPORT_SYMBOLs would kill it again.

I will send another patch with comments not to remove the new code.

2015-11-10 00:47:00

by Simmons, James A.

[permalink] [raw]
Subject: RE: [lustre-devel] [PATCH] staging: lustre: Handle nodemask on UMP machines

>On Sun, Nov 08, 2015 at 11:34:55AM -0500, James Simmons wrote:
>> For UMP and SMP machines the struct cfs_cpt_table are
>> defined differently. In the case handled by this patch
>> nodemask is defined as a integer for the UMP case and
>> as a pointer for the SMP case. This will cause a problem
>> for ost_setup which reads the nodemask directly. Instead
>> we create a UMP version of cfs_cpt_nodemask and use that
>> in ost_setup.
>>
>> Signed-off-by: James Simmons <[email protected]>
>> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4199
>> Reviewed-on: http://review.whamcloud.com/9219
>> Reviewed-by: Liang Zhen <[email protected]>
>> Reviewed-by: Li Xi <[email protected]>
>> Reviewed-by: Andreas Dilger <[email protected]>
>
>Signed-off-by: and Reviewed-by: tags entered two times. Once here.

It is one of those rare situations where two patches are need together.
It would be nice to be able to preserve the reviewers for each one.

2015-11-27 04:31:43

by Dilger, Andreas

[permalink] [raw]
Subject: Re: [PATCH v2] staging: lustre: remove IOC_LIBCFS_PING_TEST ioctl

On 2015/11/08, 09:34, "James Simmons" <[email protected]> wrote:

>The ioctl IOC_LIBCFS_PING_TEST has not been used in
>ages. The recent nidstring changes which moved all
>the nidstring operations from libcfs to the LNet
>layer but this ioctl code was still using an
>nidstring operation that was causing an circular
>dependency loop between libcfs and LNet:

Hi Greg,
are you planning on pushing this patch to Linus for 4.4? It was resent
on 11/08 per your request on 11/07 but I don't see it in staging or
staging-next yet. Since it fixes the depmod dependency cycle for
allmodconfig builds on mainline it seems worthwhile to include into
4.4-rc3 rather than waiting for 4.5.

Cheers, Andreas


>Signed-off-by: James Simmons <[email protected]>
>---
> .../lustre/include/linux/libcfs/libcfs_ioctl.h | 1 -
> drivers/staging/lustre/lustre/libcfs/module.c | 17
>-----------------
> 2 files changed, 0 insertions(+), 18 deletions(-)
>
>diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
>b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
>index f5d741f..485ab26 100644
>--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
>+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
>@@ -110,7 +110,6 @@ struct libcfs_ioctl_handler {
> #define IOC_LIBCFS_CLEAR_DEBUG _IOWR('e', 31, long)
> #define IOC_LIBCFS_MARK_DEBUG _IOWR('e', 32, long)
> #define IOC_LIBCFS_MEMHOG _IOWR('e', 36, long)
>-#define IOC_LIBCFS_PING_TEST _IOWR('e', 37, long)
> /* lnet ioctls */
> #define IOC_LIBCFS_GET_NI _IOWR('e', 50, long)
> #define IOC_LIBCFS_FAIL_NID _IOWR('e', 51, long)
>diff --git a/drivers/staging/lustre/lustre/libcfs/module.c
>b/drivers/staging/lustre/lustre/libcfs/module.c
>index 570f05c..89038ed 100644
>--- a/drivers/staging/lustre/lustre/libcfs/module.c
>+++ b/drivers/staging/lustre/lustre/libcfs/module.c
>@@ -274,23 +274,6 @@ static int libcfs_ioctl_int(struct cfs_psdev_file
> }
> break;
>
>- case IOC_LIBCFS_PING_TEST: {
>- extern void (kping_client)(struct libcfs_ioctl_data *);
>- void (*ping)(struct libcfs_ioctl_data *);
>-
>- CDEBUG(D_IOCTL, "doing %d pings to nid %s (%s)\n",
>- data->ioc_count, libcfs_nid2str(data->ioc_nid),
>- libcfs_nid2str(data->ioc_nid));
>- ping = symbol_get(kping_client);
>- if (!ping)
>- CERROR("symbol_get failed\n");
>- else {
>- ping(data);
>- symbol_put(kping_client);
>- }
>- return 0;
>- }
>-
> default: {
> struct libcfs_ioctl_handler *hand;
>
>
>--
>1.7.1

2015-12-21 22:05:51

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] staging: lustre: export cfs_str2mask

On Sun, Nov 08, 2015 at 11:34:59AM -0500, James Simmons wrote:
> We need cfs_str2mask exported for our server code.
> Even with the server code not available upstream
> it would be nice to use the upstream code on Lustre
> servers.

Nope, sorry, we don't export symbols for any non-in-tree users, that's
not allowed.

I can't take this.

greg k-h

2015-12-21 22:06:50

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v2] staging: lustre: remove IOC_LIBCFS_PING_TEST ioctl

On Fri, Nov 27, 2015 at 04:31:39AM +0000, Dilger, Andreas wrote:
> On 2015/11/08, 09:34, "James Simmons" <[email protected]> wrote:
>
> >The ioctl IOC_LIBCFS_PING_TEST has not been used in
> >ages. The recent nidstring changes which moved all
> >the nidstring operations from libcfs to the LNet
> >layer but this ioctl code was still using an
> >nidstring operation that was causing an circular
> >dependency loop between libcfs and LNet:
>
> Hi Greg,
> are you planning on pushing this patch to Linus for 4.4? It was resent
> on 11/08 per your request on 11/07 but I don't see it in staging or
> staging-next yet. Since it fixes the depmod dependency cycle for
> allmodconfig builds on mainline it seems worthwhile to include into
> 4.4-rc3 rather than waiting for 4.5.

No one told me it fixed a bug, let me see if it's still even needed...

2015-12-21 22:08:43

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH] staging: lustre: Handle nodemask on UMP machines

On Sun, Nov 08, 2015 at 11:34:55AM -0500, James Simmons wrote:
> For UMP and SMP machines the struct cfs_cpt_table are
> defined differently. In the case handled by this patch
> nodemask is defined as a integer for the UMP case and
> as a pointer for the SMP case. This will cause a problem
> for ost_setup which reads the nodemask directly. Instead
> we create a UMP version of cfs_cpt_nodemask and use that
> in ost_setup.
>
> Signed-off-by: James Simmons <[email protected]>
> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4199
> Reviewed-on: http://review.whamcloud.com/9219
> Reviewed-by: Liang Zhen <[email protected]>
> Reviewed-by: Li Xi <[email protected]>
> Reviewed-by: Andreas Dilger <[email protected]>
>
> Starting in 3.14 kernels nodemask_t was changed from a
> a unsigned long to a linux bitmap so more than 32 cores
> could be supported. Using set_bit in cfs_cpt_table_alloc
> no longer compiles so this patch backports bits of the
> node management function that use a linux bitmap back
> end. Cleaned up libcfs bitmap.h to use the libcfs layers
> memory allocation function. This was pulling in lustre
> related code that was not defined.
>
> Signed-off-by: James Simmons <[email protected]>
> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4993
> Reviewed-on: http://review.whamcloud.com/10332
> Reviewed-by: Liang Zhen <[email protected]>
> Reviewed-by: Bob Glossman <[email protected]>
> Reviewed-by: Oleg Drokin <[email protected]>

What is with this crazy two sections of signed-off-by? If this was 2
patches, make it two patches.

If not, then don't do this.

Also, this whole series had no numbering, so I don't know how to apply
them, please fix and resend it.

thanks,

greg k-h

2015-12-21 22:18:24

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH v2] staging: lustre: remove IOC_LIBCFS_PING_TEST ioctl

On Mon, Dec 21, 2015 at 2:06 PM, Greg Kroah-Hartman
<[email protected]> wrote:
>
> No one told me it fixed a bug, let me see if it's still even needed...

You were definitely cc'd on a couple of the threads..

But it's done now (well, two weeks ago), I applied it as commit
d035e336287b ("staging/lustre: remove IOC_LIBCFS_PING_TEST ioctl").

Linus

2015-12-21 22:22:09

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v2] staging: lustre: remove IOC_LIBCFS_PING_TEST ioctl

On Mon, Dec 21, 2015 at 02:18:18PM -0800, Linus Torvalds wrote:
> On Mon, Dec 21, 2015 at 2:06 PM, Greg Kroah-Hartman
> <[email protected]> wrote:
> >
> > No one told me it fixed a bug, let me see if it's still even needed...
>
> You were definitely cc'd on a couple of the threads..
>
> But it's done now (well, two weeks ago), I applied it as commit
> d035e336287b ("staging/lustre: remove IOC_LIBCFS_PING_TEST ioctl").

Ah, see it now, sorry about that, catching up on old staging patches
right now...

2015-12-22 00:31:05

by Dilger, Andreas

[permalink] [raw]
Subject: Re: [lustre-devel] [PATCH] staging: lustre: Handle nodemask on UMP machines

On 2015/12/21, 15:08, "lustre-devel on behalf of Greg Kroah-Hartman"
<[email protected] on behalf of
[email protected]> wrote:

>On Sun, Nov 08, 2015 at 11:34:55AM -0500, James Simmons wrote:
>> For UMP and SMP machines the struct cfs_cpt_table are
>> defined differently. In the case handled by this patch
>> nodemask is defined as a integer for the UMP case and
>> as a pointer for the SMP case. This will cause a problem
>> for ost_setup which reads the nodemask directly. Instead
>> we create a UMP version of cfs_cpt_nodemask and use that
>> in ost_setup.
>>
>> Signed-off-by: James Simmons <[email protected]>
>> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4199
>> Reviewed-on: http://review.whamcloud.com/9219
>> Reviewed-by: Liang Zhen <[email protected]>
>> Reviewed-by: Li Xi <[email protected]>
>> Reviewed-by: Andreas Dilger <[email protected]>
>>
>> Starting in 3.14 kernels nodemask_t was changed from a
>> a unsigned long to a linux bitmap so more than 32 cores
>> could be supported. Using set_bit in cfs_cpt_table_alloc
>> no longer compiles so this patch backports bits of the
>> node management function that use a linux bitmap back
>> end. Cleaned up libcfs bitmap.h to use the libcfs layers
>> memory allocation function. This was pulling in lustre
>> related code that was not defined.
>>
>> Signed-off-by: James Simmons <[email protected]>
>> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4993
>> Reviewed-on: http://review.whamcloud.com/10332
>> Reviewed-by: Liang Zhen <[email protected]>
>> Reviewed-by: Bob Glossman <[email protected]>
>> Reviewed-by: Oleg Drokin <[email protected]>
>
>What is with this crazy two sections of signed-off-by? If this was 2
>patches, make it two patches.
>
>If not, then don't do this.
>
>Also, this whole series had no numbering, so I don't know how to apply
>them, please fix and resend it.

I suspect that this is merging two separate patches so that they do not
introduce a regression when landed to master. In the past you've said
you wanted fix patches merged into the original patch for this reason.

I guess the right thing to do is to merge the Signed-off-by: lines at
the end of the combined patch, rather than just mashing the commit
messages together.

Cheers, Andreas
--
Andreas Dilger

Lustre Principal Architect
Intel High Performance Data Division