From simmonsja at ornl.gov Sun Nov 1 23:07:42 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Sun, 1 Nov 2015 23:07:42 +0000 Subject: [lustre-devel] [PATCH 1/3] staging: lustre: checkpatch cleanups for nidstring.c In-Reply-To: <20151030230148.GB2920@kroah.com> References: <1446161303-798-1-git-send-email-jsimmons@infradead.org> <1446161303-798-2-git-send-email-jsimmons@infradead.org> <20151030230148.GB2920@kroah.com> Message-ID: <229dae23c2f34950a21db4bd6dbdcfba@EXCHCS32.ornl.gov> >On Thu, Oct 29, 2015 at 07:28:21PM -0400, James Simmons wrote: >> With nidstring now having the latest fixes we can >> now clean up all the remaining checkpatch errors >> for nidstring.c. > >Please be specific as to exactly what you changed, and break it up into >one-patch-per-thing. And no, "fix all checkpatch errors" is not "one >thing" Hmm. This makes me think I might be going about this wrong. Instead of doing style changes per file I should be doing one style change per subsystem instead. Unless you prefer doing these style changes on per file base. Perhaps for now I should focus on pushing the fixes that have cumulated and once caught up then finished off the style issues. From shuey at purdue.edu Sun Nov 1 23:24:18 2015 From: shuey at purdue.edu (Michael Shuey) Date: Sun, 1 Nov 2015 18:24:18 -0500 Subject: [lustre-devel] [PATCH 1/3] staging: lustre: checkpatch cleanups for nidstring.c In-Reply-To: <229dae23c2f34950a21db4bd6dbdcfba@EXCHCS32.ornl.gov> References: <1446161303-798-1-git-send-email-jsimmons@infradead.org> <1446161303-798-2-git-send-email-jsimmons@infradead.org> <20151030230148.GB2920@kroah.com> <229dae23c2f34950a21db4bd6dbdcfba@EXCHCS32.ornl.gov> Message-ID: I suspect you're over-thinking it. The maintainers appear to be reacting to the different types of style changes - "checkpatch cleanups" is an awfully broad commit message. I'd suggest breaking this patch (and any others like it) into two pieces; one with whitespace cleanups, and one with the "== NULL" fixes (and mentioning both by kind in the commit message, rather than just attributing to checkpatch). Then issue a v2 of the series, and see where you land. Of course, YMMV. :-) -- Mike Shuey On Sun, Nov 1, 2015 at 6:07 PM, Simmons, James A. wrote: >>On Thu, Oct 29, 2015 at 07:28:21PM -0400, James Simmons wrote: >>> With nidstring now having the latest fixes we can >>> now clean up all the remaining checkpatch errors >>> for nidstring.c. >> >>Please be specific as to exactly what you changed, and break it up into >>one-patch-per-thing. And no, "fix all checkpatch errors" is not "one >>thing" > > Hmm. This makes me think I might be going about this wrong. Instead of > doing style changes per file I should be doing one style change per subsystem > instead. Unless you prefer doing these style changes on per file base. Perhaps > for now I should focus on pushing the fixes that have cumulated and once > caught up then finished off the style issues. > _______________________________________________ > lustre-devel mailing list > lustre-devel at lists.lustre.org > http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org From dan.carpenter at oracle.com Mon Nov 2 14:48:38 2015 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Mon, 2 Nov 2015 17:48:38 +0300 Subject: [lustre-devel] [PATCH 1/3] staging: lustre: checkpatch cleanups for nidstring.c In-Reply-To: <229dae23c2f34950a21db4bd6dbdcfba@EXCHCS32.ornl.gov> References: <1446161303-798-1-git-send-email-jsimmons@infradead.org> <1446161303-798-2-git-send-email-jsimmons@infradead.org> <20151030230148.GB2920@kroah.com> <229dae23c2f34950a21db4bd6dbdcfba@EXCHCS32.ornl.gov> Message-ID: <20151102144837.GG18797@mwanda> Yeah. That is often the fastest way to fix all the checkpatch warnings. Checkpatch warnings are pretty mechanical. Just send like 100 patches at a time until everything is fixed. Don't overthink. Say your patch breaks the alignment then you have to fix that, but otherwise only fix one thing at a time. Sometimes people will ask you to fix something else on the same line, but just say "I didn't introduce that, but yes I am planning to fix that in a later patchset since I am following the one thing per patch rule." Don't feel shame about sending many small patches. We pretty much merge everything. regards, dan carpenter From jsimmons at infradead.org Mon Nov 2 17:22:06 2015 From: jsimmons at infradead.org (James Simmons) Date: Mon, 2 Nov 2015 12:22:06 -0500 Subject: [lustre-devel] [PATCH v2 0/7] staging: lustre: second series for libcfs hash code cleanup Message-ID: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> This patch covers more style cleanup series for the libcfs hash code. Mostly removal of white spaces and resolving the checkpath issues in libcfs_hash.h. James Simmons (7): staging: lustre: remove white space in libcfs_hash.h staging: lustre: remove obsolete comment in libcfs_hash.h staging: lustre: move linux hash.h header to start of libcfs_hash.h staging: lustre: use proper comment blocks for libcfs_hash.h staging: lustre: handle NULL comparisons correctly for libcfs_hash.h staging: lustre: remove white space in hash.c staging: lustre: place linux header first in hash.c .../lustre/include/linux/libcfs/libcfs_hash.h | 170 +++++----- drivers/staging/lustre/lustre/libcfs/hash.c | 344 ++++++++++---------- 2 files changed, 266 insertions(+), 248 deletions(-) From jsimmons at infradead.org Mon Nov 2 17:22:08 2015 From: jsimmons at infradead.org (James Simmons) Date: Mon, 2 Nov 2015 12:22:08 -0500 Subject: [lustre-devel] [PATCH v2 2/7] staging: lustre: remove obsolete comment in libcfs_hash.h In-Reply-To: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> References: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> Message-ID: <1446484933-23571-3-git-send-email-jsimmons@infradead.org> Remove comment hash_long which was removed long ago. Signed-off-by: James Simmons --- .../lustre/include/linux/libcfs/libcfs_hash.h | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h index 4d73f8a..4a78e6d 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h @@ -56,13 +56,6 @@ /* 2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */ #define CFS_GOLDEN_RATIO_PRIME_64 0x9e37fffffffc0001ULL -/* - * Ideally we would use HAVE_HASH_LONG for this, but on linux we configure - * the linux kernel and user space at the same time, so we need to differentiate - * between them explicitly. If this is not needed on other architectures, then - * we'll need to move the functions to architecture specific headers. - */ - #include /** disable debug */ -- 1.7.1 From jsimmons at infradead.org Mon Nov 2 17:22:13 2015 From: jsimmons at infradead.org (James Simmons) Date: Mon, 2 Nov 2015 12:22:13 -0500 Subject: [lustre-devel] [PATCH v2 7/7] staging: lustre: place linux header first in hash.c In-Reply-To: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> References: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> Message-ID: <1446484933-23571-8-git-send-email-jsimmons@infradead.org> Always place linux headers first in libcfs header files. This avoid can potential build issues if any changes to a libcfs header land that starts using a linux header definition. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/libcfs/hash.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c b/drivers/staging/lustre/lustre/libcfs/hash.c index ed4e1f1..4cd8776 100644 --- a/drivers/staging/lustre/lustre/libcfs/hash.c +++ b/drivers/staging/lustre/lustre/libcfs/hash.c @@ -106,9 +106,9 @@ * Now we support both locked iteration & lockless iteration of hash * table. Also, user can break the iteration by return 1 in callback. */ +#include #include "../../include/linux/libcfs/libcfs.h" -#include #if CFS_HASH_DEBUG_LEVEL >= CFS_HASH_DEBUG_1 static unsigned int warn_on_depth = 8; -- 1.7.1 From jsimmons at infradead.org Mon Nov 2 17:22:10 2015 From: jsimmons at infradead.org (James Simmons) Date: Mon, 2 Nov 2015 12:22:10 -0500 Subject: [lustre-devel] [PATCH v2 4/7] staging: lustre: use proper comment blocks for libcfs_hash.h In-Reply-To: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> References: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> Message-ID: <1446484933-23571-5-git-send-email-jsimmons@infradead.org> The script checkpatch.pl reported problems with the style of the comment blocks. This patch resolves those problems. Signed-off-by: James Simmons --- .../lustre/include/linux/libcfs/libcfs_hash.h | 21 +++++++++++++------ 1 files changed, 14 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h index 2e0c892..87dee16 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h @@ -61,8 +61,10 @@ /** disable debug */ #define CFS_HASH_DEBUG_NONE 0 -/** record hash depth and output to console when it's too deep, - * computing overhead is low but consume more memory */ +/* + * record hash depth and output to console when it's too deep, + * computing overhead is low but consume more memory + */ #define CFS_HASH_DEBUG_1 1 /** expensive, check key validation */ #define CFS_HASH_DEBUG_2 2 @@ -158,7 +160,8 @@ enum cfs_hash_tag { */ CFS_HASH_NBLK_CHANGE = 1 << 13, /** NB, we typed hs_flags as __u16, please change it - * if you need to extend >=16 flags */ + * if you need to extend >=16 flags + */ }; /** most used attributes */ @@ -205,8 +208,10 @@ enum cfs_hash_tag { */ struct cfs_hash { - /** serialize with rehash, or serialize all operations if - * the hash-table has CFS_HASH_NO_BKTLOCK */ + /* + * serialize with rehash, or serialize all operations if + * the hash-table has CFS_HASH_NO_BKTLOCK + */ union cfs_hash_lock hs_lock; /** hash operations */ struct cfs_hash_ops *hs_ops; @@ -373,9 +378,11 @@ cfs_hash_with_add_tail(struct cfs_hash *hs) static inline int cfs_hash_with_no_itemref(struct cfs_hash *hs) { - /* hash-table doesn't keep refcount on item, + /* + * hash-table doesn't keep refcount on item, * item can't be removed from hash unless it's - * ZERO refcount */ + * ZERO refcount. + */ return (hs->hs_flags & CFS_HASH_NO_ITEMREF) != 0; } -- 1.7.1 From jsimmons at infradead.org Mon Nov 2 17:22:09 2015 From: jsimmons at infradead.org (James Simmons) Date: Mon, 2 Nov 2015 12:22:09 -0500 Subject: [lustre-devel] [PATCH v2 3/7] staging: lustre: move linux hash.h header to start of libcfs_hash.h In-Reply-To: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> References: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> Message-ID: <1446484933-23571-4-git-send-email-jsimmons@infradead.org> Minor style cleanup to put hash.h header to the top of the libcfs_hash.h file. Signed-off-by: James Simmons --- .../lustre/include/linux/libcfs/libcfs_hash.h | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h index 4a78e6d..2e0c892 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h @@ -41,6 +41,9 @@ #ifndef __LIBCFS_HASH_H__ #define __LIBCFS_HASH_H__ + +#include + /* * Knuth recommends primes in approximately golden ratio to the maximum * integer representable by a machine word for multiplicative hashing. @@ -56,8 +59,6 @@ /* 2^63 + 2^61 - 2^57 + 2^54 - 2^51 - 2^18 + 1 */ #define CFS_GOLDEN_RATIO_PRIME_64 0x9e37fffffffc0001ULL -#include - /** disable debug */ #define CFS_HASH_DEBUG_NONE 0 /** record hash depth and output to console when it's too deep, -- 1.7.1 From jsimmons at infradead.org Mon Nov 2 17:22:07 2015 From: jsimmons at infradead.org (James Simmons) Date: Mon, 2 Nov 2015 12:22:07 -0500 Subject: [lustre-devel] [PATCH v2 1/7] staging: lustre: remove white space in libcfs_hash.h In-Reply-To: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> References: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> Message-ID: <1446484933-23571-2-git-send-email-jsimmons@infradead.org> Cleanup all the unneeded white space in libcfs_hash.h. Signed-off-by: James Simmons --- .../lustre/include/linux/libcfs/libcfs_hash.h | 135 ++++++++++---------- 1 files changed, 70 insertions(+), 65 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h index 70b8b29..4d73f8a 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h @@ -66,12 +66,12 @@ #include /** disable debug */ -#define CFS_HASH_DEBUG_NONE 0 +#define CFS_HASH_DEBUG_NONE 0 /** record hash depth and output to console when it's too deep, * computing overhead is low but consume more memory */ -#define CFS_HASH_DEBUG_1 1 +#define CFS_HASH_DEBUG_1 1 /** expensive, check key validation */ -#define CFS_HASH_DEBUG_2 2 +#define CFS_HASH_DEBUG_2 2 #define CFS_HASH_DEBUG_LEVEL CFS_HASH_DEBUG_NONE @@ -108,16 +108,18 @@ struct cfs_hash_bucket { * cfs_hash bucket descriptor, it's normally in stack of caller */ struct cfs_hash_bd { - struct cfs_hash_bucket *bd_bucket; /**< address of bucket */ - unsigned int bd_offset; /**< offset in bucket */ + /* address of bucket */ + struct cfs_hash_bucket *bd_bucket; + /* offset in bucket */ + unsigned int bd_offset; }; -#define CFS_HASH_NAME_LEN 16 /**< default name length */ -#define CFS_HASH_BIGNAME_LEN 64 /**< bigname for param tree */ +#define CFS_HASH_NAME_LEN 16 /**< default name length */ +#define CFS_HASH_BIGNAME_LEN 64 /**< bigname for param tree */ -#define CFS_HASH_BKT_BITS 3 /**< default bits of bucket */ -#define CFS_HASH_BITS_MAX 30 /**< max bits of bucket */ -#define CFS_HASH_BITS_MIN CFS_HASH_BKT_BITS +#define CFS_HASH_BKT_BITS 3 /**< default bits of bucket */ +#define CFS_HASH_BITS_MAX 30 /**< max bits of bucket */ +#define CFS_HASH_BITS_MIN CFS_HASH_BKT_BITS /** * common hash attributes. @@ -133,41 +135,41 @@ enum cfs_hash_tag { */ CFS_HASH_NO_LOCK = 1 << 0, /** no bucket lock, use one spinlock to protect the whole hash */ - CFS_HASH_NO_BKTLOCK = 1 << 1, + CFS_HASH_NO_BKTLOCK = 1 << 1, /** rwlock to protect bucket */ - CFS_HASH_RW_BKTLOCK = 1 << 2, + CFS_HASH_RW_BKTLOCK = 1 << 2, /** spinlock to protect bucket */ - CFS_HASH_SPIN_BKTLOCK = 1 << 3, + CFS_HASH_SPIN_BKTLOCK = 1 << 3, /** always add new item to tail */ - CFS_HASH_ADD_TAIL = 1 << 4, + CFS_HASH_ADD_TAIL = 1 << 4, /** hash-table doesn't have refcount on item */ - CFS_HASH_NO_ITEMREF = 1 << 5, + CFS_HASH_NO_ITEMREF = 1 << 5, /** big name for param-tree */ CFS_HASH_BIGNAME = 1 << 6, /** track global count */ CFS_HASH_COUNTER = 1 << 7, /** rehash item by new key */ - CFS_HASH_REHASH_KEY = 1 << 8, + CFS_HASH_REHASH_KEY = 1 << 8, /** Enable dynamic hash resizing */ - CFS_HASH_REHASH = 1 << 9, + CFS_HASH_REHASH = 1 << 9, /** can shrink hash-size */ - CFS_HASH_SHRINK = 1 << 10, + CFS_HASH_SHRINK = 1 << 10, /** assert hash is empty on exit */ - CFS_HASH_ASSERT_EMPTY = 1 << 11, + CFS_HASH_ASSERT_EMPTY = 1 << 11, /** record hlist depth */ - CFS_HASH_DEPTH = 1 << 12, + CFS_HASH_DEPTH = 1 << 12, /** * rehash is always scheduled in a different thread, so current * change on hash table is non-blocking */ - CFS_HASH_NBLK_CHANGE = 1 << 13, + CFS_HASH_NBLK_CHANGE = 1 << 13, /** NB, we typed hs_flags as __u16, please change it * if you need to extend >=16 flags */ }; /** most used attributes */ -#define CFS_HASH_DEFAULT (CFS_HASH_RW_BKTLOCK | \ - CFS_HASH_COUNTER | CFS_HASH_REHASH) +#define CFS_HASH_DEFAULT (CFS_HASH_RW_BKTLOCK | \ + CFS_HASH_COUNTER | CFS_HASH_REHASH) /** * cfs_hash is a hash-table implementation for general purpose, it can support: @@ -211,7 +213,7 @@ enum cfs_hash_tag { struct cfs_hash { /** serialize with rehash, or serialize all operations if * the hash-table has CFS_HASH_NO_BKTLOCK */ - union cfs_hash_lock hs_lock; + union cfs_hash_lock hs_lock; /** hash operations */ struct cfs_hash_ops *hs_ops; /** hash lock operations */ @@ -219,57 +221,57 @@ struct cfs_hash { /** hash list operations */ struct cfs_hash_hlist_ops *hs_hops; /** hash buckets-table */ - struct cfs_hash_bucket **hs_buckets; + struct cfs_hash_bucket **hs_buckets; /** total number of items on this hash-table */ - atomic_t hs_count; + atomic_t hs_count; /** hash flags, see cfs_hash_tag for detail */ - __u16 hs_flags; + __u16 hs_flags; /** # of extra-bytes for bucket, for user saving extended attributes */ - __u16 hs_extra_bytes; + __u16 hs_extra_bytes; /** wants to iterate */ - __u8 hs_iterating; + __u8 hs_iterating; /** hash-table is dying */ - __u8 hs_exiting; + __u8 hs_exiting; /** current hash bits */ - __u8 hs_cur_bits; + __u8 hs_cur_bits; /** min hash bits */ - __u8 hs_min_bits; + __u8 hs_min_bits; /** max hash bits */ - __u8 hs_max_bits; + __u8 hs_max_bits; /** bits for rehash */ - __u8 hs_rehash_bits; + __u8 hs_rehash_bits; /** bits for each bucket */ - __u8 hs_bkt_bits; + __u8 hs_bkt_bits; /** resize min threshold */ - __u16 hs_min_theta; + __u16 hs_min_theta; /** resize max threshold */ - __u16 hs_max_theta; + __u16 hs_max_theta; /** resize count */ - __u32 hs_rehash_count; + __u32 hs_rehash_count; /** # of iterators (caller of cfs_hash_for_each_*) */ - __u32 hs_iterators; + __u32 hs_iterators; /** rehash workitem */ - cfs_workitem_t hs_rehash_wi; + cfs_workitem_t hs_rehash_wi; /** refcount on this hash table */ - atomic_t hs_refcount; + atomic_t hs_refcount; /** rehash buckets-table */ - struct cfs_hash_bucket **hs_rehash_buckets; + struct cfs_hash_bucket **hs_rehash_buckets; #if CFS_HASH_DEBUG_LEVEL >= CFS_HASH_DEBUG_1 /** serialize debug members */ spinlock_t hs_dep_lock; /** max depth */ - unsigned int hs_dep_max; + unsigned int hs_dep_max; /** id of the deepest bucket */ - unsigned int hs_dep_bkt; + unsigned int hs_dep_bkt; /** offset in the deepest bucket */ - unsigned int hs_dep_off; + unsigned int hs_dep_off; /** bits when we found the max depth */ - unsigned int hs_dep_bits; + unsigned int hs_dep_bits; /** workitem to output max depth */ - cfs_workitem_t hs_dep_wi; + cfs_workitem_t hs_dep_wi; #endif /** name of htable */ - char hs_name[0]; + char hs_name[0]; }; struct cfs_hash_lock_ops { @@ -324,11 +326,11 @@ struct cfs_hash_ops { }; /** total number of buckets in @hs */ -#define CFS_HASH_NBKT(hs) \ +#define CFS_HASH_NBKT(hs) \ (1U << ((hs)->hs_cur_bits - (hs)->hs_bkt_bits)) /** total number of buckets in @hs while rehashing */ -#define CFS_HASH_RH_NBKT(hs) \ +#define CFS_HASH_RH_NBKT(hs) \ (1U << ((hs)->hs_rehash_bits - (hs)->hs_bkt_bits)) /** number of hlist for in bucket */ @@ -433,19 +435,22 @@ cfs_hash_with_nblk_change(struct cfs_hash *hs) static inline int cfs_hash_is_exiting(struct cfs_hash *hs) -{ /* cfs_hash_destroy is called */ +{ + /* cfs_hash_destroy is called */ return hs->hs_exiting; } static inline int cfs_hash_is_rehashing(struct cfs_hash *hs) -{ /* rehash is launched */ +{ + /* rehash is launched */ return hs->hs_rehash_bits != 0; } static inline int cfs_hash_is_iterating(struct cfs_hash *hs) -{ /* someone is calling cfs_hash_for_each_* */ +{ + /* someone is calling cfs_hash_for_each_* */ return hs->hs_iterating || hs->hs_iterators != 0; } @@ -758,7 +763,7 @@ static inline void cfs_hash_bucket_validate(struct cfs_hash *hs, struct cfs_hash_bd *bd, struct hlist_node *hnode) { - struct cfs_hash_bd bds[2]; + struct cfs_hash_bd bds[2]; cfs_hash_dual_bd_get(hs, cfs_hash_key(hs, hnode), bds); LASSERT(bds[0].bd_bucket == bd->bd_bucket || @@ -777,9 +782,9 @@ cfs_hash_bucket_validate(struct cfs_hash *hs, struct cfs_hash_bd *bd, #endif /* CFS_HASH_DEBUG_LEVEL */ -#define CFS_HASH_THETA_BITS 10 -#define CFS_HASH_MIN_THETA (1U << (CFS_HASH_THETA_BITS - 1)) -#define CFS_HASH_MAX_THETA (1U << (CFS_HASH_THETA_BITS + 1)) +#define CFS_HASH_THETA_BITS 10 +#define CFS_HASH_MIN_THETA (1U << (CFS_HASH_THETA_BITS - 1)) +#define CFS_HASH_MAX_THETA (1U << (CFS_HASH_THETA_BITS + 1)) /* Return integer component of theta */ static inline int __cfs_hash_theta_int(int theta) @@ -848,20 +853,20 @@ cfs_hash_u64_hash(const __u64 key, unsigned mask) } /** iterate over all buckets in @bds (array of struct cfs_hash_bd) */ -#define cfs_hash_for_each_bd(bds, n, i) \ +#define cfs_hash_for_each_bd(bds, n, i) \ for (i = 0; i < n && (bds)[i].bd_bucket != NULL; i++) /** iterate over all buckets of @hs */ -#define cfs_hash_for_each_bucket(hs, bd, pos) \ - for (pos = 0; \ - pos < CFS_HASH_NBKT(hs) && \ +#define cfs_hash_for_each_bucket(hs, bd, pos) \ + for (pos = 0; \ + pos < CFS_HASH_NBKT(hs) && \ ((bd)->bd_bucket = (hs)->hs_buckets[pos]) != NULL; pos++) /** iterate over all hlist of bucket @bd */ -#define cfs_hash_bd_for_each_hlist(hs, bd, hlist) \ - for ((bd)->bd_offset = 0; \ - (bd)->bd_offset < CFS_HASH_BKT_NHLIST(hs) && \ - (hlist = cfs_hash_bd_hhead(hs, bd)) != NULL; \ +#define cfs_hash_bd_for_each_hlist(hs, bd, hlist) \ + for ((bd)->bd_offset = 0; \ + (bd)->bd_offset < CFS_HASH_BKT_NHLIST(hs) && \ + (hlist = cfs_hash_bd_hhead(hs, bd)) != NULL; \ (bd)->bd_offset++) /* !__LIBCFS__HASH_H__ */ -- 1.7.1 From jsimmons at infradead.org Mon Nov 2 17:22:11 2015 From: jsimmons at infradead.org (James Simmons) Date: Mon, 2 Nov 2015 12:22:11 -0500 Subject: [lustre-devel] [PATCH v2 5/7] staging: lustre: handle NULL comparisons correctly for libcfs_hash.h In-Reply-To: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> References: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> Message-ID: <1446484933-23571-6-git-send-email-jsimmons@infradead.org> Remove all direct NULL comparisons in libcfs_hash.h. Signed-off-by: James Simmons --- .../lustre/include/linux/libcfs/libcfs_hash.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h index 87dee16..6bd2012 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h @@ -827,7 +827,7 @@ cfs_hash_djb2_hash(const void *key, size_t size, unsigned mask) { unsigned i, hash = 5381; - LASSERT(key != NULL); + LASSERT(key); for (i = 0; i < size; i++) hash = hash * 33 + ((char *)key)[i]; @@ -855,7 +855,7 @@ cfs_hash_u64_hash(const __u64 key, unsigned mask) /** iterate over all buckets in @bds (array of struct cfs_hash_bd) */ #define cfs_hash_for_each_bd(bds, n, i) \ - for (i = 0; i < n && (bds)[i].bd_bucket != NULL; i++) + for (i = 0; i < n && (bds)[i].bd_bucket; i++) /** iterate over all buckets of @hs */ #define cfs_hash_for_each_bucket(hs, bd, pos) \ -- 1.7.1 From jsimmons at infradead.org Mon Nov 2 17:22:12 2015 From: jsimmons at infradead.org (James Simmons) Date: Mon, 2 Nov 2015 12:22:12 -0500 Subject: [lustre-devel] [PATCH v2 6/7] staging: lustre: remove white space in hash.c In-Reply-To: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> References: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> Message-ID: <1446484933-23571-7-git-send-email-jsimmons@infradead.org> Cleanup all the unneeded white space in hash.c. Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/libcfs/hash.c | 342 ++++++++++++++------------- 1 files changed, 177 insertions(+), 165 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c b/drivers/staging/lustre/lustre/libcfs/hash.c index 0308744..ed4e1f1 100644 --- a/drivers/staging/lustre/lustre/libcfs/hash.c +++ b/drivers/staging/lustre/lustre/libcfs/hash.c @@ -161,49 +161,49 @@ cfs_hash_rw_unlock(union cfs_hash_lock *lock, int exclusive) /** No lock hash */ static struct cfs_hash_lock_ops cfs_hash_nl_lops = { .hs_lock = cfs_hash_nl_lock, - .hs_unlock = cfs_hash_nl_unlock, - .hs_bkt_lock = cfs_hash_nl_lock, - .hs_bkt_unlock = cfs_hash_nl_unlock, + .hs_unlock = cfs_hash_nl_unlock, + .hs_bkt_lock = cfs_hash_nl_lock, + .hs_bkt_unlock = cfs_hash_nl_unlock, }; /** no bucket lock, one spinlock to protect everything */ static struct cfs_hash_lock_ops cfs_hash_nbl_lops = { .hs_lock = cfs_hash_spin_lock, - .hs_unlock = cfs_hash_spin_unlock, - .hs_bkt_lock = cfs_hash_nl_lock, - .hs_bkt_unlock = cfs_hash_nl_unlock, + .hs_unlock = cfs_hash_spin_unlock, + .hs_bkt_lock = cfs_hash_nl_lock, + .hs_bkt_unlock = cfs_hash_nl_unlock, }; /** spin bucket lock, rehash is enabled */ static struct cfs_hash_lock_ops cfs_hash_bkt_spin_lops = { .hs_lock = cfs_hash_rw_lock, - .hs_unlock = cfs_hash_rw_unlock, - .hs_bkt_lock = cfs_hash_spin_lock, - .hs_bkt_unlock = cfs_hash_spin_unlock, + .hs_unlock = cfs_hash_rw_unlock, + .hs_bkt_lock = cfs_hash_spin_lock, + .hs_bkt_unlock = cfs_hash_spin_unlock, }; /** rw bucket lock, rehash is enabled */ static struct cfs_hash_lock_ops cfs_hash_bkt_rw_lops = { .hs_lock = cfs_hash_rw_lock, - .hs_unlock = cfs_hash_rw_unlock, - .hs_bkt_lock = cfs_hash_rw_lock, - .hs_bkt_unlock = cfs_hash_rw_unlock, + .hs_unlock = cfs_hash_rw_unlock, + .hs_bkt_lock = cfs_hash_rw_lock, + .hs_bkt_unlock = cfs_hash_rw_unlock, }; /** spin bucket lock, rehash is disabled */ static struct cfs_hash_lock_ops cfs_hash_nr_bkt_spin_lops = { .hs_lock = cfs_hash_nl_lock, - .hs_unlock = cfs_hash_nl_unlock, - .hs_bkt_lock = cfs_hash_spin_lock, - .hs_bkt_unlock = cfs_hash_spin_unlock, + .hs_unlock = cfs_hash_nl_unlock, + .hs_bkt_lock = cfs_hash_spin_lock, + .hs_bkt_unlock = cfs_hash_spin_unlock, }; /** rw bucket lock, rehash is disabled */ static struct cfs_hash_lock_ops cfs_hash_nr_bkt_rw_lops = { .hs_lock = cfs_hash_nl_lock, - .hs_unlock = cfs_hash_nl_unlock, - .hs_bkt_lock = cfs_hash_rw_lock, - .hs_bkt_unlock = cfs_hash_rw_unlock, + .hs_unlock = cfs_hash_nl_unlock, + .hs_bkt_lock = cfs_hash_rw_lock, + .hs_bkt_unlock = cfs_hash_rw_unlock, }; static void @@ -280,7 +280,7 @@ cfs_hash_hh_hnode_del(struct cfs_hash *hs, struct cfs_hash_bd *bd, */ struct cfs_hash_head_dep { struct hlist_head hd_head; /**< entries list */ - unsigned int hd_depth; /**< list length */ + unsigned int hd_depth; /**< list length */ }; static int @@ -328,7 +328,7 @@ cfs_hash_hd_hnode_del(struct cfs_hash *hs, struct cfs_hash_bd *bd, */ struct cfs_hash_dhead { struct hlist_head dh_head; /**< entries list */ - struct hlist_node *dh_tail; /**< the last entry */ + struct hlist_node *dh_tail; /**< the last entry */ }; static int @@ -384,8 +384,8 @@ cfs_hash_dh_hnode_del(struct cfs_hash *hs, struct cfs_hash_bd *bd, */ struct cfs_hash_dhead_dep { struct hlist_head dd_head; /**< entries list */ - struct hlist_node *dd_tail; /**< the last entry */ - unsigned int dd_depth; /**< list length */ + struct hlist_node *dd_tail; /**< the last entry */ + unsigned int dd_depth; /**< list length */ }; static int @@ -436,31 +436,31 @@ cfs_hash_dd_hnode_del(struct cfs_hash *hs, struct cfs_hash_bd *bd, } static struct cfs_hash_hlist_ops cfs_hash_hh_hops = { - .hop_hhead = cfs_hash_hh_hhead, - .hop_hhead_size = cfs_hash_hh_hhead_size, - .hop_hnode_add = cfs_hash_hh_hnode_add, - .hop_hnode_del = cfs_hash_hh_hnode_del, + .hop_hhead = cfs_hash_hh_hhead, + .hop_hhead_size = cfs_hash_hh_hhead_size, + .hop_hnode_add = cfs_hash_hh_hnode_add, + .hop_hnode_del = cfs_hash_hh_hnode_del, }; static struct cfs_hash_hlist_ops cfs_hash_hd_hops = { - .hop_hhead = cfs_hash_hd_hhead, - .hop_hhead_size = cfs_hash_hd_hhead_size, - .hop_hnode_add = cfs_hash_hd_hnode_add, - .hop_hnode_del = cfs_hash_hd_hnode_del, + .hop_hhead = cfs_hash_hd_hhead, + .hop_hhead_size = cfs_hash_hd_hhead_size, + .hop_hnode_add = cfs_hash_hd_hnode_add, + .hop_hnode_del = cfs_hash_hd_hnode_del, }; static struct cfs_hash_hlist_ops cfs_hash_dh_hops = { - .hop_hhead = cfs_hash_dh_hhead, - .hop_hhead_size = cfs_hash_dh_hhead_size, - .hop_hnode_add = cfs_hash_dh_hnode_add, - .hop_hnode_del = cfs_hash_dh_hnode_del, + .hop_hhead = cfs_hash_dh_hhead, + .hop_hhead_size = cfs_hash_dh_hhead_size, + .hop_hnode_add = cfs_hash_dh_hnode_add, + .hop_hnode_del = cfs_hash_dh_hnode_del, }; static struct cfs_hash_hlist_ops cfs_hash_dd_hops = { - .hop_hhead = cfs_hash_dd_hhead, - .hop_hhead_size = cfs_hash_dd_hhead_size, - .hop_hnode_add = cfs_hash_dd_hnode_add, - .hop_hnode_del = cfs_hash_dd_hnode_del, + .hop_hhead = cfs_hash_dd_hhead, + .hop_hhead_size = cfs_hash_dd_hhead_size, + .hop_hnode_add = cfs_hash_dd_hnode_add, + .hop_hnode_del = cfs_hash_dd_hnode_del, }; static void @@ -529,7 +529,7 @@ void cfs_hash_bd_add_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, struct hlist_node *hnode) { - int rc; + int rc; rc = hs->hs_hops->hop_hnode_add(hs, bd, hnode); cfs_hash_bd_dep_record(hs, bd, rc); @@ -572,7 +572,7 @@ cfs_hash_bd_move_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd_old, { struct cfs_hash_bucket *obkt = bd_old->bd_bucket; struct cfs_hash_bucket *nbkt = bd_new->bd_bucket; - int rc; + int rc; if (cfs_hash_bd_compare(bd_old, bd_new) == 0) return; @@ -597,30 +597,30 @@ EXPORT_SYMBOL(cfs_hash_bd_move_locked); enum { /** always set, for sanity (avoid ZERO intent) */ - CFS_HS_LOOKUP_MASK_FIND = BIT(0), + CFS_HS_LOOKUP_MASK_FIND = BIT(0), /** return entry with a ref */ - CFS_HS_LOOKUP_MASK_REF = BIT(1), + CFS_HS_LOOKUP_MASK_REF = BIT(1), /** add entry if not existing */ - CFS_HS_LOOKUP_MASK_ADD = BIT(2), + CFS_HS_LOOKUP_MASK_ADD = BIT(2), /** delete entry, ignore other masks */ - CFS_HS_LOOKUP_MASK_DEL = BIT(3), + CFS_HS_LOOKUP_MASK_DEL = BIT(3), }; enum cfs_hash_lookup_intent { /** return item w/o refcount */ - CFS_HS_LOOKUP_IT_PEEK = CFS_HS_LOOKUP_MASK_FIND, + CFS_HS_LOOKUP_IT_PEEK = CFS_HS_LOOKUP_MASK_FIND, /** return item with refcount */ - CFS_HS_LOOKUP_IT_FIND = (CFS_HS_LOOKUP_MASK_FIND | - CFS_HS_LOOKUP_MASK_REF), + CFS_HS_LOOKUP_IT_FIND = (CFS_HS_LOOKUP_MASK_FIND | + CFS_HS_LOOKUP_MASK_REF), /** return item w/o refcount if existed, otherwise add */ - CFS_HS_LOOKUP_IT_ADD = (CFS_HS_LOOKUP_MASK_FIND | - CFS_HS_LOOKUP_MASK_ADD), + CFS_HS_LOOKUP_IT_ADD = (CFS_HS_LOOKUP_MASK_FIND | + CFS_HS_LOOKUP_MASK_ADD), /** return item with refcount if existed, otherwise add */ - CFS_HS_LOOKUP_IT_FINDADD = (CFS_HS_LOOKUP_IT_FIND | - CFS_HS_LOOKUP_MASK_ADD), + CFS_HS_LOOKUP_IT_FINDADD = (CFS_HS_LOOKUP_IT_FIND | + CFS_HS_LOOKUP_MASK_ADD), /** delete if existed */ - CFS_HS_LOOKUP_IT_FINDDEL = (CFS_HS_LOOKUP_MASK_FIND | - CFS_HS_LOOKUP_MASK_DEL) + CFS_HS_LOOKUP_IT_FINDDEL = (CFS_HS_LOOKUP_MASK_FIND | + CFS_HS_LOOKUP_MASK_DEL) }; static struct hlist_node * @@ -629,10 +629,10 @@ cfs_hash_bd_lookup_intent(struct cfs_hash *hs, struct cfs_hash_bd *bd, enum cfs_hash_lookup_intent intent) { - struct hlist_head *hhead = cfs_hash_bd_hhead(hs, bd); - struct hlist_node *ehnode; - struct hlist_node *match; - int intent_add = (intent & CFS_HS_LOOKUP_MASK_ADD) != 0; + struct hlist_head *hhead = cfs_hash_bd_hhead(hs, bd); + struct hlist_node *ehnode; + struct hlist_node *match; + int intent_add = (intent & CFS_HS_LOOKUP_MASK_ADD) != 0; /* with this function, we can avoid a lot of useless refcount ops, * which are expensive atomic operations most time. */ @@ -665,7 +665,8 @@ cfs_hash_bd_lookup_intent(struct cfs_hash *hs, struct cfs_hash_bd *bd, } struct hlist_node * -cfs_hash_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, const void *key) +cfs_hash_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, + const void *key) { return cfs_hash_bd_lookup_intent(hs, bd, key, NULL, CFS_HS_LOOKUP_IT_FIND); @@ -673,7 +674,8 @@ cfs_hash_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, const voi EXPORT_SYMBOL(cfs_hash_bd_lookup_locked); struct hlist_node * -cfs_hash_bd_peek_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, const void *key) +cfs_hash_bd_peek_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd, + const void *key) { return cfs_hash_bd_lookup_intent(hs, bd, key, NULL, CFS_HS_LOOKUP_IT_PEEK); @@ -706,7 +708,7 @@ cfs_hash_multi_bd_lock(struct cfs_hash *hs, struct cfs_hash_bd *bds, unsigned n, int excl) { struct cfs_hash_bucket *prev = NULL; - int i; + int i; /** * bds must be ascendantly ordered by bd->bd_bucket->hsb_index. @@ -729,7 +731,7 @@ cfs_hash_multi_bd_unlock(struct cfs_hash *hs, struct cfs_hash_bd *bds, unsigned n, int excl) { struct cfs_hash_bucket *prev = NULL; - int i; + int i; cfs_hash_for_each_bd(bds, n, i) { if (prev != bds[i].bd_bucket) { @@ -743,8 +745,8 @@ static struct hlist_node * cfs_hash_multi_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, unsigned n, const void *key) { - struct hlist_node *ehnode; - unsigned i; + struct hlist_node *ehnode; + unsigned i; cfs_hash_for_each_bd(bds, n, i) { ehnode = cfs_hash_bd_lookup_intent(hs, &bds[i], key, NULL, @@ -756,13 +758,13 @@ cfs_hash_multi_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, } static struct hlist_node * -cfs_hash_multi_bd_findadd_locked(struct cfs_hash *hs, - struct cfs_hash_bd *bds, unsigned n, const void *key, +cfs_hash_multi_bd_findadd_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, + unsigned n, const void *key, struct hlist_node *hnode, int noref) { - struct hlist_node *ehnode; - int intent; - unsigned i; + struct hlist_node *ehnode; + int intent; + unsigned i; LASSERT(hnode != NULL); intent = (!noref * CFS_HS_LOOKUP_MASK_REF) | CFS_HS_LOOKUP_IT_PEEK; @@ -777,7 +779,7 @@ cfs_hash_multi_bd_findadd_locked(struct cfs_hash *hs, if (i == 1) { /* only one bucket */ cfs_hash_bd_add_locked(hs, &bds[0], hnode); } else { - struct cfs_hash_bd mybd; + struct cfs_hash_bd mybd; cfs_hash_bd_get(hs, key, &mybd); cfs_hash_bd_add_locked(hs, &mybd, hnode); @@ -791,8 +793,8 @@ cfs_hash_multi_bd_finddel_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, unsigned n, const void *key, struct hlist_node *hnode) { - struct hlist_node *ehnode; - unsigned i; + struct hlist_node *ehnode; + unsigned int i; cfs_hash_for_each_bd(bds, n, i) { ehnode = cfs_hash_bd_lookup_intent(hs, &bds[i], key, hnode, @@ -806,7 +808,7 @@ cfs_hash_multi_bd_finddel_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, static void cfs_hash_bd_order(struct cfs_hash_bd *bd1, struct cfs_hash_bd *bd2) { - int rc; + int rc; if (bd2->bd_bucket == NULL) return; @@ -831,7 +833,8 @@ cfs_hash_bd_order(struct cfs_hash_bd *bd1, struct cfs_hash_bd *bd2) } void -cfs_hash_dual_bd_get(struct cfs_hash *hs, const void *key, struct cfs_hash_bd *bds) +cfs_hash_dual_bd_get(struct cfs_hash *hs, const void *key, + struct cfs_hash_bd *bds) { /* NB: caller should hold hs_lock.rw if REHASH is set */ cfs_hash_bd_from_key(hs, hs->hs_buckets, @@ -894,7 +897,7 @@ static void cfs_hash_buckets_free(struct cfs_hash_bucket **buckets, int bkt_size, int prev_size, int size) { - int i; + int i; for (i = prev_size; i < size; i++) { if (buckets[i] != NULL) @@ -914,7 +917,7 @@ cfs_hash_buckets_realloc(struct cfs_hash *hs, struct cfs_hash_bucket **old_bkts, unsigned int old_size, unsigned int new_size) { struct cfs_hash_bucket **new_bkts; - int i; + int i; LASSERT(old_size == 0 || old_bkts != NULL); @@ -932,7 +935,7 @@ cfs_hash_buckets_realloc(struct cfs_hash *hs, struct cfs_hash_bucket **old_bkts, for (i = old_size; i < new_size; i++) { struct hlist_head *hhead; - struct cfs_hash_bd bd; + struct cfs_hash_bd bd; LIBCFS_ALLOC(new_bkts[i], cfs_hash_bkt_size(hs)); if (new_bkts[i] == NULL) { @@ -969,7 +972,7 @@ cfs_hash_buckets_realloc(struct cfs_hash *hs, struct cfs_hash_bucket **old_bkts, * @max_bits - Maximum allowed hash table resize, in bits * @ops - Registered hash table operations * @flags - CFS_HASH_REHASH enable synamic hash resizing - * - CFS_HASH_SORT enable chained hash sort + * - CFS_HASH_SORT enable chained hash sort */ static int cfs_hash_rehash_worker(cfs_workitem_t *wi); @@ -977,10 +980,10 @@ static int cfs_hash_rehash_worker(cfs_workitem_t *wi); static int cfs_hash_dep_print(cfs_workitem_t *wi) { struct cfs_hash *hs = container_of(wi, struct cfs_hash, hs_dep_wi); - int dep; - int bkt; - int off; - int bits; + int dep; + int bkt; + int off; + int bits; spin_lock(&hs->hs_dep_lock); dep = hs->hs_dep_max; @@ -1031,7 +1034,7 @@ cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits, struct cfs_hash_ops *ops, unsigned flags) { struct cfs_hash *hs; - int len; + int len; CLASSERT(CFS_HASH_THETA_BITS < 15); @@ -1077,7 +1080,7 @@ cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits, hs->hs_max_bits = (__u8)max_bits; hs->hs_bkt_bits = (__u8)bkt_bits; - hs->hs_ops = ops; + hs->hs_ops = ops; hs->hs_extra_bytes = extra_bytes; hs->hs_rehash_bits = 0; cfs_wi_init(&hs->hs_rehash_wi, hs, cfs_hash_rehash_worker); @@ -1102,10 +1105,10 @@ EXPORT_SYMBOL(cfs_hash_create); static void cfs_hash_destroy(struct cfs_hash *hs) { - struct hlist_node *hnode; - struct hlist_node *pos; - struct cfs_hash_bd bd; - int i; + struct hlist_node *hnode; + struct hlist_node *pos; + struct cfs_hash_bd bd; + int i; LASSERT(hs != NULL); LASSERT(!cfs_hash_is_exiting(hs) && @@ -1223,8 +1226,8 @@ cfs_hash_rehash_inline(struct cfs_hash *hs) void cfs_hash_add(struct cfs_hash *hs, const void *key, struct hlist_node *hnode) { - struct cfs_hash_bd bd; - int bits; + struct cfs_hash_bd bd; + int bits; LASSERT(hlist_unhashed(hnode)); @@ -1248,8 +1251,8 @@ cfs_hash_find_or_add(struct cfs_hash *hs, const void *key, struct hlist_node *hnode, int noref) { struct hlist_node *ehnode; - struct cfs_hash_bd bds[2]; - int bits = 0; + struct cfs_hash_bd bds[2]; + int bits = 0; LASSERT(hlist_unhashed(hnode)); @@ -1261,7 +1264,7 @@ cfs_hash_find_or_add(struct cfs_hash *hs, const void *key, hnode, noref); cfs_hash_dual_bd_unlock(hs, bds, 1); - if (ehnode == hnode) /* new item added */ + if (ehnode == hnode) /* new item added */ bits = cfs_hash_rehash_bits(hs); cfs_hash_unlock(hs, 0); if (bits > 0) @@ -1276,7 +1279,8 @@ cfs_hash_find_or_add(struct cfs_hash *hs, const void *key, * Returns 0 on success or -EALREADY on key collisions. */ int -cfs_hash_add_unique(struct cfs_hash *hs, const void *key, struct hlist_node *hnode) +cfs_hash_add_unique(struct cfs_hash *hs, const void *key, + struct hlist_node *hnode) { return cfs_hash_find_or_add(hs, key, hnode, 1) != hnode ? -EALREADY : 0; @@ -1309,9 +1313,9 @@ EXPORT_SYMBOL(cfs_hash_findadd_unique); void * cfs_hash_del(struct cfs_hash *hs, const void *key, struct hlist_node *hnode) { - void *obj = NULL; - int bits = 0; - struct cfs_hash_bd bds[2]; + void *obj = NULL; + int bits = 0; + struct cfs_hash_bd bds[2]; cfs_hash_lock(hs, 0); cfs_hash_dual_bd_get_and_lock(hs, key, bds, 1); @@ -1364,9 +1368,9 @@ EXPORT_SYMBOL(cfs_hash_del_key); void * cfs_hash_lookup(struct cfs_hash *hs, const void *key) { - void *obj = NULL; - struct hlist_node *hnode; - struct cfs_hash_bd bds[2]; + void *obj = NULL; + struct hlist_node *hnode; + struct cfs_hash_bd bds[2]; cfs_hash_lock(hs, 0); cfs_hash_dual_bd_get_and_lock(hs, key, bds, 0); @@ -1383,7 +1387,8 @@ cfs_hash_lookup(struct cfs_hash *hs, const void *key) EXPORT_SYMBOL(cfs_hash_lookup); static void -cfs_hash_for_each_enter(struct cfs_hash *hs) { +cfs_hash_for_each_enter(struct cfs_hash *hs) +{ LASSERT(!cfs_hash_is_exiting(hs)); if (!cfs_hash_with_rehash(hs)) @@ -1408,7 +1413,8 @@ cfs_hash_for_each_enter(struct cfs_hash *hs) { } static void -cfs_hash_for_each_exit(struct cfs_hash *hs) { +cfs_hash_for_each_exit(struct cfs_hash *hs) +{ int remained; int bits; @@ -1439,14 +1445,15 @@ cfs_hash_for_each_exit(struct cfs_hash *hs) { */ static __u64 cfs_hash_for_each_tight(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, - void *data, int remove_safe) { - struct hlist_node *hnode; - struct hlist_node *pos; - struct cfs_hash_bd bd; - __u64 count = 0; - int excl = !!remove_safe; - int loop = 0; - int i; + void *data, int remove_safe) +{ + struct hlist_node *hnode; + struct hlist_node *pos; + struct cfs_hash_bd bd; + __u64 count = 0; + int excl = !!remove_safe; + int loop = 0; + int i; cfs_hash_for_each_enter(hs); @@ -1514,8 +1521,8 @@ void cfs_hash_cond_del(struct cfs_hash *hs, cfs_hash_cond_opt_cb_t func, void *data) { struct cfs_hash_cond_arg arg = { - .func = func, - .arg = data, + .func = func, + .arg = data, }; cfs_hash_for_each_tight(hs, cfs_hash_cond_del_locked, &arg, 1); @@ -1523,16 +1530,17 @@ cfs_hash_cond_del(struct cfs_hash *hs, cfs_hash_cond_opt_cb_t func, void *data) EXPORT_SYMBOL(cfs_hash_cond_del); void -cfs_hash_for_each(struct cfs_hash *hs, - cfs_hash_for_each_cb_t func, void *data) +cfs_hash_for_each(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, + void *data) { cfs_hash_for_each_tight(hs, func, data, 0); } EXPORT_SYMBOL(cfs_hash_for_each); void -cfs_hash_for_each_safe(struct cfs_hash *hs, - cfs_hash_for_each_cb_t func, void *data) { +cfs_hash_for_each_safe(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, + void *data) +{ cfs_hash_for_each_tight(hs, func, data, 1); } EXPORT_SYMBOL(cfs_hash_for_each_safe); @@ -1581,15 +1589,16 @@ EXPORT_SYMBOL(cfs_hash_size_get); */ static int cfs_hash_for_each_relax(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, - void *data) { + void *data) +{ struct hlist_node *hnode; struct hlist_node *tmp; - struct cfs_hash_bd bd; - __u32 version; - int count = 0; - int stop_on_change; - int rc; - int i; + struct cfs_hash_bd bd; + __u32 version; + int count = 0; + int stop_on_change; + int rc; + int i; stop_on_change = cfs_hash_with_rehash_key(hs) || !cfs_hash_with_no_itemref(hs) || @@ -1645,8 +1654,9 @@ cfs_hash_for_each_relax(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, } int -cfs_hash_for_each_nolock(struct cfs_hash *hs, - cfs_hash_for_each_cb_t func, void *data) { +cfs_hash_for_each_nolock(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, + void *data) +{ if (cfs_hash_with_no_lock(hs) || cfs_hash_with_rehash_key(hs) || !cfs_hash_with_no_itemref(hs)) @@ -1677,9 +1687,10 @@ EXPORT_SYMBOL(cfs_hash_for_each_nolock); * the required locking is in place to prevent concurrent insertions. */ int -cfs_hash_for_each_empty(struct cfs_hash *hs, - cfs_hash_for_each_cb_t func, void *data) { - unsigned i = 0; +cfs_hash_for_each_empty(struct cfs_hash *hs, cfs_hash_for_each_cb_t func, + void *data) +{ + unsigned i = 0; if (cfs_hash_with_no_lock(hs)) return -EOPNOTSUPP; @@ -1703,9 +1714,9 @@ void cfs_hash_hlist_for_each(struct cfs_hash *hs, unsigned hindex, cfs_hash_for_each_cb_t func, void *data) { - struct hlist_head *hhead; - struct hlist_node *hnode; - struct cfs_hash_bd bd; + struct hlist_head *hhead; + struct hlist_node *hnode; + struct cfs_hash_bd bd; cfs_hash_for_each_enter(hs); cfs_hash_lock(hs, 0); @@ -1721,7 +1732,7 @@ cfs_hash_hlist_for_each(struct cfs_hash *hs, unsigned hindex, break; } cfs_hash_bd_unlock(hs, &bd, 0); - out: +out: cfs_hash_unlock(hs, 0); cfs_hash_for_each_exit(hs); } @@ -1736,10 +1747,11 @@ EXPORT_SYMBOL(cfs_hash_hlist_for_each); */ void cfs_hash_for_each_key(struct cfs_hash *hs, const void *key, - cfs_hash_for_each_cb_t func, void *data) { - struct hlist_node *hnode; - struct cfs_hash_bd bds[2]; - unsigned i; + cfs_hash_for_each_cb_t func, void *data) +{ + struct hlist_node *hnode; + struct cfs_hash_bd bds[2]; + unsigned int i; cfs_hash_lock(hs, 0); @@ -1777,7 +1789,7 @@ EXPORT_SYMBOL(cfs_hash_for_each_key); void cfs_hash_rehash_cancel_locked(struct cfs_hash *hs) { - int i; + int i; /* need hold cfs_hash_lock(hs, 1) */ LASSERT(cfs_hash_with_rehash(hs) && @@ -1815,7 +1827,7 @@ EXPORT_SYMBOL(cfs_hash_rehash_cancel); int cfs_hash_rehash(struct cfs_hash *hs, int do_rehash) { - int rc; + int rc; LASSERT(cfs_hash_with_rehash(hs) && !cfs_hash_with_no_lock(hs)); @@ -1845,12 +1857,12 @@ EXPORT_SYMBOL(cfs_hash_rehash); static int cfs_hash_rehash_bd(struct cfs_hash *hs, struct cfs_hash_bd *old) { - struct cfs_hash_bd new; - struct hlist_head *hhead; - struct hlist_node *hnode; - struct hlist_node *pos; - void *key; - int c = 0; + struct cfs_hash_bd new; + struct hlist_head *hhead; + struct hlist_node *hnode; + struct hlist_node *pos; + void *key; + int c = 0; /* hold cfs_hash_lock(hs, 1), so don't need any bucket lock */ cfs_hash_bd_for_each_hlist(hs, old, hhead) { @@ -1876,17 +1888,17 @@ cfs_hash_rehash_bd(struct cfs_hash *hs, struct cfs_hash_bd *old) static int cfs_hash_rehash_worker(cfs_workitem_t *wi) { - struct cfs_hash *hs = container_of(wi, struct cfs_hash, hs_rehash_wi); + struct cfs_hash *hs = container_of(wi, struct cfs_hash, hs_rehash_wi); struct cfs_hash_bucket **bkts; - struct cfs_hash_bd bd; - unsigned int old_size; - unsigned int new_size; - int bsize; - int count = 0; - int rc = 0; - int i; + struct cfs_hash_bd bd; + unsigned int old_size; + unsigned int new_size; + int bsize; + int count = 0; + int rc = 0; + int i; - LASSERT (hs != NULL && cfs_hash_with_rehash(hs)); + LASSERT(hs != NULL && cfs_hash_with_rehash(hs)); cfs_hash_lock(hs, 0); LASSERT(cfs_hash_is_rehashing(hs)); @@ -1958,7 +1970,7 @@ cfs_hash_rehash_worker(cfs_workitem_t *wi) hs->hs_rehash_buckets = NULL; hs->hs_cur_bits = hs->hs_rehash_bits; - out: +out: hs->hs_rehash_bits = 0; if (rc == -ESRCH) /* never be scheduled again */ cfs_wi_exit(cfs_sched_rehash, wi); @@ -1986,9 +1998,9 @@ cfs_hash_rehash_worker(cfs_workitem_t *wi) void cfs_hash_rehash_key(struct cfs_hash *hs, const void *old_key, void *new_key, struct hlist_node *hnode) { - struct cfs_hash_bd bds[3]; - struct cfs_hash_bd old_bds[2]; - struct cfs_hash_bd new_bd; + struct cfs_hash_bd bds[3]; + struct cfs_hash_bd old_bds[2]; + struct cfs_hash_bd new_bd; LASSERT(!hlist_unhashed(hnode)); @@ -2054,12 +2066,12 @@ cfs_hash_full_nbkt(struct cfs_hash *hs) void cfs_hash_debug_str(struct cfs_hash *hs, struct seq_file *m) { - int dist[8] = { 0, }; - int maxdep = -1; - int maxdepb = -1; - int total = 0; - int theta; - int i; + int dist[8] = { 0, }; + int maxdep = -1; + int maxdepb = -1; + int total = 0; + int theta; + int i; cfs_hash_lock(hs, 0); theta = __cfs_hash_theta(hs); @@ -2085,11 +2097,11 @@ void cfs_hash_debug_str(struct cfs_hash *hs, struct seq_file *m) * If you hash function results in a non-uniform hash the will * be observable by outlier bucks in the distribution histogram. * - * Uniform hash distribution: 128/128/0/0/0/0/0/0 - * Non-Uniform hash distribution: 128/125/0/0/0/0/2/1 + * Uniform hash distribution: 128/128/0/0/0/0/0/0 + * Non-Uniform hash distribution: 128/125/0/0/0/0/2/1 */ for (i = 0; i < cfs_hash_full_nbkt(hs); i++) { - struct cfs_hash_bd bd; + struct cfs_hash_bd bd; bd.bd_bucket = cfs_hash_full_bkts(hs)[i]; cfs_hash_bd_lock(hs, &bd, 0); -- 1.7.1 From stan.smith at intel.com Mon Nov 2 19:05:30 2015 From: stan.smith at intel.com (Smith, Stan) Date: Mon, 2 Nov 2015 19:05:30 +0000 Subject: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 Message-ID: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FDB8@ORSMSX105.amr.corp.intel.com> Hello, I'm currently unable to search the lustre-devel archives + 1st post to this list. Having read lustre documentation I find only references to building lustre server for stock 'distro' kernels. Does someone have suggestions on how to patch ldiskfs for a kernel.org kernel.....specifically weeding out RHEL/SLES/* distro FS enhancements from a kernel.org base? I have written a Reliable Datagram LND which passes the LNet selftests (client lustre build) now entering the world of lustre server building. Patching the kernel.org kernel for lustre server was fairly straightforward, creating the patch series for ldiskfs is another story. Thanks, Stan. -------------- next part -------------- An HTML attachment was scrubbed... URL: From paf at cray.com Mon Nov 2 19:13:15 2015 From: paf at cray.com (Patrick Farrell) Date: Mon, 2 Nov 2015 13:13:15 -0600 Subject: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 In-Reply-To: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FDB8@ORSMSX105.amr.corp.intel.com> References: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FDB8@ORSMSX105.amr.corp.intel.com> Message-ID: <5637B5CB.9090106@cray.com> Stan, Why not work with the CentOS 7 kernel on the server anyway? Is something your LND needs not available? CentOS 7 is freely available and isn't far off in terms of kernel version from 3.12. You may be hard pressed to get useful advice on changing the ldiskfs patch series, that has the potential to be a pretty big job. Regards, - Patrick Farrell On 11/02/2015 01:05 PM, Smith, Stan wrote: > > Hello, > > I'm currently unable to search the lustre-devel archives + 1^st post > to this list. > > Having read lustre documentation I find only references to building > lustre server for stock 'distro' kernels. > > Does someone have suggestions on how to patch ldiskfs for a kernel.org > kernel.....specifically weeding out RHEL/SLES/* distro FS enhancements > from a kernel.org base? > > I have written a Reliable Datagram LND which passes the LNet selftests > (client lustre build) now entering the world of lustre server building. > > Patching the kernel.org kernel for lustre server was fairly > straightforward, creating the patch series for ldiskfs is another story. > > Thanks, > > Stan. > > > > _______________________________________________ > lustre-devel mailing list > lustre-devel at lists.lustre.org > http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From bevans at cray.com Mon Nov 2 19:25:54 2015 From: bevans at cray.com (Ben Evans) Date: Mon, 2 Nov 2015 19:25:54 +0000 Subject: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 In-Reply-To: <5637B5CB.9090106@cray.com> References: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FDB8@ORSMSX105.amr.corp.intel.com> <5637B5CB.9090106@cray.com> Message-ID: Using ZFS as a backing filesystem may be a simpler way to go here if you want to stay with kernel.org. The lustre server + ZFS is patchless, and if you’re writing a new LND, you probably don’t care about the backing filesystem anyway. -Ben Evans From: lustre-devel > on behalf of Patrick Farrell > Date: Monday, November 2, 2015 at 3:13 PM To: "lustre-devel at lists.lustre.org" > Subject: Re: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 Stan, Why not work with the CentOS 7 kernel on the server anyway? Is something your LND needs not available? CentOS 7 is freely available and isn't far off in terms of kernel version from 3.12. You may be hard pressed to get useful advice on changing the ldiskfs patch series, that has the potential to be a pretty big job. Regards, - Patrick Farrell On 11/02/2015 01:05 PM, Smith, Stan wrote: Hello, I’m currently unable to search the lustre-devel archives + 1st post to this list. Having read lustre documentation I find only references to building lustre server for stock ‘distro’ kernels. Does someone have suggestions on how to patch ldiskfs for a kernel.org kernel…..specifically weeding out RHEL/SLES/* distro FS enhancements from a kernel.org base? I have written a Reliable Datagram LND which passes the LNet selftests (client lustre build) now entering the world of lustre server building. Patching the kernel.org kernel for lustre server was fairly straightforward, creating the patch series for ldiskfs is another story. Thanks, Stan. _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.orghttp://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.smith at intel.com Mon Nov 2 19:35:56 2015 From: stan.smith at intel.com (Smith, Stan) Date: Mon, 2 Nov 2015 19:35:56 +0000 Subject: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 In-Reply-To: <5637B5CB.9090106@cray.com> References: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FDB8@ORSMSX105.amr.corp.intel.com> <5637B5CB.9090106@cray.com> Message-ID: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FE29@ORSMSX105.amr.corp.intel.com> From: lustre-devel [mailto:lustre-devel-bounces at lists.lustre.org] On Behalf Of Patrick Farrell Sent: Monday, November 2, 2015 11:13 AM To: lustre-devel at lists.lustre.org Subject: Re: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 Stan, Why not work with the CentOS 7 kernel on the server anyway? Is something your LND needs not available? CentOS 7 is freely available and isn't far off in terms of kernel version from 3.12. Yes -I'm somewhat stuck on RHEL 6.x series as I use warewulf as a cluster provisioning system (diskless compute nodes), so far have not found a functional warewulf for RHEL7. I did choose linux-3.12.39 as a kernel base believing it to be somewhat close to RHEL7; although I'm finding this to less so than hoped for.... Additionally the RD drivers I'm using have not been ported to RHEL7; In examining lustre-2_7.62 I found support for sles12 based on 3.12.39 kernel.; thinking the lustre patches would be close... So now I'm wedged between RHEL7 ldiskfs patches and SLES12 ldiskfs patches - figure out distro specific enhancements vs lustre enhancements. You may be hard pressed to get useful advice on changing the ldiskfs patch series, that has the potential to be a pretty big job. I'm starting to understand the magnitude of the ldiskfs task....... I'm ignorant about zfs*, would zfs be a better (read that as path-of-least-resistance) approach ? What are the zfs pitfalls? Thanks, Stan. Regards, - Patrick Farrell On 11/02/2015 01:05 PM, Smith, Stan wrote: Hello, I'm currently unable to search the lustre-devel archives + 1st post to this list. Having read lustre documentation I find only references to building lustre server for stock 'distro' kernels. Does someone have suggestions on how to patch ldiskfs for a kernel.org kernel.....specifically weeding out RHEL/SLES/* distro FS enhancements from a kernel.org base? I have written a Reliable Datagram LND which passes the LNet selftests (client lustre build) now entering the world of lustre server building. Patching the kernel.org kernel for lustre server was fairly straightforward, creating the patch series for ldiskfs is another story. Thanks, Stan. _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.org http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From paf at cray.com Mon Nov 2 19:45:37 2015 From: paf at cray.com (Patrick Farrell) Date: Mon, 2 Nov 2015 13:45:37 -0600 Subject: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 In-Reply-To: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FE29@ORSMSX105.amr.corp.intel.com> References: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FDB8@ORSMSX105.amr.corp.intel.com> <5637B5CB.9090106@cray.com> <2DDE0F15AAFF91448E6F813C42EF4CBEA195FE29@ORSMSX105.amr.corp.intel.com> Message-ID: <5637BD61.8060206@cray.com> For ZFS: The pitfall is primarily that it's less familiar than ldiskfs, which basically uses the standard Linux fs tools, like ext. ZFS is its own world, which will probably have a learning curve for someone who has not used it before, and it must be built for the version of the kernel you're interested in. But, Ben is right, that's likely to be easier than porting ldiskfs. - Patrick On 11/02/2015 01:35 PM, Smith, Stan wrote: > > *From:*lustre-devel [mailto:lustre-devel-bounces at lists.lustre.org] *On > Behalf Of *Patrick Farrell > *Sent:* Monday, November 2, 2015 11:13 AM > *To:* lustre-devel at lists.lustre.org > *Subject:* Re: [lustre-devel] porting Lustre server to RHEL6.7 distro > running a kernel.org linux-3.12.39 > > Stan, > > Why not work with the CentOS 7 kernel on the server anyway? Is > something your LND needs not available? CentOS 7 is freely available > and isn't far off in terms of kernel version from 3.12. > > Yes --I'm somewhat stuck on RHEL 6.x series as I use warewulf as a > cluster provisioning system (diskless compute nodes), so far have not > found a functional warewulf for RHEL7. > > I did choose linux-3.12.39 as a kernel base believing it to be > somewhat close to RHEL7; although I'm finding this to less so than > hoped for.... > > Additionally the RD drivers I'm using have not been ported to RHEL7; > > In examining lustre-2_7.62 I found support for sles12 based on 3.12.39 > kernel.; thinking the lustre patches would be close... > > So now I'm wedged between RHEL7 ldiskfs patches and SLES12 ldiskfs > patches -- figure out distro specific enhancements vs lustre enhancements. > > You may be hard pressed to get useful advice on changing the ldiskfs > patch series, that has the potential to be a pretty big job. > > I'm starting to understand the magnitude of the ldiskfs task....... > > I'm ignorant about zfs*, would zfs be a better (read that as > path-of-least-resistance) approach ? What are the zfs pitfalls? > > Thanks, > > Stan. > > > > Regards, > - Patrick Farrell > > On 11/02/2015 01:05 PM, Smith, Stan wrote: > > Hello, > > I'm currently unable to search the lustre-devel archives + 1^st > post to this list. > > Having read lustre documentation I find only references to > building lustre server for stock 'distro' kernels. > > Does someone have suggestions on how to patch ldiskfs for a > kernel.org kernel.....specifically weeding out RHEL/SLES/* distro > FS enhancements from a kernel.org base? > > I have written a Reliable Datagram LND which passes the LNet > selftests (client lustre build) now entering the world of lustre > server building. > > Patching the kernel.org kernel for lustre server was fairly > straightforward, creating the patch series for ldiskfs is another > story. > > Thanks, > > Stan. > > > > > _______________________________________________ > > lustre-devel mailing list > > lustre-devel at lists.lustre.org > > http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rpwagner at sdsc.edu Mon Nov 2 20:25:01 2015 From: rpwagner at sdsc.edu (Rick Wagner) Date: Mon, 2 Nov 2015 20:25:01 +0000 Subject: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 In-Reply-To: <5637BD61.8060206@cray.com> References: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FDB8@ORSMSX105.amr.corp.intel.com> <5637B5CB.9090106@cray.com> <2DDE0F15AAFF91448E6F813C42EF4CBEA195FE29@ORSMSX105.amr.corp.intel.com> <5637BD61.8060206@cray.com> Message-ID: We’ve run ZFS-backed Lustre servers using a patchless (i.e., without ldiskfs) Linux 3 kernel under CentOS 6. While I don’t recommend this for everyone I can say that the mechanics of building the kernel modules (ZFS and Lustre) and standing up the file system all worked well. We’re looking to move back to a stock CentOS 6 kernel, but are sticking with the patchless model. If you’re willing to try ZFS I suspect the build will be fine, and then you should test test test. I’ve included the outline of commands we use to build our server RPMs. You’ll want to adjust the versions of SPL, ZFS, & Lustre, along with the --with-linux and --with-linux-config parameters. I apologize for any typos and subsequent frustration. What level of dependency hell you find yourself in is is largely dependent on your choice of distro. —Rick git clone https://github.com/zfsonlinux/spl.git cd spl git checkout spl-0.6.5.3 ./autogen.sh ./configure make pkg rpm -ivh *x86_64.rpm cd ../ git clone https://github.com/zfsonlinux/zfs.git cd zfs git checkout zfs-0.6.5.3 ./autogen.sh ./configure make pkg rpm -ivh *x86_64.rpm cd ../ git clone http://git.whamcloud.com/fs/lustre-release.git cd lustre-release git checkout 2.7.62 sh autogen.sh ./configure --with-zfs=/usr/src/zfs-0.6.5.3 --with-spl=/usr/src/spl-0.6.5.3 --with-linux=/usr/src/linux-3.10 --without-ldiskfs --with-linux-config=/boot/config-3.10.73-1.el6.elrepo.x86_64 --with-o2ib=no make rpms On Nov 2, 2015, at 11:45 AM, Patrick Farrell > wrote: For ZFS: The pitfall is primarily that it's less familiar than ldiskfs, which basically uses the standard Linux fs tools, like ext. ZFS is its own world, which will probably have a learning curve for someone who has not used it before, and it must be built for the version of the kernel you're interested in. But, Ben is right, that's likely to be easier than porting ldiskfs. - Patrick On 11/02/2015 01:35 PM, Smith, Stan wrote: From: lustre-devel [mailto:lustre-devel-bounces at lists.lustre.org] On Behalf Of Patrick Farrell Sent: Monday, November 2, 2015 11:13 AM To: lustre-devel at lists.lustre.org Subject: Re: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 Stan, Why not work with the CentOS 7 kernel on the server anyway? Is something your LND needs not available? CentOS 7 is freely available and isn't far off in terms of kernel version from 3.12. Yes –I’m somewhat stuck on RHEL 6.x series as I use warewulf as a cluster provisioning system (diskless compute nodes), so far have not found a functional warewulf for RHEL7. I did choose linux-3.12.39 as a kernel base believing it to be somewhat close to RHEL7; although I’m finding this to less so than hoped for…. Additionally the RD drivers I’m using have not been ported to RHEL7; In examining lustre-2_7.62 I found support for sles12 based on 3.12.39 kernel.; thinking the lustre patches would be close… So now I’m wedged between RHEL7 ldiskfs patches and SLES12 ldiskfs patches – figure out distro specific enhancements vs lustre enhancements. You may be hard pressed to get useful advice on changing the ldiskfs patch series, that has the potential to be a pretty big job. I’m starting to understand the magnitude of the ldiskfs task……. I’m ignorant about zfs*, would zfs be a better (read that as path-of-least-resistance) approach ? What are the zfs pitfalls? Thanks, Stan. Regards, - Patrick Farrell On 11/02/2015 01:05 PM, Smith, Stan wrote: Hello, I’m currently unable to search the lustre-devel archives + 1st post to this list. Having read lustre documentation I find only references to building lustre server for stock ‘distro’ kernels. Does someone have suggestions on how to patch ldiskfs for a kernel.org kernel…..specifically weeding out RHEL/SLES/* distro FS enhancements from a kernel.org base? I have written a Reliable Datagram LND which passes the LNet selftests (client lustre build) now entering the world of lustre server building. Patching the kernel.org kernel for lustre server was fairly straightforward, creating the patch series for ldiskfs is another story. Thanks, Stan. _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.org http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.org http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.smith at intel.com Mon Nov 2 20:46:10 2015 From: stan.smith at intel.com (Smith, Stan) Date: Mon, 2 Nov 2015 20:46:10 +0000 Subject: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 In-Reply-To: References: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FDB8@ORSMSX105.amr.corp.intel.com> <5637B5CB.9090106@cray.com> Message-ID: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FEB0@ORSMSX105.amr.corp.intel.com> From: lustre-devel [mailto:lustre-devel-bounces at lists.lustre.org] On Behalf Of Ben Evans Sent: Monday, November 2, 2015 11:26 AM To: Patrick Farrell ; lustre-devel at lists.lustre.org Subject: Re: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 Using ZFS as a backing filesystem may be a simpler way to go here if you want to stay with kernel.org. The lustre server + ZFS is patchless, and if you're writing a new LND, you probably don't care about the backing filesystem anyway. You are 100% spot-on, at this juncture in the LND development, I don't really care so much about the backing filesystem; whatever builds/works such that I can continue LND testing in the client/server environment. I suspect a large step between LNet selftests and full-on LFS. It's Monday after a time zone change, hence a small clarification on your statement 'The lustre server + ZFS is patchless'. By patchless you saying the lustre source kernel patches are not required when using ZFS? Just to be crystal-clear. Stan. -Ben Evans From: lustre-devel > on behalf of Patrick Farrell > Date: Monday, November 2, 2015 at 3:13 PM To: "lustre-devel at lists.lustre.org" > Subject: Re: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 Stan, Why not work with the CentOS 7 kernel on the server anyway? Is something your LND needs not available? CentOS 7 is freely available and isn't far off in terms of kernel version from 3.12. You may be hard pressed to get useful advice on changing the ldiskfs patch series, that has the potential to be a pretty big job. Regards, - Patrick Farrell On 11/02/2015 01:05 PM, Smith, Stan wrote: Hello, I'm currently unable to search the lustre-devel archives + 1st post to this list. Having read lustre documentation I find only references to building lustre server for stock 'distro' kernels. Does someone have suggestions on how to patch ldiskfs for a kernel.org kernel.....specifically weeding out RHEL/SLES/* distro FS enhancements from a kernel.org base? I have written a Reliable Datagram LND which passes the LNet selftests (client lustre build) now entering the world of lustre server building. Patching the kernel.org kernel for lustre server was fairly straightforward, creating the patch series for ldiskfs is another story. Thanks, Stan. _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.orghttp://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From bevans at cray.com Mon Nov 2 20:49:24 2015 From: bevans at cray.com (Ben Evans) Date: Mon, 2 Nov 2015 20:49:24 +0000 Subject: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 In-Reply-To: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FEB0@ORSMSX105.amr.corp.intel.com> References: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FDB8@ORSMSX105.amr.corp.intel.com> <5637B5CB.9090106@cray.com> <2DDE0F15AAFF91448E6F813C42EF4CBEA195FEB0@ORSMSX105.amr.corp.intel.com> Message-ID: By patchless, I mean that neither Lustre nor ZFS need to patch the Linux kernel in order to work. With ldiskfs, some patching of the kernel needs to happen, which is where you’re running into trouble. I’m not going to say that it will be pain-free, just that you’ll remove a potentially large pain point in your dev process. -Ben Evans From: "Smith, Stan" > Date: Monday, November 2, 2015 at 3:46 PM To: Ben Evans >, Patrick Farrell >, "lustre-devel at lists.lustre.org" > Subject: RE: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 From: lustre-devel [mailto:lustre-devel-bounces at lists.lustre.org] On Behalf Of Ben Evans Sent: Monday, November 2, 2015 11:26 AM To: Patrick Farrell >; lustre-devel at lists.lustre.org Subject: Re: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 Using ZFS as a backing filesystem may be a simpler way to go here if you want to stay with kernel.org. The lustre server + ZFS is patchless, and if you’re writing a new LND, you probably don’t care about the backing filesystem anyway. You are 100% spot-on, at this juncture in the LND development, I don’t really care so much about the backing filesystem; whatever builds/works such that I can continue LND testing in the client/server environment. I suspect a large step between LNet selftests and full-on LFS. It’s Monday after a time zone change, hence a small clarification on your statement ‘The lustre server + ZFS is patchless‘. By patchless you saying the lustre source kernel patches are not required when using ZFS? Just to be crystal-clear. Stan. -Ben Evans From: lustre-devel > on behalf of Patrick Farrell > Date: Monday, November 2, 2015 at 3:13 PM To: "lustre-devel at lists.lustre.org" > Subject: Re: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 Stan, Why not work with the CentOS 7 kernel on the server anyway? Is something your LND needs not available? CentOS 7 is freely available and isn't far off in terms of kernel version from 3.12. You may be hard pressed to get useful advice on changing the ldiskfs patch series, that has the potential to be a pretty big job. Regards, - Patrick Farrell On 11/02/2015 01:05 PM, Smith, Stan wrote: Hello, I’m currently unable to search the lustre-devel archives + 1st post to this list. Having read lustre documentation I find only references to building lustre server for stock ‘distro’ kernels. Does someone have suggestions on how to patch ldiskfs for a kernel.org kernel…..specifically weeding out RHEL/SLES/* distro FS enhancements from a kernel.org base? I have written a Reliable Datagram LND which passes the LNet selftests (client lustre build) now entering the world of lustre server building. Patching the kernel.org kernel for lustre server was fairly straightforward, creating the patch series for ldiskfs is another story. Thanks, Stan. _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.orghttp://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From stan.smith at intel.com Mon Nov 2 20:52:06 2015 From: stan.smith at intel.com (Smith, Stan) Date: Mon, 2 Nov 2015 20:52:06 +0000 Subject: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 In-Reply-To: References: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FDB8@ORSMSX105.amr.corp.intel.com> <5637B5CB.9090106@cray.com> <2DDE0F15AAFF91448E6F813C42EF4CBEA195FE29@ORSMSX105.amr.corp.intel.com> <5637BD61.8060206@cray.com> Message-ID: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FECE@ORSMSX105.amr.corp.intel.com> From: Rick Wagner [mailto:rpwagner at sdsc.edu] Sent: Monday, November 2, 2015 12:25 PM To: Patrick Farrell Cc: Smith, Stan ; lustre-devel at lists.lustre.org Subject: Re: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 We've run ZFS-backed Lustre servers using a patchless (i.e., without ldiskfs) Linux 3 kernel under CentOS 6. While I don't recommend this for everyone I can say that the mechanics of building the kernel modules (ZFS and Lustre) and standing up the file system all worked well. We're looking to move back to a stock CentOS 6 kernel, but are sticking with the patchless model. If you're willing to try ZFS I suspect the build will be fine, and then you should test test test. I've included the outline of commands we use to build our server RPMs. You'll want to adjust the versions of SPL, ZFS, & Lustre, along with the --with-linux and --with-linux-config parameters. I apologize for any typos and subsequent frustration. What level of dependency hell you find yourself in is is largely dependent on your choice of distro. Wow - A great assist! Thank you much!! And thank you Patrick, Ben & Rick for the timely sage advice on making forward progress in the land of lustre. Let the ZFS adventure begin......will write if I find work... ;-) Stan. -Rick git clone https://github.com/zfsonlinux/spl.git cd spl git checkout spl-0.6.5.3 ./autogen.sh ./configure make pkg rpm -ivh *x86_64.rpm cd ../ git clone https://github.com/zfsonlinux/zfs.git cd zfs git checkout zfs-0.6.5.3 ./autogen.sh ./configure make pkg rpm -ivh *x86_64.rpm cd ../ git clone http://git.whamcloud.com/fs/lustre-release.git cd lustre-release git checkout 2.7.62 sh autogen.sh ./configure --with-zfs=/usr/src/zfs-0.6.5.3 --with-spl=/usr/src/spl-0.6.5.3 --with-linux=/usr/src/linux-3.10 --without-ldiskfs --with-linux-config=/boot/config-3.10.73-1.el6.elrepo.x86_64 --with-o2ib=no make rpms On Nov 2, 2015, at 11:45 AM, Patrick Farrell > wrote: For ZFS: The pitfall is primarily that it's less familiar than ldiskfs, which basically uses the standard Linux fs tools, like ext. ZFS is its own world, which will probably have a learning curve for someone who has not used it before, and it must be built for the version of the kernel you're interested in. But, Ben is right, that's likely to be easier than porting ldiskfs. - Patrick On 11/02/2015 01:35 PM, Smith, Stan wrote: From: lustre-devel [mailto:lustre-devel-bounces at lists.lustre.org] On Behalf Of Patrick Farrell Sent: Monday, November 2, 2015 11:13 AM To: lustre-devel at lists.lustre.org Subject: Re: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 Stan, Why not work with the CentOS 7 kernel on the server anyway? Is something your LND needs not available? CentOS 7 is freely available and isn't far off in terms of kernel version from 3.12. Yes -I'm somewhat stuck on RHEL 6.x series as I use warewulf as a cluster provisioning system (diskless compute nodes), so far have not found a functional warewulf for RHEL7. I did choose linux-3.12.39 as a kernel base believing it to be somewhat close to RHEL7; although I'm finding this to less so than hoped for.... Additionally the RD drivers I'm using have not been ported to RHEL7; In examining lustre-2_7.62 I found support for sles12 based on 3.12.39 kernel.; thinking the lustre patches would be close... So now I'm wedged between RHEL7 ldiskfs patches and SLES12 ldiskfs patches - figure out distro specific enhancements vs lustre enhancements. You may be hard pressed to get useful advice on changing the ldiskfs patch series, that has the potential to be a pretty big job. I'm starting to understand the magnitude of the ldiskfs task....... I'm ignorant about zfs*, would zfs be a better (read that as path-of-least-resistance) approach ? What are the zfs pitfalls? Thanks, Stan. Regards, - Patrick Farrell On 11/02/2015 01:05 PM, Smith, Stan wrote: Hello, I'm currently unable to search the lustre-devel archives + 1st post to this list. Having read lustre documentation I find only references to building lustre server for stock 'distro' kernels. Does someone have suggestions on how to patch ldiskfs for a kernel.org kernel.....specifically weeding out RHEL/SLES/* distro FS enhancements from a kernel.org base? I have written a Reliable Datagram LND which passes the LNet selftests (client lustre build) now entering the world of lustre server building. Patching the kernel.org kernel for lustre server was fairly straightforward, creating the patch series for ldiskfs is another story. Thanks, Stan. _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.org http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.org http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org -------------- next part -------------- An HTML attachment was scrubbed... URL: From colin.faber at seagate.com Mon Nov 2 21:07:28 2015 From: colin.faber at seagate.com (Colin Faber) Date: Mon, 2 Nov 2015 14:07:28 -0700 Subject: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 In-Reply-To: References: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FDB8@ORSMSX105.amr.corp.intel.com> <5637B5CB.9090106@cray.com> <2DDE0F15AAFF91448E6F813C42EF4CBEA195FE29@ORSMSX105.amr.corp.intel.com> <5637BD61.8060206@cray.com> Message-ID: Hi Rick, This is fantastic, if you haven't already would you mind adding this to the wiki.lustre.org wiki site? -cf On Mon, Nov 2, 2015 at 1:25 PM, Rick Wagner wrote: > We’ve run ZFS-backed Lustre servers using a patchless (i.e., without > ldiskfs) Linux 3 kernel under CentOS 6. While I don’t recommend this for > everyone I can say that the mechanics of building the kernel modules (ZFS > and Lustre) and standing up the file system all worked well. We’re looking > to move back to a stock CentOS 6 kernel, but are sticking with the > patchless model. If you’re willing to try ZFS I suspect the build will be > fine, and then you should test test test. > > I’ve included the outline of commands we use to build our server RPMs. > You’ll want to adjust the versions of SPL, ZFS, & Lustre, along with the > --with-linux and --with-linux-config parameters. I apologize for any typos > and subsequent frustration. What level of dependency hell you find yourself > in is is largely dependent on your choice of distro. > > —Rick > > git clone https://github.com/zfsonlinux/spl.git > > cd spl > git checkout spl-0.6.5.3 > ./autogen.sh > ./configure > make pkg > rpm -ivh *x86_64.rpm > > cd ../ > git clone https://github.com/zfsonlinux/zfs.git > > cd zfs > git checkout zfs-0.6.5.3 > ./autogen.sh > ./configure > make pkg > rpm -ivh *x86_64.rpm > > cd ../ > git clone http://git.whamcloud.com/fs/lustre-release.git > > cd lustre-release > git checkout 2.7.62 > sh autogen.sh > ./configure --with-zfs=/usr/src/zfs-0.6.5.3 > --with-spl=/usr/src/spl-0.6.5.3 --with-linux=/usr/src/linux-3.10 > --without-ldiskfs > --with-linux-config=/boot/config-3.10.73-1.el6.elrepo.x86_64 --with-o2ib=no > make rpms > > > On Nov 2, 2015, at 11:45 AM, Patrick Farrell wrote: > > For ZFS: > > The pitfall is primarily that it's less familiar than ldiskfs, which > basically uses the standard Linux fs tools, like ext. ZFS is its own > world, which will probably have a learning curve for someone who has not > used it before, and it must be built for the version of the kernel you're > interested in. > > But, Ben is right, that's likely to be easier than porting ldiskfs. > > - Patrick > > On 11/02/2015 01:35 PM, Smith, Stan wrote: > > *From:* lustre-devel [mailto:lustre-devel-bounces at lists.lustre.org > ] *On Behalf Of *Patrick Farrell > *Sent:* Monday, November 2, 2015 11:13 AM > *To:* lustre-devel at lists.lustre.org > *Subject:* Re: [lustre-devel] porting Lustre server to RHEL6.7 distro > running a kernel.org > > linux-3.12.39 > > Stan, > > Why not work with the CentOS 7 kernel on the server anyway? Is something > your LND needs not available? CentOS 7 is freely available and isn't far > off in terms of kernel version from 3.12. > > Yes –I’m somewhat stuck on RHEL 6.x series as I use warewulf as a cluster > provisioning system (diskless compute nodes), so far have not found a > functional warewulf for RHEL7. > I did choose linux-3.12.39 as a kernel base believing it to be somewhat > close to RHEL7; although I’m finding this to less so than hoped for…. > Additionally the RD drivers I’m using have not been ported to RHEL7; > In examining lustre-2_7.62 I found support for sles12 based on 3.12.39 > kernel.; thinking the lustre patches would be close… > So now I’m wedged between RHEL7 ldiskfs patches and SLES12 ldiskfs patches > – figure out distro specific enhancements vs lustre enhancements. > > You may be hard pressed to get useful advice on changing the ldiskfs patch > series, that has the potential to be a pretty big job. > > I’m starting to understand the magnitude of the ldiskfs task……. > > I’m ignorant about zfs*, would zfs be a better (read that as > path-of-least-resistance) approach ? What are the zfs pitfalls? > > Thanks, > > Stan. > > > Regards, > - Patrick Farrell > On 11/02/2015 01:05 PM, Smith, Stan wrote: > > Hello, > I’m currently unable to search the lustre-devel archives + 1st post to > this list. > > Having read lustre documentation I find only references to building lustre > server for stock ‘distro’ kernels. > > Does someone have suggestions on how to patch ldiskfs for a kernel.org > > kernel…..specifically weeding out RHEL/SLES/* distro FS enhancements from a > kernel.org > > base? > > I have written a Reliable Datagram LND which passes the LNet selftests > (client lustre build) now entering the world of lustre server building. > Patching the kernel.org > > kernel for lustre server was fairly straightforward, creating the patch > series for ldiskfs is another story. > > Thanks, > > Stan. > > > > _______________________________________________ > > lustre-devel mailing list > > lustre-devel at lists.lustre.org > > http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org > > > > > _______________________________________________ > lustre-devel mailing list > lustre-devel at lists.lustre.org > http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org > > > > > _______________________________________________ > lustre-devel mailing list > lustre-devel at lists.lustre.org > > https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.lustre.org_listinfo.cgi_lustre-2Ddevel-2Dlustre.org&d=CwICAg&c=IGDlg0lD0b-nebmJJ0Kp8A&r=x9pM59OqndbWw-lPPdr8w1Vud29EZigcxcNkz0uw5oQ&m=CjVqTjggbFA1F-2WDW87aU9UmdOsvkSSdbrx6n_jVLg&s=A6GC4M4a2RZsUUrt-VAKwS0MmRRdPLYYgVDeJ5RDF7Q&e= > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rpwagner at sdsc.edu Mon Nov 2 21:24:10 2015 From: rpwagner at sdsc.edu (Rick Wagner) Date: Mon, 2 Nov 2015 21:24:10 +0000 Subject: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 In-Reply-To: References: <2DDE0F15AAFF91448E6F813C42EF4CBEA195FDB8@ORSMSX105.amr.corp.intel.com> <5637B5CB.9090106@cray.com> <2DDE0F15AAFF91448E6F813C42EF4CBEA195FE29@ORSMSX105.amr.corp.intel.com> <5637BD61.8060206@cray.com> Message-ID: Thanks, Colin. Let me do a sanity check on the process and I’ll see about updating the Lustre with ZFS page [1]. —Rick [1] http://wiki.lustre.org/Lustre_with_ZFS_Install On Nov 2, 2015, at 1:07 PM, Colin Faber > wrote: Hi Rick, This is fantastic, if you haven't already would you mind adding this to the wiki.lustre.org wiki site? -cf On Mon, Nov 2, 2015 at 1:25 PM, Rick Wagner > wrote: We’ve run ZFS-backed Lustre servers using a patchless (i.e., without ldiskfs) Linux 3 kernel under CentOS 6. While I don’t recommend this for everyone I can say that the mechanics of building the kernel modules (ZFS and Lustre) and standing up the file system all worked well. We’re looking to move back to a stock CentOS 6 kernel, but are sticking with the patchless model. If you’re willing to try ZFS I suspect the build will be fine, and then you should test test test. I’ve included the outline of commands we use to build our server RPMs. You’ll want to adjust the versions of SPL, ZFS, & Lustre, along with the --with-linux and --with-linux-config parameters. I apologize for any typos and subsequent frustration. What level of dependency hell you find yourself in is is largely dependent on your choice of distro. —Rick git clone https://github.com/zfsonlinux/spl.git cd spl git checkout spl-0.6.5.3 ./autogen.sh ./configure make pkg rpm -ivh *x86_64.rpm cd ../ git clone https://github.com/zfsonlinux/zfs.git cd zfs git checkout zfs-0.6.5.3 ./autogen.sh ./configure make pkg rpm -ivh *x86_64.rpm cd ../ git clone http://git.whamcloud.com/fs/lustre-release.git cd lustre-release git checkout 2.7.62 sh autogen.sh ./configure --with-zfs=/usr/src/zfs-0.6.5.3 --with-spl=/usr/src/spl-0.6.5.3 --with-linux=/usr/src/linux-3.10 --without-ldiskfs --with-linux-config=/boot/config-3.10.73-1.el6.elrepo.x86_64 --with-o2ib=no make rpms On Nov 2, 2015, at 11:45 AM, Patrick Farrell > wrote: For ZFS: The pitfall is primarily that it's less familiar than ldiskfs, which basically uses the standard Linux fs tools, like ext. ZFS is its own world, which will probably have a learning curve for someone who has not used it before, and it must be built for the version of the kernel you're interested in. But, Ben is right, that's likely to be easier than porting ldiskfs. - Patrick On 11/02/2015 01:35 PM, Smith, Stan wrote: From: lustre-devel [mailto:lustre-devel-bounces at lists.lustre.org] On Behalf Of Patrick Farrell Sent: Monday, November 2, 2015 11:13 AM To: lustre-devel at lists.lustre.org Subject: Re: [lustre-devel] porting Lustre server to RHEL6.7 distro running a kernel.org linux-3.12.39 Stan, Why not work with the CentOS 7 kernel on the server anyway? Is something your LND needs not available? CentOS 7 is freely available and isn't far off in terms of kernel version from 3.12. Yes –I’m somewhat stuck on RHEL 6.x series as I use warewulf as a cluster provisioning system (diskless compute nodes), so far have not found a functional warewulf for RHEL7. I did choose linux-3.12.39 as a kernel base believing it to be somewhat close to RHEL7; although I’m finding this to less so than hoped for…. Additionally the RD drivers I’m using have not been ported to RHEL7; In examining lustre-2_7.62 I found support for sles12 based on 3.12.39 kernel.; thinking the lustre patches would be close… So now I’m wedged between RHEL7 ldiskfs patches and SLES12 ldiskfs patches – figure out distro specific enhancements vs lustre enhancements. You may be hard pressed to get useful advice on changing the ldiskfs patch series, that has the potential to be a pretty big job. I’m starting to understand the magnitude of the ldiskfs task……. I’m ignorant about zfs*, would zfs be a better (read that as path-of-least-resistance) approach ? What are the zfs pitfalls? Thanks, Stan. Regards, - Patrick Farrell On 11/02/2015 01:05 PM, Smith, Stan wrote: Hello, I’m currently unable to search the lustre-devel archives + 1st post to this list. Having read lustre documentation I find only references to building lustre server for stock ‘distro’ kernels. Does someone have suggestions on how to patch ldiskfs for a kernel.org kernel…..specifically weeding out RHEL/SLES/* distro FS enhancements from a kernel.org base? I have written a Reliable Datagram LND which passes the LNet selftests (client lustre build) now entering the world of lustre server building. Patching the kernel.org kernel for lustre server was fairly straightforward, creating the patch series for ldiskfs is another story. Thanks, Stan. _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.org http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.org http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.org https://urldefense.proofpoint.com/v2/url?u=http-3A__lists.lustre.org_listinfo.cgi_lustre-2Ddevel-2Dlustre.org&d=CwICAg&c=IGDlg0lD0b-nebmJJ0Kp8A&r=x9pM59OqndbWw-lPPdr8w1Vud29EZigcxcNkz0uw5oQ&m=CjVqTjggbFA1F-2WDW87aU9UmdOsvkSSdbrx6n_jVLg&s=A6GC4M4a2RZsUUrt-VAKwS0MmRRdPLYYgVDeJ5RDF7Q&e= -------------- next part -------------- An HTML attachment was scrubbed... URL: From pauldaviesc at gmail.com Sun Nov 1 08:42:29 2015 From: pauldaviesc at gmail.com (Paul Davies C) Date: Sun, 1 Nov 2015 14:12:29 +0530 Subject: [lustre-devel] [PATCH] lustre: obdclass: fix sparse warning Message-ID: <5635d078.a1ee440a.16126.ffffcaf6@mx.google.com> Fix the following warning given by sparse: drivers/staging/lustre/lustre/obdclass/cl_lock.c:690:5: warning: symbol 'cl_lock_mutex_try' was not declared. Should it be static? Signed-off-by: Paul Davies C --- drivers/staging/lustre/lustre/obdclass/cl_lock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c b/drivers/staging/lustre/lustre/obdclass/cl_lock.c index 5621beb..6f83452 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_lock.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_lock.c @@ -687,7 +687,7 @@ EXPORT_SYMBOL(cl_lock_mutex_get); * * \see cl_lock_mutex_get() */ -int cl_lock_mutex_try(const struct lu_env *env, struct cl_lock *lock) +static int cl_lock_mutex_try(const struct lu_env *env, struct cl_lock *lock) { int result; -- 1.9.1 From dan.carpenter at oracle.com Tue Nov 3 22:16:16 2015 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Wed, 4 Nov 2015 01:16:16 +0300 Subject: [lustre-devel] [patch] staging: lustre: remove unused variable Message-ID: <20151103221616.GD19280@mwanda> The "->lr_lvb_data" struct member is never used. Delete it. Signed-off-by: Dan Carpenter --- I have compile tested this. I looked through the history and it seems to never have been used. I wonder if we can remove the locking as well. diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 0e75a15..138479a 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -872,8 +872,6 @@ struct ldlm_resource { */ struct mutex lr_lvb_mutex; int lr_lvb_len; - /** protected by lr_lock */ - void *lr_lvb_data; /** When the resource was considered as contended. */ unsigned long lr_contention_time; diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c index c0a54bf..b55a4f0 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c @@ -1154,8 +1154,6 @@ ldlm_resource_get(struct ldlm_namespace *ns, struct ldlm_resource *parent, CERROR("%s: lvbo_init failed for resource %#llx:%#llx: rc = %d\n", ns->ns_obd->obd_name, name->name[0], name->name[1], rc); - kfree(res->lr_lvb_data); - res->lr_lvb_data = NULL; res->lr_lvb_len = rc; mutex_unlock(&res->lr_lvb_mutex); ldlm_resource_putref(res); From simmonsja at ornl.gov Tue Nov 3 22:38:15 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Tue, 3 Nov 2015 22:38:15 +0000 Subject: [lustre-devel] [patch] staging: lustre: remove unused variable In-Reply-To: <20151103221616.GD19280@mwanda> References: <20151103221616.GD19280@mwanda> Message-ID: >The "->lr_lvb_data" struct member is never used. Delete it. > >Signed-off-by: Dan Carpenter >--- >I have compile tested this. I looked through the history and it seems >to never have been used. I wonder if we can remove the locking as well. This is used by the quota and ofd layer which are both server side. From simmonsja at ornl.gov Tue Nov 3 23:28:17 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Tue, 3 Nov 2015 23:28:17 +0000 Subject: [lustre-devel] [patch] staging: lustre: potential underflow in libcfs_kkuc_group_add() In-Reply-To: <20151029135122.GA7709@mwanda> References: <20151029135122.GA7709@mwanda> Message-ID: >My static checker says that "group" is a user controlled number that can >be negative leading to an array underflow. I have looked at it, and I'm >not an expert enough in lustre to say for sure if it is really a bug. >Anyway, it's simple enough to make the variable unsigned which pleases >the static checker and makes it easier to audit. > >Signed-off-by: Dan Carpenter Dmitry do you this this could be placed under place under LU-6303 or does a new ticket need to be open. I also CC Frank Zago who is very familiar with this code. To me it looks okay. diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h index a989d26..41f3d81 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h @@ -91,7 +91,7 @@ typedef int (*libcfs_kkuc_cb_t)(__u32 data, void *cb_arg); /* Kernel methods */ int libcfs_kkuc_msg_put(struct file *fp, void *payload); int libcfs_kkuc_group_put(int group, void *payload); -int libcfs_kkuc_group_add(struct file *fp, int uid, int group, +int libcfs_kkuc_group_add(struct file *fp, int uid, unsigned int group, __u32 data); int libcfs_kkuc_group_rem(int uid, int group); int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func, diff --git a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c index ad661a3..d8230ae 100644 --- a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c +++ b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c @@ -110,7 +110,8 @@ static DECLARE_RWSEM(kg_sem); * @param uid identifier for this receiver * @param group group number */ -int libcfs_kkuc_group_add(struct file *filp, int uid, int group, __u32 data) +int libcfs_kkuc_group_add(struct file *filp, int uid, unsigned int group, + __u32 data) { struct kkuc_reg *reg; _______________________________________________ devel mailing list devel at linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel From simmonsja at ornl.gov Tue Nov 3 23:56:22 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Tue, 3 Nov 2015 23:56:22 +0000 Subject: [lustre-devel] [PATCH 1/3] staging: lustre: checkpatch cleanups for nidstring.c In-Reply-To: <20151102144837.GG18797@mwanda> References: <1446161303-798-1-git-send-email-jsimmons@infradead.org> <1446161303-798-2-git-send-email-jsimmons@infradead.org> <20151030230148.GB2920@kroah.com> <229dae23c2f34950a21db4bd6dbdcfba@EXCHCS32.ornl.gov> <20151102144837.GG18797@mwanda> Message-ID: >Yeah. That is often the fastest way to fix all the checkpatch warnings. > >Checkpatch warnings are pretty mechanical. Just send like 100 patches >at a time until everything is fixed. Don't overthink. Say your patch >breaks the alignment then you have to fix that, but otherwise only fix >one thing at a time. Sometimes people will ask you to fix something >else on the same line, but just say "I didn't introduce that, but yes I >am planning to fix that in a later patchset since I am following the >one thing per patch rule." > >Don't feel shame about sending many small patches. We pretty much merge >everything. It was the sense of it taking forever with that amount of patches needed with the one file approach. Looking at the back log of fixes its not as bad as I thought for libcfs/LNet. Once those fixes are merged the style cleanups can happen pretty quickly. From simmonsja at ornl.gov Wed Nov 4 00:20:49 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Wed, 4 Nov 2015 00:20:49 +0000 Subject: [lustre-devel] [PATCH] staging:lustre: Prevent duplicate CT registrations In-Reply-To: <20151026085249.GW7340@mwanda> References: <1445630357-27149-1-git-send-email-jsimmons@infradead.org> <1445630357-27149-3-git-send-email-jsimmons@infradead.org> <20151026085249.GW7340@mwanda> Message-ID: >On Fri, Oct 23, 2015 at 03:59:14PM -0400, James Simmons wrote: >> diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c >> index 635a93c..d6d70d8 100644 >> --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c >> +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c >> @@ -794,7 +794,9 @@ static void lmv_hsm_req_build(struct lmv_obd *lmv, >> static int lmv_hsm_ct_unregister(struct lmv_obd *lmv, unsigned int cmd, int len, >> struct lustre_kernelcomm *lk, void *uarg) >> { >> - int i, rc = 0; >> + struct kkuc_ct_data *kcd = NULL; >> + int rc = 0; >> + __u32 i; > >We have been introducing a lot of new __u32 types here and I just >assumed there was a reason for it but this one is clearly wrong. The >new code implies that ->ld_tgt_count can overflow INT_MAX which is not >true and that this is code shared with userspace which might be true but >it's not described in the changelog. Is this a static checker fix? >Stop using that broken static checker, because the correct type here is >int. No this patch is from a real fix. You can read the details at https://jira.hpdd.intel.com/browse/LU-3882. I bet he did this to avoid the pickiness of gcc. We have build failure due to gcc stupidity. I could be wrong which if that is the case the original Author is CC. >Anyway, stop making gratuitous unrelated changes (like the white space >changes to local declarations). I feel like I have held off commenting >on this for a while and shown great restraint. :P This is a direct drop of the original patch. I see lots of corrections to the code below. Would a new follow on patch to correct these issues be okay with you. This way we can perverse our bug fix history. From gregkh at linuxfoundation.org Wed Nov 4 01:23:51 2015 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Tue, 3 Nov 2015 17:23:51 -0800 Subject: [lustre-devel] [patch] staging: lustre: remove unused variable In-Reply-To: References: <20151103221616.GD19280@mwanda> Message-ID: <20151104012351.GA9784@kroah.com> On Tue, Nov 03, 2015 at 10:38:15PM +0000, Simmons, James A. wrote: > > >The "->lr_lvb_data" struct member is never used. Delete it. > > > >Signed-off-by: Dan Carpenter > >--- > >I have compile tested this. I looked through the history and it seems > >to never have been used. I wonder if we can remove the locking as well. > > This is used by the quota and ofd layer which are both server side. What does that mean here? confused, greg k-h From andreas.dilger at intel.com Wed Nov 4 01:43:03 2015 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Wed, 4 Nov 2015 01:43:03 +0000 Subject: [lustre-devel] [patch] staging: lustre: remove unused variable Message-ID: On 2015/11/03, 15:38, "Simmons, James A." wrote: >>The "->lr_lvb_data" struct member is never used. Delete it. >> >>Signed-off-by: Dan Carpenter >>--- >>I have compile tested this. I looked through the history and it seems >>to never have been used. I wonder if we can remove the locking as well. > >This is used by the quota and ofd layer which are both server side. When the server code is merged upstream this can be added to a union that contains only server-side data that overlaps with a union containing only client-side data. For now it is fine to remove from the kernel. Cheers, Andreas -- Andreas Dilger Lustre Software Architect Intel High Performance Data Division From fzago at cray.com Tue Nov 3 23:49:00 2015 From: fzago at cray.com (Frank Zago) Date: Tue, 3 Nov 2015 17:49:00 -0600 Subject: [lustre-devel] [patch] staging: lustre: potential underflow in libcfs_kkuc_group_add() In-Reply-To: References: <20151029135122.GA7709@mwanda> Message-ID: <563947EC.9020502@cray.com> On 11/03/2015 05:28 PM, Simmons, James A. wrote: > >> My static checker says that "group" is a user controlled number that can >> be negative leading to an array underflow. I have looked at it, and I'm >> not an expert enough in lustre to say for sure if it is really a bug. >> Anyway, it's simple enough to make the variable unsigned which pleases >> the static checker and makes it easier to audit. >> >> Signed-off-by: Dan Carpenter > > Dmitry do you this this could be placed under place under LU-6303 or does a new ticket need to be open. > I also CC Frank Zago who is very familiar with this code. To me it looks okay. > > diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h > index a989d26..41f3d81 100644 > --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h > +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h > @@ -91,7 +91,7 @@ typedef int (*libcfs_kkuc_cb_t)(__u32 data, void *cb_arg); > /* Kernel methods */ > int libcfs_kkuc_msg_put(struct file *fp, void *payload); > int libcfs_kkuc_group_put(int group, void *payload); > -int libcfs_kkuc_group_add(struct file *fp, int uid, int group, > +int libcfs_kkuc_group_add(struct file *fp, int uid, unsigned int group, > __u32 data); > int libcfs_kkuc_group_rem(int uid, int group); > int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func, > diff --git a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c > index ad661a3..d8230ae 100644 > --- a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c > +++ b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c > @@ -110,7 +110,8 @@ static DECLARE_RWSEM(kg_sem); > * @param uid identifier for this receiver > * @param group group number > */ > -int libcfs_kkuc_group_add(struct file *filp, int uid, int group, __u32 data) > +int libcfs_kkuc_group_add(struct file *filp, int uid, unsigned int group, > + __u32 data) > { > struct kkuc_reg *reg; Yes, but for consistency, all 4 functions should be changed. Regards, Frank. From gregkh at linuxfoundation.org Wed Nov 4 03:46:07 2015 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Tue, 3 Nov 2015 19:46:07 -0800 Subject: [lustre-devel] [PATCH v2 1/7] staging: lustre: remove white space in libcfs_hash.h In-Reply-To: <1446484933-23571-2-git-send-email-jsimmons@infradead.org> References: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> <1446484933-23571-2-git-send-email-jsimmons@infradead.org> Message-ID: <20151104034607.GA12870@kroah.com> On Mon, Nov 02, 2015 at 12:22:07PM -0500, James Simmons wrote: > Cleanup all the unneeded white space in libcfs_hash.h. > > Signed-off-by: James Simmons > --- > .../lustre/include/linux/libcfs/libcfs_hash.h | 135 ++++++++++---------- > 1 files changed, 70 insertions(+), 65 deletions(-) Doesn't apply, did I already queue up this series? confused, greg k-h From sudipm.mukherjee at gmail.com Wed Nov 4 11:41:35 2015 From: sudipm.mukherjee at gmail.com (Sudip Mukherjee) Date: Wed, 4 Nov 2015 17:11:35 +0530 Subject: [lustre-devel] [PATCH v2 1/7] staging: lustre: remove white space in libcfs_hash.h In-Reply-To: <20151104034607.GA12870@kroah.com> References: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> <1446484933-23571-2-git-send-email-jsimmons@infradead.org> <20151104034607.GA12870@kroah.com> Message-ID: <20151104114135.GB7587@sudip-pc> On Tue, Nov 03, 2015 at 07:46:07PM -0800, Greg Kroah-Hartman wrote: > On Mon, Nov 02, 2015 at 12:22:07PM -0500, James Simmons wrote: > > Cleanup all the unneeded white space in libcfs_hash.h. > > > > Signed-off-by: James Simmons > > --- > > .../lustre/include/linux/libcfs/libcfs_hash.h | 135 ++++++++++---------- > > 1 files changed, 70 insertions(+), 65 deletions(-) > > Doesn't apply, did I already queue up this series? No. This did not apply because of: c7fdf4a3959f ("staging: lustre: fix remaining checkpatch issues for libcfs_hash.h") regards sudip From simmonsja at ornl.gov Wed Nov 4 15:05:41 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Wed, 4 Nov 2015 15:05:41 +0000 Subject: [lustre-devel] [PATCH v2 1/7] staging: lustre: remove white space in libcfs_hash.h In-Reply-To: <20151104034607.GA12870@kroah.com> References: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> <1446484933-23571-2-git-send-email-jsimmons@infradead.org> <20151104034607.GA12870@kroah.com> Message-ID: >On Mon, Nov 02, 2015 at 12:22:07PM -0500, James Simmons wrote: >> Cleanup all the unneeded white space in libcfs_hash.h. >> >> Signed-off-by: James Simmons >> --- >> .../lustre/include/linux/libcfs/libcfs_hash.h | 135 ++++++++++---------- >> 1 files changed, 70 insertions(+), 65 deletions(-) > >Doesn't apply, did I already queue up this series? I did a second version of those patches. In one batch you will notice [PATCH v2]. The reason I did a second batch was to break up the "fix checkpatch issues" patch in the first series. I was trying to behave :-) From simmonsja at ornl.gov Wed Nov 4 15:07:13 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Wed, 4 Nov 2015 15:07:13 +0000 Subject: [lustre-devel] [PATCH v2 1/7] staging: lustre: remove white space in libcfs_hash.h In-Reply-To: <20151104114135.GB7587@sudip-pc> References: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> <1446484933-23571-2-git-send-email-jsimmons@infradead.org> <20151104034607.GA12870@kroah.com> <20151104114135.GB7587@sudip-pc> Message-ID: <12a3bc6fd3414ba5b4fac029749675db@EXCHCS32.ornl.gov> >On Tue, Nov 03, 2015 at 07:46:07PM -0800, Greg Kroah-Hartman wrote: >> On Mon, Nov 02, 2015 at 12:22:07PM -0500, James Simmons wrote: >> > Cleanup all the unneeded white space in libcfs_hash.h. >> > >> > Signed-off-by: James Simmons >> > --- >> > .../lustre/include/linux/libcfs/libcfs_hash.h | 135 ++++++++++---------- >> > 1 files changed, 70 insertions(+), 65 deletions(-) >> >> Doesn't apply, did I already queue up this series? > >No. This did not apply because of: >c7fdf4a3959f ("staging: lustre: fix remaining checkpatch issues for libcfs_hash.h") Surprise this was merged which is why I did a second series for this. From gregkh at linuxfoundation.org Wed Nov 4 17:20:19 2015 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Wed, 4 Nov 2015 09:20:19 -0800 Subject: [lustre-devel] [PATCH v2 1/7] staging: lustre: remove white space in libcfs_hash.h In-Reply-To: <12a3bc6fd3414ba5b4fac029749675db@EXCHCS32.ornl.gov> References: <1446484933-23571-1-git-send-email-jsimmons@infradead.org> <1446484933-23571-2-git-send-email-jsimmons@infradead.org> <20151104034607.GA12870@kroah.com> <20151104114135.GB7587@sudip-pc> <12a3bc6fd3414ba5b4fac029749675db@EXCHCS32.ornl.gov> Message-ID: <20151104172019.GB8504@kroah.com> On Wed, Nov 04, 2015 at 03:07:13PM +0000, Simmons, James A. wrote: > >On Tue, Nov 03, 2015 at 07:46:07PM -0800, Greg Kroah-Hartman wrote: > >> On Mon, Nov 02, 2015 at 12:22:07PM -0500, James Simmons wrote: > >> > Cleanup all the unneeded white space in libcfs_hash.h. > >> > > >> > Signed-off-by: James Simmons > >> > --- > >> > .../lustre/include/linux/libcfs/libcfs_hash.h | 135 ++++++++++---------- > >> > 1 files changed, 70 insertions(+), 65 deletions(-) > >> > >> Doesn't apply, did I already queue up this series? > > > >No. This did not apply because of: > >c7fdf4a3959f ("staging: lustre: fix remaining checkpatch issues for libcfs_hash.h") > > Surprise this was merged which is why I did a second series for this. Oops, my mistake, I've now dropped this patch from my tree. Please resend this series so I can try to sync up properly. thanks, greg k-h From dan.carpenter at oracle.com Wed Nov 4 18:25:29 2015 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Wed, 4 Nov 2015 21:25:29 +0300 Subject: [lustre-devel] [patch] staging: lustre: potential underflow in libcfs_kkuc_group_add() In-Reply-To: <563947EC.9020502@cray.com> References: <20151029135122.GA7709@mwanda> <563947EC.9020502@cray.com> Message-ID: <20151104182529.GK7289@mwanda> On Tue, Nov 03, 2015 at 05:49:00PM -0600, Frank Zago wrote: > Yes, but for consistency, all 4 functions should be changed. Thanks for the review. I will send a v2. regards, dan carpenter From jsimmons at infradead.org Wed Nov 4 18:39:57 2015 From: jsimmons at infradead.org (James Simmons) Date: Wed, 4 Nov 2015 13:39:57 -0500 Subject: [lustre-devel] [PATCH 01/10] staging: lustre: wrong parameter to cfs_hash_keycpy Message-ID: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> From: Liang Zhen cfs_hash_rehash_key() passed wrong parameter to cfs_hash_keycpy, hnode should be the second parameter not the third one. Signed-off-by: Liang Zhen Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4362 Reviewed-on: http://review.whamcloud.com/8509 Reviewed-by: Bobi Jam Reviewed-by: Johann Lombardi --- drivers/staging/lustre/lustre/libcfs/hash.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c b/drivers/staging/lustre/lustre/libcfs/hash.c index 98c19b6..8800d64 100644 --- a/drivers/staging/lustre/lustre/libcfs/hash.c +++ b/drivers/staging/lustre/lustre/libcfs/hash.c @@ -2005,7 +2005,7 @@ void cfs_hash_rehash_key(struct cfs_hash *hs, const void *old_key, } /* overwrite key inside locks, otherwise may screw up with * other operations, i.e: rehash */ - cfs_hash_keycpy(hs, new_key, hnode); + cfs_hash_keycpy(hs, hnode, new_key); cfs_hash_multi_bd_unlock(hs, bds, 3, 1); cfs_hash_unlock(hs, 0); -- 1.7.1 From jsimmons at infradead.org Wed Nov 4 18:39:58 2015 From: jsimmons at infradead.org (James Simmons) Date: Wed, 4 Nov 2015 13:39:58 -0500 Subject: [lustre-devel] [PATCH 02/10] staging: lustre: remove unnecessary EXPORT_SYMBOL in libcfs In-Reply-To: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> References: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> Message-ID: <1446662406-4590-2-git-send-email-jsimmons@infradead.org> From: frank zago A lot of symbols don't need to be exported at all because they are only used in the module they belong to. Signed-off-by: frank zago Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5829 Reviewed-on: http://review.whamcloud.com/13319 Reviewed-by: James Simmons Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lustre/libcfs/debug.c | 10 ---------- drivers/staging/lustre/lustre/libcfs/hash.c | 10 ---------- drivers/staging/lustre/lustre/libcfs/libcfs_mem.c | 2 -- .../lustre/lustre/libcfs/linux/linux-debug.c | 1 - 4 files changed, 0 insertions(+), 23 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/debug.c b/drivers/staging/lustre/lustre/libcfs/debug.c index 1d1c671..4272a7c 100644 --- a/drivers/staging/lustre/lustre/libcfs/debug.c +++ b/drivers/staging/lustre/lustre/libcfs/debug.c @@ -94,17 +94,14 @@ static struct kernel_param_ops param_ops_debugmb = { static unsigned int libcfs_debug_mb; module_param(libcfs_debug_mb, debugmb, 0644); MODULE_PARM_DESC(libcfs_debug_mb, "Total debug buffer size."); -EXPORT_SYMBOL(libcfs_debug_mb); unsigned int libcfs_printk = D_CANTMASK; module_param(libcfs_printk, uint, 0644); MODULE_PARM_DESC(libcfs_printk, "Lustre kernel debug console mask"); -EXPORT_SYMBOL(libcfs_printk); unsigned int libcfs_console_ratelimit = 1; module_param(libcfs_console_ratelimit, uint, 0644); MODULE_PARM_DESC(libcfs_console_ratelimit, "Lustre kernel debug console ratelimit (0 to disable)"); -EXPORT_SYMBOL(libcfs_console_ratelimit); static int param_set_delay_minmax(const char *val, const struct kernel_param *kp, @@ -135,9 +132,7 @@ static int param_get_delay(char *buffer, const struct kernel_param *kp) } unsigned int libcfs_console_max_delay; -EXPORT_SYMBOL(libcfs_console_max_delay); unsigned int libcfs_console_min_delay; -EXPORT_SYMBOL(libcfs_console_min_delay); static int param_set_console_max_delay(const char *val, const struct kernel_param *kp) @@ -207,10 +202,8 @@ static struct kernel_param_ops param_ops_uintpos = { unsigned int libcfs_console_backoff = CDEBUG_DEFAULT_BACKOFF; module_param(libcfs_console_backoff, uintpos, 0644); MODULE_PARM_DESC(libcfs_console_backoff, "Lustre kernel debug console backoff factor"); -EXPORT_SYMBOL(libcfs_console_backoff); unsigned int libcfs_debug_binary = 1; -EXPORT_SYMBOL(libcfs_debug_binary); unsigned int libcfs_stack = 3 * THREAD_SIZE / 4; EXPORT_SYMBOL(libcfs_stack); @@ -221,7 +214,6 @@ EXPORT_SYMBOL(libcfs_catastrophe); unsigned int libcfs_panic_on_lbug = 1; module_param(libcfs_panic_on_lbug, uint, 0644); MODULE_PARM_DESC(libcfs_panic_on_lbug, "Lustre kernel panic on LBUG"); -EXPORT_SYMBOL(libcfs_panic_on_lbug); static wait_queue_head_t debug_ctlwq; @@ -572,5 +564,3 @@ void libcfs_debug_set_level(unsigned int debug_level) debug_level); libcfs_debug = debug_level; } - -EXPORT_SYMBOL(libcfs_debug_set_level); diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c b/drivers/staging/lustre/lustre/libcfs/hash.c index 8800d64..f23a11d 100644 --- a/drivers/staging/lustre/lustre/libcfs/hash.c +++ b/drivers/staging/lustre/lustre/libcfs/hash.c @@ -593,7 +593,6 @@ cfs_hash_bd_move_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd_old, if (unlikely(nbkt->hsb_version == 0)) nbkt->hsb_version++; } -EXPORT_SYMBOL(cfs_hash_bd_move_locked); enum { /** always set, for sanity (avoid ZERO intent) */ @@ -830,21 +829,18 @@ cfs_hash_dual_bd_get(struct cfs_hash *hs, const void *key, cfs_hash_bd_order(&bds[0], &bds[1]); } -EXPORT_SYMBOL(cfs_hash_dual_bd_get); void cfs_hash_dual_bd_lock(struct cfs_hash *hs, struct cfs_hash_bd *bds, int excl) { cfs_hash_multi_bd_lock(hs, bds, 2, excl); } -EXPORT_SYMBOL(cfs_hash_dual_bd_lock); void cfs_hash_dual_bd_unlock(struct cfs_hash *hs, struct cfs_hash_bd *bds, int excl) { cfs_hash_multi_bd_unlock(hs, bds, 2, excl); } -EXPORT_SYMBOL(cfs_hash_dual_bd_unlock); struct hlist_node * cfs_hash_dual_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, @@ -852,7 +848,6 @@ cfs_hash_dual_bd_lookup_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, { return cfs_hash_multi_bd_lookup_locked(hs, bds, 2, key); } -EXPORT_SYMBOL(cfs_hash_dual_bd_lookup_locked); struct hlist_node * cfs_hash_dual_bd_findadd_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, @@ -862,7 +857,6 @@ cfs_hash_dual_bd_findadd_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, return cfs_hash_multi_bd_findadd_locked(hs, bds, 2, key, hnode, noref); } -EXPORT_SYMBOL(cfs_hash_dual_bd_findadd_locked); struct hlist_node * cfs_hash_dual_bd_finddel_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, @@ -870,7 +864,6 @@ cfs_hash_dual_bd_finddel_locked(struct cfs_hash *hs, struct cfs_hash_bd *bds, { return cfs_hash_multi_bd_finddel_locked(hs, bds, 2, key, hnode); } -EXPORT_SYMBOL(cfs_hash_dual_bd_finddel_locked); static void cfs_hash_buckets_free(struct cfs_hash_bucket **buckets, @@ -1792,7 +1785,6 @@ cfs_hash_rehash_cancel_locked(struct cfs_hash *hs) cfs_hash_lock(hs, 1); } } -EXPORT_SYMBOL(cfs_hash_rehash_cancel_locked); void cfs_hash_rehash_cancel(struct cfs_hash *hs) @@ -1801,7 +1793,6 @@ cfs_hash_rehash_cancel(struct cfs_hash *hs) cfs_hash_rehash_cancel_locked(hs); cfs_hash_unlock(hs, 1); } -EXPORT_SYMBOL(cfs_hash_rehash_cancel); int cfs_hash_rehash(struct cfs_hash *hs, int do_rehash) @@ -1831,7 +1822,6 @@ cfs_hash_rehash(struct cfs_hash *hs, int do_rehash) return cfs_hash_rehash_worker(&hs->hs_rehash_wi); } -EXPORT_SYMBOL(cfs_hash_rehash); static int cfs_hash_rehash_bd(struct cfs_hash *hs, struct cfs_hash_bd *old) diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c b/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c index f4e08da..27cf861 100644 --- a/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c +++ b/drivers/staging/lustre/lustre/libcfs/libcfs_mem.c @@ -134,7 +134,6 @@ cfs_percpt_current(void *vars) return arr->va_ptrs[cpt]; } -EXPORT_SYMBOL(cfs_percpt_current); void * cfs_percpt_index(void *vars, int idx) @@ -146,7 +145,6 @@ cfs_percpt_index(void *vars, int idx) LASSERT(idx >= 0 && idx < arr->va_count); return arr->va_ptrs[idx]; } -EXPORT_SYMBOL(cfs_percpt_index); /* * free variable array, see more detail in cfs_array_alloc diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c index 8689ea7..59c7bf3 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-debug.c @@ -195,6 +195,5 @@ void libcfs_unregister_panic_notifier(void) atomic_notifier_chain_unregister(&panic_notifier_list, &libcfs_panic_notifier); } -EXPORT_SYMBOL(libcfs_run_upcall); EXPORT_SYMBOL(libcfs_run_lbug_upcall); EXPORT_SYMBOL(lbug_with_loc); -- 1.7.1 From jsimmons at infradead.org Wed Nov 4 18:40:05 2015 From: jsimmons at infradead.org (James Simmons) Date: Wed, 4 Nov 2015 13:40:05 -0500 Subject: [lustre-devel] [PATCH 09/10] staging: lustre: remove page_collection::pc_lock in libcfs In-Reply-To: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> References: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> Message-ID: <1446662406-4590-9-git-send-email-jsimmons@infradead.org> From: Liang Zhen page_collection::pc_lock is supposed to protect race between functions called by smp_call_function(), however we don't have this use-case for ages and page_collection only lives in stack of thread, so it is safe to remove it. Signed-off-by: Liang Zhen Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3055 Reviewed-on: http://review.whamcloud.com/7660 Reviewed-by: Bobi Jam Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lustre/libcfs/tracefile.c | 14 -------------- drivers/staging/lustre/lustre/libcfs/tracefile.h | 8 -------- 2 files changed, 0 insertions(+), 22 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c b/drivers/staging/lustre/lustre/libcfs/tracefile.c index 973c7c2..6fe7dfb 100644 --- a/drivers/staging/lustre/lustre/libcfs/tracefile.c +++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c @@ -199,7 +199,6 @@ static void cfs_tcd_shrink(struct cfs_trace_cpu_data *tcd) pgcount + 1, tcd->tcd_cur_pages); INIT_LIST_HEAD(&pc.pc_pages); - spin_lock_init(&pc.pc_lock); list_for_each_entry_safe(tage, tmp, &tcd->tcd_pages, linkage) { if (pgcount-- == 0) @@ -522,7 +521,6 @@ static void collect_pages_on_all_cpus(struct page_collection *pc) struct cfs_trace_cpu_data *tcd; int i, cpu; - spin_lock(&pc->pc_lock); for_each_possible_cpu(cpu) { cfs_tcd_for_each_type_lock(tcd, i, cpu) { list_splice_init(&tcd->tcd_pages, &pc->pc_pages); @@ -534,7 +532,6 @@ static void collect_pages_on_all_cpus(struct page_collection *pc) } } } - spin_unlock(&pc->pc_lock); } static void collect_pages(struct page_collection *pc) @@ -555,7 +552,6 @@ static void put_pages_back_on_all_cpus(struct page_collection *pc) struct cfs_trace_page *tmp; int i, cpu; - spin_lock(&pc->pc_lock); for_each_possible_cpu(cpu) { cfs_tcd_for_each_type_lock(tcd, i, cpu) { cur_head = tcd->tcd_pages.next; @@ -573,7 +569,6 @@ static void put_pages_back_on_all_cpus(struct page_collection *pc) } } } - spin_unlock(&pc->pc_lock); } static void put_pages_back(struct page_collection *pc) @@ -592,7 +587,6 @@ static void put_pages_on_tcd_daemon_list(struct page_collection *pc, struct cfs_trace_page *tage; struct cfs_trace_page *tmp; - spin_lock(&pc->pc_lock); list_for_each_entry_safe(tage, tmp, &pc->pc_pages, linkage) { __LASSERT_TAGE_INVARIANT(tage); @@ -616,7 +610,6 @@ static void put_pages_on_tcd_daemon_list(struct page_collection *pc, tcd->tcd_cur_daemon_pages--; } } - spin_unlock(&pc->pc_lock); } static void put_pages_on_daemon_list(struct page_collection *pc) @@ -636,8 +629,6 @@ void cfs_trace_debug_print(void) struct cfs_trace_page *tage; struct cfs_trace_page *tmp; - spin_lock_init(&pc.pc_lock); - pc.pc_want_daemon_pages = 1; collect_pages(&pc); list_for_each_entry_safe(tage, tmp, &pc.pc_pages, linkage) { @@ -692,7 +683,6 @@ int cfs_tracefile_dump_all_pages(char *filename) goto out; } - spin_lock_init(&pc.pc_lock); pc.pc_want_daemon_pages = 1; collect_pages(&pc); if (list_empty(&pc.pc_pages)) { @@ -739,8 +729,6 @@ void cfs_trace_flush_pages(void) struct cfs_trace_page *tage; struct cfs_trace_page *tmp; - spin_lock_init(&pc.pc_lock); - pc.pc_want_daemon_pages = 1; collect_pages(&pc); list_for_each_entry_safe(tage, tmp, &pc.pc_pages, linkage) { @@ -970,7 +958,6 @@ static int tracefiled(void *arg) /* we're started late enough that we pick up init's fs context */ /* this is so broken in uml? what on earth is going on? */ - spin_lock_init(&pc.pc_lock); complete(&tctl->tctl_start); while (1) { @@ -1170,7 +1157,6 @@ static void cfs_trace_cleanup(void) struct page_collection pc; INIT_LIST_HEAD(&pc.pc_pages); - spin_lock_init(&pc.pc_lock); trace_cleanup_on_all_cpus(); diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.h b/drivers/staging/lustre/lustre/libcfs/tracefile.h index cb7a396..de37fb7 100644 --- a/drivers/staging/lustre/lustre/libcfs/tracefile.h +++ b/drivers/staging/lustre/lustre/libcfs/tracefile.h @@ -196,14 +196,6 @@ extern union cfs_trace_data_union (*cfs_trace_data[TCD_MAX_TYPES])[NR_CPUS]; struct page_collection { struct list_head pc_pages; /* - * spin-lock protecting ->pc_pages. It is taken by smp_call_function() - * call-back functions. XXX nikita: Which is horrible: all processors - * receive NMI at the same time only to be serialized by this - * lock. Probably ->pc_pages should be replaced with an array of - * NR_CPUS elements accessed locklessly. - */ - spinlock_t pc_lock; - /* * if this flag is set, collect_pages() will spill both * ->tcd_daemon_pages and ->tcd_pages to the ->pc_pages. Otherwise, * only ->tcd_pages are spilled. -- 1.7.1 From jsimmons at infradead.org Wed Nov 4 18:40:06 2015 From: jsimmons at infradead.org (James Simmons) Date: Wed, 4 Nov 2015 13:40:06 -0500 Subject: [lustre-devel] [PATCH 10/10] staging: lustre: fix 'error handling' issues for libcfs workitem.c In-Reply-To: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> References: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> Message-ID: <1446662406-4590-10-git-send-email-jsimmons@infradead.org> From: Sebastien Buisson Fix 'error handling' issues found by Coverity version 6.5.1: Unchecked return value (CHECKED_RETURN) Calling function without checking return value. Signed-off-by: Sebastien Buisson Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3427 Reviewed-on: http://review.whamcloud.com/7103 Reviewed-by: Bobbie Lind Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lustre/libcfs/workitem.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/workitem.c b/drivers/staging/lustre/lustre/libcfs/workitem.c index f6cc434..e405fc2 100644 --- a/drivers/staging/lustre/lustre/libcfs/workitem.c +++ b/drivers/staging/lustre/lustre/libcfs/workitem.c @@ -225,7 +225,9 @@ cfs_wi_scheduler (void *arg) /* CPT affinity scheduler? */ if (sched->ws_cptab != NULL) - cfs_cpt_bind(sched->ws_cptab, sched->ws_cpt); + if (cfs_cpt_bind(sched->ws_cptab, sched->ws_cpt) != 0) + CWARN("Failed to bind %s on CPT %d\n", + sched->ws_name, sched->ws_cpt); spin_lock(&cfs_wi_data.wi_glock); -- 1.7.1 From jsimmons at infradead.org Wed Nov 4 18:40:02 2015 From: jsimmons at infradead.org (James Simmons) Date: Wed, 4 Nov 2015 13:40:02 -0500 Subject: [lustre-devel] [PATCH 06/10] staging: lustre: Update module author to OpenSFS In-Reply-To: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> References: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> Message-ID: <1446662406-4590-6-git-send-email-jsimmons@infradead.org> The modinfo data has gone stale for the author information. This patch changes all the MODULE_AUTHOR to OpenSFS. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6204 Reviewed-on: http://review.whamcloud.com/16132 Reviewed-by: Frank Zago Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 2 +- .../staging/lustre/lnet/klnds/socklnd/socklnd.c | 2 +- drivers/staging/lustre/lnet/lnet/module.c | 2 +- drivers/staging/lustre/lustre/fid/fid_request.c | 2 +- drivers/staging/lustre/lustre/fld/fld_request.c | 2 +- drivers/staging/lustre/lustre/libcfs/module.c | 2 +- drivers/staging/lustre/lustre/llite/lloop.c | 2 +- drivers/staging/lustre/lustre/llite/super25.c | 2 +- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 +- drivers/staging/lustre/lustre/lov/lov_obd.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 2 +- drivers/staging/lustre/lustre/mgc/mgc_request.c | 2 +- drivers/staging/lustre/lustre/obdclass/class_obd.c | 2 +- .../staging/lustre/lustre/obdecho/echo_client.c | 2 +- drivers/staging/lustre/lustre/osc/osc_request.c | 2 +- .../staging/lustre/lustre/ptlrpc/ptlrpc_module.c | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index 7c730e3..de0f85f 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -2865,7 +2865,7 @@ static int __init kiblnd_module_init(void) return 0; } -MODULE_AUTHOR("Sun Microsystems, Inc. "); +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("Kernel OpenIB gen2 LND v2.00"); MODULE_LICENSE("GPL"); diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c index 46a24b4..ebde036 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c @@ -2869,7 +2869,7 @@ ksocknal_module_init(void) return 0; } -MODULE_AUTHOR("Sun Microsystems, Inc. "); +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("Kernel TCP Socket LND v3.0.0"); MODULE_LICENSE("GPL"); MODULE_VERSION("3.0.0"); diff --git a/drivers/staging/lustre/lnet/lnet/module.c b/drivers/staging/lustre/lnet/lnet/module.c index 576201a..ac2fdf0 100644 --- a/drivers/staging/lustre/lnet/lnet/module.c +++ b/drivers/staging/lustre/lnet/lnet/module.c @@ -146,7 +146,7 @@ fini_lnet(void) lnet_fini(); } -MODULE_AUTHOR("Peter J. Braam "); +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("LNet v3.1"); MODULE_LICENSE("GPL"); MODULE_VERSION("1.0.0"); diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c index e817628..fe7c39a 100644 --- a/drivers/staging/lustre/lustre/fid/fid_request.c +++ b/drivers/staging/lustre/lustre/fid/fid_request.c @@ -462,7 +462,7 @@ static void __exit fid_mod_exit(void) ldebugfs_remove(&seq_debugfs_dir); } -MODULE_AUTHOR("Sun Microsystems, Inc. "); +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("Lustre FID Module"); MODULE_LICENSE("GPL"); MODULE_VERSION("0.1.0"); diff --git a/drivers/staging/lustre/lustre/fld/fld_request.c b/drivers/staging/lustre/lustre/fld/fld_request.c index 3fd91bc..469df68 100644 --- a/drivers/staging/lustre/lustre/fld/fld_request.c +++ b/drivers/staging/lustre/lustre/fld/fld_request.c @@ -501,7 +501,7 @@ static void __exit fld_mod_exit(void) ldebugfs_remove(&fld_debugfs_dir); } -MODULE_AUTHOR("Sun Microsystems, Inc. "); +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("Lustre FLD"); MODULE_LICENSE("GPL"); diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c index 50e8fd2..50659c6 100644 --- a/drivers/staging/lustre/lustre/libcfs/module.c +++ b/drivers/staging/lustre/lustre/libcfs/module.c @@ -62,7 +62,7 @@ #include "../../include/linux/lnet/lnet.h" #include "tracefile.h" -MODULE_AUTHOR("Peter J. Braam "); +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("Portals v3.1"); MODULE_LICENSE("GPL"); diff --git a/drivers/staging/lustre/lustre/llite/lloop.c b/drivers/staging/lustre/lustre/llite/lloop.c index e6974c3..8abfba2 100644 --- a/drivers/staging/lustre/lustre/llite/lloop.c +++ b/drivers/staging/lustre/lustre/llite/lloop.c @@ -876,6 +876,6 @@ module_exit(lloop_exit); module_param(max_loop, int, 0444); MODULE_PARM_DESC(max_loop, "maximum of lloop_device"); -MODULE_AUTHOR("Sun Microsystems, Inc. "); +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("Lustre virtual block device"); MODULE_LICENSE("GPL"); diff --git a/drivers/staging/lustre/lustre/llite/super25.c b/drivers/staging/lustre/lustre/llite/super25.c index 0131368..7a9fafc 100644 --- a/drivers/staging/lustre/lustre/llite/super25.c +++ b/drivers/staging/lustre/lustre/llite/super25.c @@ -205,7 +205,7 @@ static void __exit exit_lustre_lite(void) kmem_cache_destroy(ll_file_data_slab); } -MODULE_AUTHOR("Sun Microsystems, Inc. "); +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("Lustre Lite Client File System"); MODULE_LICENSE("GPL"); diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 55f801b..a4de9a3 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -2812,7 +2812,7 @@ static void lmv_exit(void) class_unregister_type(LUSTRE_LMV_NAME); } -MODULE_AUTHOR("Sun Microsystems, Inc. "); +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("Lustre Logical Metadata Volume OBD driver"); MODULE_LICENSE("GPL"); diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index 6bd4ac0..b52609a 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -2352,7 +2352,7 @@ static void /*__exit*/ lov_exit(void) lu_kmem_fini(lov_caches); } -MODULE_AUTHOR("Sun Microsystems, Inc. "); +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("Lustre Logical Object Volume OBD driver"); MODULE_LICENSE("GPL"); MODULE_VERSION(LUSTRE_VERSION_STRING); diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 3dd0d01..294c050 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -2532,7 +2532,7 @@ static void /*__exit*/ mdc_exit(void) class_unregister_type(LUSTRE_MDC_NAME); } -MODULE_AUTHOR("Sun Microsystems, Inc. "); +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("Lustre Metadata Client"); MODULE_LICENSE("GPL"); diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index d17bf51..69b2364 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -1725,7 +1725,7 @@ static void /*__exit*/ mgc_exit(void) class_unregister_type(LUSTRE_MGC_NAME); } -MODULE_AUTHOR("Sun Microsystems, Inc. "); +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("Lustre Management Client"); MODULE_LICENSE("GPL"); diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index 3e9c246..beb59f0 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -576,7 +576,7 @@ static void cleanup_obdclass(void) obd_zombie_impexp_stop(); } -MODULE_AUTHOR("Sun Microsystems, Inc. "); +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("Lustre Class Driver Build Version: " BUILD_VERSION); MODULE_LICENSE("GPL"); MODULE_VERSION(LUSTRE_VERSION_STRING); diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index 82fd8cd..35a2f59 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c @@ -2170,7 +2170,7 @@ static void /*__exit*/ obdecho_exit(void) } -MODULE_AUTHOR("Sun Microsystems, Inc. "); +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("Lustre Testing Echo OBD driver"); MODULE_LICENSE("GPL"); MODULE_VERSION(LUSTRE_VERSION_STRING); diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index cfb3ce2..d6c1447 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -3358,7 +3358,7 @@ static void /*__exit*/ osc_exit(void) ptlrpc_free_rq_pool(osc_rq_pool); } -MODULE_AUTHOR("Sun Microsystems, Inc. "); +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("Lustre Object Storage Client (OSC)"); MODULE_LICENSE("GPL"); MODULE_VERSION(LUSTRE_VERSION_STRING); diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_module.c b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_module.c index 9deeb24..c4f1d0f 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_module.c +++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_module.c @@ -160,7 +160,7 @@ static void __exit ptlrpc_exit(void) ptlrpc_connection_fini(); } -MODULE_AUTHOR("Sun Microsystems, Inc. "); +MODULE_AUTHOR("OpenSFS, Inc. "); MODULE_DESCRIPTION("Lustre Request Processor and Lock Management"); MODULE_LICENSE("GPL"); MODULE_VERSION("1.0.0"); -- 1.7.1 From jsimmons at infradead.org Wed Nov 4 18:40:03 2015 From: jsimmons at infradead.org (James Simmons) Date: Wed, 4 Nov 2015 13:40:03 -0500 Subject: [lustre-devel] [PATCH 07/10] staging: lustre: Handle nodemask on UMP machines In-Reply-To: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> References: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> Message-ID: <1446662406-4590-7-git-send-email-jsimmons@infradead.org> 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 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4199 Reviewed-on: http://review.whamcloud.com/9219 Reviewed-by: Liang Zhen Reviewed-by: Li Xi Reviewed-by: Andreas Dilger --- 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..de9d289 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; + set_bit(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 From jsimmons at infradead.org Wed Nov 4 18:40:00 2015 From: jsimmons at infradead.org (James Simmons) Date: Wed, 4 Nov 2015 13:40:00 -0500 Subject: [lustre-devel] [PATCH 04/10] staging: lustre: fix buffer overflow of string buffer In-Reply-To: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> References: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> Message-ID: <1446662406-4590-4-git-send-email-jsimmons@infradead.org> From: Dmitry Eremin Buffer overflow of string buffer due to non null terminated string. Use strlcpy() when it's justifiable. Use sizeof(var) instead of constants. Signed-off-by: Dmitry Eremin Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4629 Reviewed-on: http://review.whamcloud.com/9389 Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- .../staging/lustre/lnet/klnds/socklnd/socklnd.c | 9 +++++---- drivers/staging/lustre/lnet/lnet/config.c | 14 ++++++++------ drivers/staging/lustre/lnet/selftest/conrpc.c | 4 ++-- drivers/staging/lustre/lnet/selftest/console.c | 6 ++++-- .../staging/lustre/lustre/include/lustre_disk.h | 1 + drivers/staging/lustre/lustre/libcfs/debug.c | 6 +++--- drivers/staging/lustre/lustre/libcfs/hash.c | 3 +-- drivers/staging/lustre/lustre/libcfs/workitem.c | 4 ++-- drivers/staging/lustre/lustre/llite/dir.c | 2 +- drivers/staging/lustre/lustre/lov/lov_pool.c | 3 +-- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 10 +++++++--- drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c | 1 + drivers/staging/lustre/lustre/ptlrpc/sec_config.c | 3 +-- 13 files changed, 37 insertions(+), 29 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c index ecfe733..46a24b4 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c @@ -2621,8 +2621,8 @@ ksocknal_enumerate_interfaces(ksock_net_t *net) net->ksnn_interfaces[j].ksni_ipaddr = ip; net->ksnn_interfaces[j].ksni_netmask = mask; - strncpy(&net->ksnn_interfaces[j].ksni_name[0], - names[i], IFNAMSIZ); + strlcpy(net->ksnn_interfaces[j].ksni_name, + names[i], sizeof(net->ksnn_interfaces[j].ksni_name)); j++; } @@ -2805,8 +2805,9 @@ ksocknal_startup(lnet_ni_t *ni) goto fail_1; } - strncpy(&net->ksnn_interfaces[i].ksni_name[0], - ni->ni_interfaces[i], IFNAMSIZ); + strlcpy(net->ksnn_interfaces[i].ksni_name, + ni->ni_interfaces[i], + sizeof(net->ksnn_interfaces[i].ksni_name)); } net->ksnn_ninterfaces = i; } diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c index 4e8b54b..5390ee9 100644 --- a/drivers/staging/lustre/lnet/lnet/config.c +++ b/drivers/staging/lustre/lnet/lnet/config.c @@ -650,8 +650,8 @@ lnet_parse_route(char *str, int *im_a_router) INIT_LIST_HEAD(&nets); /* save a copy of the string for error messages */ - strncpy(cmd, str, sizeof(cmd) - 1); - cmd[sizeof(cmd) - 1] = 0; + strncpy(cmd, str, sizeof(cmd)); + cmd[sizeof(cmd) - 1] = '\0'; sep = str; for (;;) { @@ -972,11 +972,13 @@ lnet_splitnets(char *source, struct list_head *nets) return 0; offset += (int)(sep - tb->ltb_text); - tb2 = lnet_new_text_buf(strlen(sep)); + len = strlen(sep); + tb2 = lnet_new_text_buf(len); if (tb2 == NULL) return -ENOMEM; - strcpy(tb2->ltb_text, sep); + strncpy(tb2->ltb_text, sep, len); + tb2->ltb_text[len] = '\0'; list_add_tail(&tb2->ltb_list, nets); tb = tb2; @@ -1021,8 +1023,8 @@ lnet_match_networks(char **networksp, char *ip2nets, __u32 *ipaddrs, int nip) tb = list_entry(raw_entries.next, struct lnet_text_buf_t, ltb_list); - strncpy(source, tb->ltb_text, sizeof(source)-1); - source[sizeof(source)-1] = 0; + strncpy(source, tb->ltb_text, sizeof(source)); + source[sizeof(source)-1] = '\0'; /* replace ltb_text with the network(s) add on match */ rc = lnet_match_network_tokens(tb->ltb_text, ipaddrs, nip); diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c index 0060ff6..a16d7a5 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.c +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c @@ -612,8 +612,8 @@ lstcon_sesrpc_prep(lstcon_node_t *nd, int transop, msrq = &(*crpc)->crp_rpc->crpc_reqstmsg.msg_body.mksn_reqst; msrq->mksn_sid = console_session.ses_id; msrq->mksn_force = console_session.ses_force; - strncpy(msrq->mksn_name, console_session.ses_name, - strlen(console_session.ses_name)); + strlcpy(msrq->mksn_name, console_session.ses_name, + sizeof(msrq->mksn_name)); break; case LST_TRANS_SESEND: diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c index 6862c9a..5619fc4 100644 --- a/drivers/staging/lustre/lnet/selftest/console.c +++ b/drivers/staging/lustre/lnet/selftest/console.c @@ -1731,7 +1731,8 @@ lstcon_session_new(char *name, int key, unsigned feats, console_session.ses_feats_updated = 0; console_session.ses_timeout = (timeout <= 0) ? LST_CONSOLE_TIMEOUT : timeout; - strcpy(console_session.ses_name, name); + strlcpy(console_session.ses_name, name, + sizeof(console_session.ses_name)); rc = lstcon_batch_add(LST_DEFAULT_BATCH); if (rc != 0) @@ -1951,7 +1952,8 @@ lstcon_acceptor_handle(struct srpc_server_rpc *rpc) if (grp->grp_userland == 0) grp->grp_userland = 1; - strcpy(jrep->join_session, console_session.ses_name); + strlcpy(jrep->join_session, console_session.ses_name, + sizeof(jrep->join_session)); jrep->join_timeout = console_session.ses_timeout; jrep->join_status = 0; diff --git a/drivers/staging/lustre/lustre/include/lustre_disk.h b/drivers/staging/lustre/lustre/include/lustre_disk.h index 5e1ac12..7c6933f 100644 --- a/drivers/staging/lustre/lustre/include/lustre_disk.h +++ b/drivers/staging/lustre/lustre/include/lustre_disk.h @@ -68,6 +68,7 @@ everything as string options */ #define LMD_MAGIC 0xbdacbd03 +#define LMD_PARAMS_MAXLEN 4096 /* gleaned from the mount command - no persistent info here */ struct lustre_mount_data { diff --git a/drivers/staging/lustre/lustre/libcfs/debug.c b/drivers/staging/lustre/lustre/libcfs/debug.c index 4272a7c..e56785a 100644 --- a/drivers/staging/lustre/lustre/libcfs/debug.c +++ b/drivers/staging/lustre/lustre/libcfs/debug.c @@ -504,9 +504,9 @@ int libcfs_debug_init(unsigned long bufsize) } if (libcfs_debug_file_path != NULL) { - strncpy(libcfs_debug_file_path_arr, - libcfs_debug_file_path, PATH_MAX-1); - libcfs_debug_file_path_arr[PATH_MAX - 1] = '\0'; + strlcpy(libcfs_debug_file_path_arr, + libcfs_debug_file_path, + sizeof(libcfs_debug_file_path_arr)); } /* If libcfs_debug_mb is set to an invalid value or uninitialized diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c b/drivers/staging/lustre/lustre/libcfs/hash.c index f23a11d..d285117 100644 --- a/drivers/staging/lustre/lustre/libcfs/hash.c +++ b/drivers/staging/lustre/lustre/libcfs/hash.c @@ -1037,8 +1037,7 @@ cfs_hash_create(char *name, unsigned cur_bits, unsigned max_bits, if (hs == NULL) return NULL; - strncpy(hs->hs_name, name, len); - hs->hs_name[len - 1] = '\0'; + strlcpy(hs->hs_name, name, len); hs->hs_flags = flags; atomic_set(&hs->hs_refcount, 1); diff --git a/drivers/staging/lustre/lustre/libcfs/workitem.c b/drivers/staging/lustre/lustre/libcfs/workitem.c index e1143a5..f6cc434 100644 --- a/drivers/staging/lustre/lustre/libcfs/workitem.c +++ b/drivers/staging/lustre/lustre/libcfs/workitem.c @@ -360,8 +360,8 @@ cfs_wi_sched_create(char *name, struct cfs_cpt_table *cptab, if (sched == NULL) return -ENOMEM; - strncpy(sched->ws_name, name, CFS_WS_NAME_LEN); - sched->ws_name[CFS_WS_NAME_LEN - 1] = '\0'; + strlcpy(sched->ws_name, name, CFS_WS_NAME_LEN); + sched->ws_cptab = cptab; sched->ws_cpt = cpt; diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 5c9502b..951259a 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -641,7 +641,7 @@ static int ll_send_mgc_param(struct obd_export *mgc, char *string) if (!msp) return -ENOMEM; - strncpy(msp->mgs_param, string, MGS_PARAM_MAXLEN); + strlcpy(msp->mgs_param, string, sizeof(msp->mgs_param)); rc = obd_set_info_async(NULL, mgc, sizeof(KEY_SET_INFO), KEY_SET_INFO, sizeof(struct mgs_send_param), msp, NULL); if (rc) diff --git a/drivers/staging/lustre/lustre/lov/lov_pool.c b/drivers/staging/lustre/lustre/lov/lov_pool.c index b03827e..b43ce6c 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pool.c +++ b/drivers/staging/lustre/lustre/lov/lov_pool.c @@ -412,8 +412,7 @@ int lov_pool_new(struct obd_device *obd, char *poolname) if (!new_pool) return -ENOMEM; - strncpy(new_pool->pool_name, poolname, LOV_MAXPOOLNAME); - new_pool->pool_name[LOV_MAXPOOLNAME] = '\0'; + strlcpy(new_pool->pool_name, poolname, sizeof(new_pool->pool_name)); new_pool->pool_lobd = obd; /* ref count init to 1 because when created a pool is always used * up to deletion diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index 48003d5..7617c57 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -892,7 +892,7 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd) } lmd->lmd_magic = LMD_MAGIC; - lmd->lmd_params = kzalloc(4096, GFP_NOFS); + lmd->lmd_params = kzalloc(LMD_PARAMS_MAXLEN, GFP_NOFS); if (!lmd->lmd_params) return -ENOMEM; lmd->lmd_params[0] = '\0'; @@ -978,7 +978,7 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd) goto invalid; clear++; } else if (strncmp(s1, "param=", 6) == 0) { - int length; + size_t length, params_length; char *tail = strchr(s1 + 6, ','); if (tail == NULL) @@ -986,8 +986,12 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd) else length = tail - s1; length -= 6; + params_length = strlen(lmd->lmd_params); + if (params_length + length + 1 >= LMD_PARAMS_MAXLEN) + return -E2BIG; strncat(lmd->lmd_params, s1 + 6, length); - strcat(lmd->lmd_params, " "); + lmd->lmd_params[params_length + length] = '\0'; + strlcat(lmd->lmd_params, " ", LMD_PARAMS_MAXLEN); clear++; } else if (strncmp(s1, "osd=", 4) == 0) { rc = lmd_parse_string(&lmd->lmd_osd_type, s1 + 4); diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c index ce036a1..ac87aa1 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c +++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c @@ -422,6 +422,7 @@ static int ptlrpcd(void *arg) complete(&pc->pc_starting); /* + * This mainloop strongly resembles ptlrpc_set_wait() except that our * set never completes. ptlrpcd_check() calls ptlrpc_check_set() when * there are requests in the set. New requests come in on the set's diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_config.c b/drivers/staging/lustre/lustre/ptlrpc/sec_config.c index 7ff948f..7a20670 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_config.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_config.c @@ -83,8 +83,7 @@ int sptlrpc_parse_flavor(const char *str, struct sptlrpc_flavor *flvr) return 0; } - strncpy(buf, str, sizeof(buf)); - buf[sizeof(buf) - 1] = '\0'; + strlcpy(buf, str, sizeof(buf)); bulk = strchr(buf, '-'); if (bulk) -- 1.7.1 From jsimmons at infradead.org Wed Nov 4 18:40:04 2015 From: jsimmons at infradead.org (James Simmons) Date: Wed, 4 Nov 2015 13:40:04 -0500 Subject: [lustre-devel] [PATCH 08/10] staging: lustre: race condition for check/use cfs_fail_val In-Reply-To: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> References: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> Message-ID: <1446662406-4590-8-git-send-email-jsimmons@infradead.org> From: Fan Yong There are some race conditions when check/use cfs_fail_val. For example: when inject failure stub for LFSCK test as following: 764 if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_DELAY2) && 765 cfs_fail_val > 0) { 766 struct l_wait_info lwi; 767 768 lwi = LWI_TIMEOUT(cfs_time_seconds(cfs_fail_val), 769 NULL, NULL); 770 l_wait_event(thread->t_ctl_waitq, 771 !thread_is_running(thread), 772 &lwi); 773 774 if (unlikely(!thread_is_running(thread))) { 775 CDEBUG(D_LFSCK, "%s: scan dir exit for engine " 776 "stop, parent "DFID", cookie "LPX64"n", 777 lfsck_lfsck2name(lfsck), 778 PFID(lfsck_dto2fid(dir)), 779 lfsck->li_cookie_dir); 780 RETURN(0); 781 } 782 } The "cfs_fail_val" may be changed as zero by others after the check at the line 765 but before using it at the line 768. Then the LFSCK engine will fall into "wait" until someone run "lfsck_stop". Signed-off-by: Fan Yong Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6146 Reviewed-on: http://review.whamcloud.com/13481 Reviewed-by: Lai Siyao Reviewed-by: Andreas Dilger --- drivers/staging/lustre/lustre/libcfs/fail.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/fail.c b/drivers/staging/lustre/lustre/libcfs/fail.c index d39fece..ea059b0 100644 --- a/drivers/staging/lustre/lustre/libcfs/fail.c +++ b/drivers/staging/lustre/lustre/libcfs/fail.c @@ -126,7 +126,7 @@ int __cfs_fail_timeout_set(__u32 id, __u32 value, int ms, int set) int ret; ret = __cfs_fail_check_set(id, value, set); - if (ret) { + if (ret && likely(ms > 0)) { CERROR("cfs_fail_timeout id %x sleeping for %dms\n", id, ms); set_current_state(TASK_UNINTERRUPTIBLE); -- 1.7.1 From jsimmons at infradead.org Wed Nov 4 18:39:59 2015 From: jsimmons at infradead.org (James Simmons) Date: Wed, 4 Nov 2015 13:39:59 -0500 Subject: [lustre-devel] [PATCH 03/10] staging: lustre: remove libcfs_debug_set_level prototype from libcfs_private.h In-Reply-To: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> References: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> Message-ID: <1446662406-4590-3-git-send-email-jsimmons@infradead.org> From: frank zago The function libcfs_debug_set_level is used only internally so no reason to expose it in libcfs_private.h. This is broken out from LU-5829 patch http://review.whamcloud.com/13319. Signed-off-by: frank zago --- .../lustre/include/linux/libcfs/libcfs_private.h | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index 6af733d..dc2fe1f 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h @@ -185,8 +185,6 @@ int libcfs_debug_cleanup(void); int libcfs_debug_clear_buffer(void); int libcfs_debug_mark_buffer(const char *text); -void libcfs_debug_set_level(unsigned int debug_level); - /* * allocate per-cpu-partition data, returned value is an array of pointers, * variable can be indexed by CPU ID. -- 1.7.1 From jsimmons at infradead.org Wed Nov 4 18:40:01 2015 From: jsimmons at infradead.org (James Simmons) Date: Wed, 4 Nov 2015 13:40:01 -0500 Subject: [lustre-devel] [PATCH 05/10] staging: lustre: Fix possible NULL pointer dereference in lprocfs_status.c In-Reply-To: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> References: <1446662406-4590-1-git-send-email-jsimmons@infradead.org> Message-ID: <1446662406-4590-5-git-send-email-jsimmons@infradead.org> From: Dmitry Eremin The imp->imp_connection really could be NULL, we better check for it before dereferencing it in taht call to libcfs_nid2str_r. Signed-off-by: Dmitry Eremin Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6507 Reviewed-on: http://review.whamcloud.com/14808 Reviewed-by: Bob Glossman Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- .../lustre/lustre/obdclass/lprocfs_status.c | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c index 2de3c1b..dda5ad1 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c @@ -665,15 +665,18 @@ int lprocfs_rd_import(struct seq_file *m, void *data) seq_printf(m, "%s%s", j ? ", " : "", nidstr); j++; } - libcfs_nid2str_r(imp->imp_connection->c_peer.nid, - nidstr, sizeof(nidstr)); + if (imp->imp_connection != NULL) + libcfs_nid2str_r(imp->imp_connection->c_peer.nid, + nidstr, sizeof(nidstr)); + else + strncpy(nidstr, "", sizeof(nidstr)); seq_printf(m, "]\n" " current_connection: %s\n" " connection_attempts: %u\n" " generation: %u\n" " in-progress_invalidations: %u\n", - imp->imp_connection == NULL ? "" : nidstr, + nidstr, imp->imp_conn_cnt, imp->imp_generation, atomic_read(&imp->imp_inval_count)); -- 1.7.1 From simmonsja at ornl.gov Wed Nov 4 19:00:27 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Wed, 4 Nov 2015 19:00:27 +0000 Subject: [lustre-devel] [patch] staging: lustre: potential underflow in libcfs_kkuc_group_add() In-Reply-To: <20151104182529.GK7289@mwanda> References: <20151029135122.GA7709@mwanda> <563947EC.9020502@cray.com> <20151104182529.GK7289@mwanda> Message-ID: <21429a01825c4730ab4b247e8bb24b00@EXCHCS32.ornl.gov> >On Tue, Nov 03, 2015 at 05:49:00PM -0600, Frank Zago wrote: >> Yes, but for consistency, all 4 functions should be changed. > >Thanks for the review. I will send a v2. Greg merged your original patch so it will be a new patch. From lkp at intel.com Wed Nov 4 22:06:17 2015 From: lkp at intel.com (kbuild test robot) Date: Thu, 5 Nov 2015 06:06:17 +0800 Subject: [lustre-devel] [PATCH 07/10] staging: lustre: Handle nodemask on UMP machines In-Reply-To: <1446662406-4590-7-git-send-email-jsimmons@infradead.org> Message-ID: <201511050650.viTvMDVn%fengguang.wu@intel.com> Hi James, [auto build test WARNING on: staging/staging-next] [also build test WARNING on: next-20151104] [cannot apply to: v4.3] url: https://github.com/0day-ci/linux/commits/James-Simmons/staging-lustre-wrong-parameter-to-cfs_hash_keycpy/20151105-024407 config: i386-randconfig-b0-11050505 (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c: In function 'cfs_cpt_table_alloc': >> drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c:61:14: warning: passing argument 2 of 'set_bit' from incompatible pointer type [-Wincompatible-pointer-types] set_bit(0, &cptab->ctb_nodemask); ^ In file included from include/linux/bitops.h:36:0, from drivers/staging/lustre/lustre/libcfs/../../include/linux/libcfs/linux/libcfs.h:44, from drivers/staging/lustre/lustre/libcfs/../../include/linux/libcfs/libcfs.h:40, from drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c:38: arch/x86/include/asm/bitops.h:72:1: note: expected 'volatile long unsigned int *' but argument is of type 'nodemask_t * {aka struct *}' set_bit(long nr, volatile unsigned long *addr) ^ vim +/set_bit +61 drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c 45 46 #define CFS_CPU_VERSION_MAGIC 0xbabecafe 47 48 struct cfs_cpt_table * 49 cfs_cpt_table_alloc(unsigned int ncpt) 50 { 51 struct cfs_cpt_table *cptab; 52 53 if (ncpt != 1) { 54 CERROR("Can't support cpu partition number %d\n", ncpt); 55 return NULL; 56 } 57 58 LIBCFS_ALLOC(cptab, sizeof(*cptab)); 59 if (cptab != NULL) { 60 cptab->ctb_version = CFS_CPU_VERSION_MAGIC; > 61 set_bit(0, &cptab->ctb_nodemask); 62 cptab->ctb_nparts = ncpt; 63 } 64 65 return cptab; 66 } 67 EXPORT_SYMBOL(cfs_cpt_table_alloc); 68 69 void --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation -------------- next part -------------- A non-text attachment was scrubbed... Name: .config.gz Type: application/octet-stream Size: 30157 bytes Desc: not available URL: From lkp at intel.com Thu Nov 5 00:46:51 2015 From: lkp at intel.com (kbuild test robot) Date: Thu, 5 Nov 2015 08:46:51 +0800 Subject: [lustre-devel] [PATCH 07/10] staging: lustre: Handle nodemask on UMP machines In-Reply-To: <1446662406-4590-7-git-send-email-jsimmons@infradead.org> Message-ID: <201511050801.fy1GmLxM%fengguang.wu@intel.com> Hi James, [auto build test WARNING on: staging/staging-next] [also build test WARNING on: next-20151104] [cannot apply to: v4.3] url: https://github.com/0day-ci/linux/commits/James-Simmons/staging-lustre-wrong-parameter-to-cfs_hash_keycpy/20151105-024407 config: m68k-allmodconfig (attached as .config) reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=m68k All warnings (new ones prefixed by >>): In file included from include/linux/bitops.h:36:0, from drivers/staging/lustre/lustre/libcfs/../../include/linux/libcfs/linux/libcfs.h:44, from drivers/staging/lustre/lustre/libcfs/../../include/linux/libcfs/libcfs.h:40, from drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c:38: drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c: In function 'cfs_cpt_table_alloc': >> arch/m68k/include/asm/bitops.h:64:5: warning: passing argument 2 of 'bset_mem_set_bit' from incompatible pointer type bset_mem_set_bit(nr, vaddr) : \ ^ >> drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c:61:3: note: in expansion of macro 'set_bit' set_bit(0, &cptab->ctb_nodemask); ^ arch/m68k/include/asm/bitops.h:41:20: note: expected 'volatile long unsigned int *' but argument is of type 'struct nodemask_t *' static inline void bset_mem_set_bit(int nr, volatile unsigned long *vaddr) ^ >> arch/m68k/include/asm/bitops.h:65:5: warning: passing argument 2 of 'bfset_mem_set_bit' from incompatible pointer type bfset_mem_set_bit(nr, vaddr)) ^ >> drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c:61:3: note: in expansion of macro 'set_bit' set_bit(0, &cptab->ctb_nodemask); ^ arch/m68k/include/asm/bitops.h:50:20: note: expected 'volatile long unsigned int *' but argument is of type 'struct nodemask_t *' static inline void bfset_mem_set_bit(int nr, volatile unsigned long *vaddr) ^ vim +/set_bit +61 drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c 32 * 33 * Author: liang at whamcloud.com 34 */ 35 36 #define DEBUG_SUBSYSTEM S_LNET 37 > 38 #include "../../include/linux/libcfs/libcfs.h" 39 40 /** Global CPU partition table */ 41 struct cfs_cpt_table *cfs_cpt_table __read_mostly; 42 EXPORT_SYMBOL(cfs_cpt_table); 43 44 #ifndef HAVE_LIBCFS_CPT 45 46 #define CFS_CPU_VERSION_MAGIC 0xbabecafe 47 48 struct cfs_cpt_table * 49 cfs_cpt_table_alloc(unsigned int ncpt) 50 { 51 struct cfs_cpt_table *cptab; 52 53 if (ncpt != 1) { 54 CERROR("Can't support cpu partition number %d\n", ncpt); 55 return NULL; 56 } 57 58 LIBCFS_ALLOC(cptab, sizeof(*cptab)); 59 if (cptab != NULL) { 60 cptab->ctb_version = CFS_CPU_VERSION_MAGIC; > 61 set_bit(0, &cptab->ctb_nodemask); 62 cptab->ctb_nparts = ncpt; 63 } 64 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation -------------- next part -------------- A non-text attachment was scrubbed... Name: .config.gz Type: application/octet-stream Size: 34355 bytes Desc: not available URL: From elfring at users.sourceforge.net Thu Nov 5 12:10:36 2015 From: elfring at users.sourceforge.net (SF Markus Elfring) Date: Thu, 5 Nov 2015 13:10:36 +0100 Subject: [lustre-devel] [PATCH 0/3] staging: lustre: Deletion of some unnecessary checks In-Reply-To: <5317A59D.4@users.sourceforge.net> References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> Message-ID: <563B473C.5090508@users.sourceforge.net> From: Markus Elfring Date: Thu, 5 Nov 2015 13:03:33 +0100 Further update suggestions were taken into account after a patch was applied from static source code analysis. Markus Elfring (3): Delete unnecessary checks before two function calls Delete an unnecessary variable initialisation in class_register_type() Less function calls in class_register_type() after error detection drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 10 +++----- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 5 ++-- drivers/staging/lustre/lustre/lov/lov_obd.c | 4 +-- drivers/staging/lustre/lustre/obdclass/genops.c | 34 ++++++++++++++----------- 4 files changed, 25 insertions(+), 28 deletions(-) -- 2.6.2 From elfring at users.sourceforge.net Thu Nov 5 12:15:52 2015 From: elfring at users.sourceforge.net (SF Markus Elfring) Date: Thu, 5 Nov 2015 13:15:52 +0100 Subject: [lustre-devel] [PATCH 1/3] staging: lustre: Delete unnecessary checks before two function calls In-Reply-To: <563B473C.5090508@users.sourceforge.net> References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <563B473C.5090508@users.sourceforge.net> Message-ID: <563B4878.7000106@users.sourceforge.net> From: Markus Elfring Date: Thu, 5 Nov 2015 10:18:45 +0100 The functions kobject_put() and kset_unregister() test whether their argument is NULL and then return immediately. Thus the tests around their calls are not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 10 +++------- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 5 ++--- drivers/staging/lustre/lustre/lov/lov_obd.c | 4 +--- drivers/staging/lustre/lustre/obdclass/genops.c | 6 ++---- 4 files changed, 8 insertions(+), 17 deletions(-) diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c index ca11511..e67e84b 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c @@ -1062,13 +1062,9 @@ static int ldlm_cleanup(void) if (ldlm_state->ldlm_cb_service != NULL) ptlrpc_unregister_service(ldlm_state->ldlm_cb_service); - if (ldlm_ns_kset) - kset_unregister(ldlm_ns_kset); - if (ldlm_svc_kset) - kset_unregister(ldlm_svc_kset); - if (ldlm_kobj) - kobject_put(ldlm_kobj); - + kset_unregister(ldlm_ns_kset); + kset_unregister(ldlm_svc_kset); + kobject_put(ldlm_kobj); ldlm_debugfs_cleanup(); kfree(ldlm_state); diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 635a93c..c3c8e8c 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -240,7 +240,7 @@ static int lmv_connect(const struct lu_env *env, if (data->ocd_connect_flags & OBD_CONNECT_REAL) rc = lmv_check_connect(obd); - if (rc && lmv->lmv_tgts_kobj) + if (rc) kobject_put(lmv->lmv_tgts_kobj); return rc; @@ -646,8 +646,7 @@ static int lmv_disconnect(struct obd_export *exp) lmv_disconnect_mdc(obd, lmv->tgts[i]); } - if (lmv->lmv_tgts_kobj) - kobject_put(lmv->lmv_tgts_kobj); + kobject_put(lmv->lmv_tgts_kobj); out_local: /* diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index 7abe484..910c62c 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -109,9 +109,7 @@ static void lov_putref(struct obd_device *obd) __lov_del_obd(obd, tgt); } - if (lov->lov_tgts_kobj) - kobject_put(lov->lov_tgts_kobj); - + kobject_put(lov->lov_tgts_kobj); } else { mutex_unlock(&lov->lov_lock); } diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index 6477aeb..a1cf8e1 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -216,8 +216,7 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, return 0; failed: - if (type->typ_kobj) - kobject_put(type->typ_kobj); + kobject_put(type->typ_kobj); kfree(type->typ_name); kfree(type->typ_md_ops); kfree(type->typ_dt_ops); @@ -244,8 +243,7 @@ int class_unregister_type(const char *name) return -EBUSY; } - if (type->typ_kobj) - kobject_put(type->typ_kobj); + kobject_put(type->typ_kobj); if (!IS_ERR_OR_NULL(type->typ_debugfs_entry)) ldebugfs_remove(&type->typ_debugfs_entry); -- 2.6.2 From elfring at users.sourceforge.net Thu Nov 5 12:18:25 2015 From: elfring at users.sourceforge.net (SF Markus Elfring) Date: Thu, 5 Nov 2015 13:18:25 +0100 Subject: [lustre-devel] [PATCH 2/3] staging: lustre: Delete an unnecessary variable initialisation in class_register_type() In-Reply-To: <563B473C.5090508@users.sourceforge.net> References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <563B473C.5090508@users.sourceforge.net> Message-ID: <563B4911.2000603@users.sourceforge.net> From: Markus Elfring Date: Thu, 5 Nov 2015 10:55:16 +0100 The variable "rc" will be eventually set to an error return code in the class_register_type() function. Thus let us omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lustre/obdclass/genops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index a1cf8e1..acb86f0 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -155,7 +155,7 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, struct lu_device_type *ldt) { struct obd_type *type; - int rc = 0; + int rc; /* sanity check */ LASSERT(strnlen(name, CLASS_MAX_NAME) < CLASS_MAX_NAME); -- 2.6.2 From elfring at users.sourceforge.net Thu Nov 5 12:20:33 2015 From: elfring at users.sourceforge.net (SF Markus Elfring) Date: Thu, 5 Nov 2015 13:20:33 +0100 Subject: [lustre-devel] [PATCH 3/3] staging: lustre: Less function calls in class_register_type() after error detection In-Reply-To: <563B473C.5090508@users.sourceforge.net> References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <563B473C.5090508@users.sourceforge.net> Message-ID: <563B4991.90005@users.sourceforge.net> From: Markus Elfring Date: Thu, 5 Nov 2015 12:48:58 +0100 The functions "kfree" and "kobject_put" were called in a few cases by the function "class_register_type" during error handling even if the passed variable contained a null pointer. This implementation detail could be improved by the adjustment of jump targets. Signed-off-by: Markus Elfring --- drivers/staging/lustre/lustre/obdclass/genops.c | 26 +++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index acb86f0..4d99a39 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -171,13 +171,16 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, return rc; type->typ_dt_ops = kzalloc(sizeof(*type->typ_dt_ops), GFP_NOFS); + if (!type->typ_dt_ops) + goto free_type; + type->typ_md_ops = kzalloc(sizeof(*type->typ_md_ops), GFP_NOFS); - type->typ_name = kzalloc(strlen(name) + 1, GFP_NOFS); + if (!type->typ_md_ops) + goto free_dt_ops; - if (!type->typ_dt_ops || - !type->typ_md_ops || - !type->typ_name) - goto failed; + type->typ_name = kzalloc(strlen(name) + 1, GFP_NOFS); + if (!type->typ_name) + goto free_md_ops; *(type->typ_dt_ops) = *dt_ops; /* md_ops is optional */ @@ -193,20 +196,20 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, rc = type->typ_debugfs_entry ? PTR_ERR(type->typ_debugfs_entry) : -ENOMEM; type->typ_debugfs_entry = NULL; - goto failed; + goto free_name; } type->typ_kobj = kobject_create_and_add(type->typ_name, lustre_kobj); if (!type->typ_kobj) { rc = -ENOMEM; - goto failed; + goto free_name; } if (ldt != NULL) { type->typ_lu = ldt; rc = lu_device_type_init(ldt); if (rc != 0) - goto failed; + goto put_object; } spin_lock(&obd_types_lock); @@ -214,12 +217,15 @@ int class_register_type(struct obd_ops *dt_ops, struct md_ops *md_ops, spin_unlock(&obd_types_lock); return 0; - - failed: +put_object: kobject_put(type->typ_kobj); +free_name: kfree(type->typ_name); +free_md_ops: kfree(type->typ_md_ops); +free_dt_ops: kfree(type->typ_dt_ops); +free_type: kfree(type); return rc; } -- 2.6.2 From dan.carpenter at oracle.com Thu Nov 5 12:57:12 2015 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Thu, 5 Nov 2015 15:57:12 +0300 Subject: [lustre-devel] [PATCH 1/3] staging: lustre: Delete unnecessary checks before two function calls In-Reply-To: <563B4878.7000106@users.sourceforge.net> References: <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <563B473C.5090508@users.sourceforge.net> <563B4878.7000106@users.sourceforge.net> Message-ID: <20151105125712.GV18797@mwanda> I don't like these patches because relying on hidden sanity checks makes the code harder to read. I am CC'd on all these patches because of kernel-janitors and normally I ignore them but this is drivers/staging so I am invested in this code. Feel free to send them to other subsystems though. regards, dan carpenter From dan.carpenter at oracle.com Thu Nov 5 12:57:46 2015 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Thu, 5 Nov 2015 15:57:46 +0300 Subject: [lustre-devel] [PATCH 2/3] staging: lustre: Delete an unnecessary variable initialisation in class_register_type() In-Reply-To: <563B4911.2000603@users.sourceforge.net> References: <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <563B473C.5090508@users.sourceforge.net> <563B4911.2000603@users.sourceforge.net> Message-ID: <20151105125746.GW18797@mwanda> Looks good. regards, dan carpenter From chris.j.arges at canonical.com Thu Nov 5 20:02:31 2015 From: chris.j.arges at canonical.com (Chris J Arges) Date: Thu, 5 Nov 2015 14:02:31 -0600 Subject: [lustre-devel] Build Dependency Issue in Lustre Mainline Linux Message-ID: <563BB5D7.2040506@canonical.com> Just did a fresh git pull --rebase and tried to do 'make deb-pkg' with an Ubuntu config (which enables lustre). I got the following: depmod: WARNING: found 2 modules in dependency cycles! depmod: WARNING: /home/arges/src/kernel/linux/./debian/tmp/lib/modules/4.3.0+/kernel/drivers/staging/lustre/lnet/lnet/lnet.ko in dependency cycle! depmod: WARNING: /home/arges/src/kernel/linux/./debian/tmp/lib/modules/4.3.0+/kernel/drivers/staging/lustre/lustre/libcfs/libcfs.ko in dependency cycle! ./scripts/depmod.sh: line 57: 16836 Killed "$DEPMOD" "$@" "$KERNELRELEASE" $SYMBOL_PREFIX make[2]: *** [_modinst_post] Error 137 make[1]: *** [deb-pkg] Error 2 make: *** [deb-pkg] Error 2 This was building fine in v4.3, so I suspect something after this tag is causing issue. (My HEAD is at 8e483ed13). --chris From amitoj1606 at gmail.com Thu Nov 5 20:34:21 2015 From: amitoj1606 at gmail.com (Amitoj Kaur Chawla) Date: Fri, 6 Nov 2015 02:04:21 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: lnet: selftest: Move extern declarations to headers Message-ID: <20151105203421.GA12506@amitoj-Inspiron-3542> This patch moves extern declarations to respective header files. This patch also removes extern keyword from function declarations since functions have the extern specifier by default. Signed-off-by: Amitoj Kaur Chawla --- drivers/staging/lustre/lnet/selftest/console.c | 4 ---- drivers/staging/lustre/lnet/selftest/console.h | 2 ++ drivers/staging/lustre/lnet/selftest/framework.c | 11 ----------- drivers/staging/lustre/lnet/selftest/module.c | 3 --- drivers/staging/lustre/lnet/selftest/selftest.h | 13 +++++++++++++ 5 files changed, 15 insertions(+), 18 deletions(-) diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c index 024aaee..ab9906f 100644 --- a/drivers/staging/lustre/lnet/selftest/console.c +++ b/drivers/staging/lustre/lnet/selftest/console.c @@ -1698,8 +1698,6 @@ lstcon_new_session_id(lst_sid_t *sid) sid->ses_stamp = cfs_time_current(); } -extern srpc_service_t lstcon_acceptor_service; - int lstcon_session_new(char *name, int key, unsigned feats, int timeout, int force, lst_sid_t *sid_up) @@ -1984,8 +1982,6 @@ static void lstcon_init_acceptor_service(void) lstcon_acceptor_service.sv_wi_total = SFW_FRWK_WI_MAX; } -extern int lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_data *data); - static DECLARE_IOCTL_HANDLER(lstcon_ioctl_handler, lstcon_ioctl_entry); /* initialize console */ diff --git a/drivers/staging/lustre/lnet/selftest/console.h b/drivers/staging/lustre/lnet/selftest/console.h index acd1312..fe1974a 100644 --- a/drivers/staging/lustre/lnet/selftest/console.h +++ b/drivers/staging/lustre/lnet/selftest/console.h @@ -169,6 +169,8 @@ typedef struct { } lstcon_session_t; /* session descriptor */ extern lstcon_session_t console_session; +extern srpc_service_t lstcon_acceptor_service; +int lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_data *data); static inline lstcon_trans_stat_t * lstcon_trans_stat(void) diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c index 177beaf..34072d0 100644 --- a/drivers/staging/lustre/lnet/selftest/framework.c +++ b/drivers/staging/lustre/lnet/selftest/framework.c @@ -1623,17 +1623,6 @@ static srpc_service_t sfw_services[] = { } }; -extern sfw_test_client_ops_t ping_test_client; -extern srpc_service_t ping_test_service; -extern void ping_init_test_client(void); -extern void ping_init_test_service(void); - -extern sfw_test_client_ops_t brw_test_client; -extern srpc_service_t brw_test_service; -extern void brw_init_test_client(void); -extern void brw_init_test_service(void); - - int sfw_startup(void) { diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/staging/lustre/lnet/selftest/module.c index 09b8f46..c2a8ee5 100644 --- a/drivers/staging/lustre/lnet/selftest/module.c +++ b/drivers/staging/lustre/lnet/selftest/module.c @@ -47,9 +47,6 @@ enum { LST_INIT_CONSOLE }; -extern int lstcon_console_init(void); -extern int lstcon_console_fini(void); - static int lst_init_step = LST_INIT_NONE; struct cfs_wi_sched *lst_sched_serial; diff --git a/drivers/staging/lustre/lnet/selftest/selftest.h b/drivers/staging/lustre/lnet/selftest/selftest.h index 4832253..7e6a234 100644 --- a/drivers/staging/lustre/lnet/selftest/selftest.h +++ b/drivers/staging/lustre/lnet/selftest/selftest.h @@ -452,6 +452,19 @@ void srpc_service_remove_buffers(srpc_service_t *sv, int nbuffer); void srpc_get_counters(srpc_counters_t *cnt); void srpc_set_counters(const srpc_counters_t *cnt); +int lstcon_console_init(void); +int lstcon_console_fini(void); + +extern sfw_test_client_ops_t ping_test_client; +extern srpc_service_t ping_test_service; +void ping_init_test_client(void); +void ping_init_test_service(void); + +extern sfw_test_client_ops_t brw_test_client; +extern srpc_service_t brw_test_service; +void brw_init_test_client(void); +void brw_init_test_service(void); + extern struct cfs_wi_sched *lst_sched_serial; extern struct cfs_wi_sched **lst_sched_test; -- 1.9.1 From morrone2 at llnl.gov Thu Nov 5 21:45:02 2015 From: morrone2 at llnl.gov (Christopher J. Morrone) Date: Thu, 5 Nov 2015 13:45:02 -0800 Subject: [lustre-devel] Should we have fewer releases? In-Reply-To: References: <563A6351.4080407@llnl.gov> Message-ID: <563BCDDE.9060103@llnl.gov> Hi, I think that Cory meant to send his message to this list. Please read his comment at the end before reading my reply here. Peter Jones is summarized in those notes as saying that how long releases take seems to depend on how much change was introduce into the tree. I agree; this is a causal relationship. I believe that if our six months releases are often late and take in the 7-9 month range, then I think that planned nine month releases will in actuality take 12+ months. It may not be the current advocate's reason for suggesting the longer release cycle, but one argument I have heard many times is that a longer cycle will reduce the amount of manpower needed to create releases. I don't think that is substantially true. While there are some fixed costs in creating a release, there is no real reason that those fixed costs need be a dominant factor for manpower demands. On the other hand, required manpower is almost always going to be strongly proportional to, and dominated by, the amount of change we introduce. If we perform excellent, in-depth reviews on all code changes and we also perform strong testing throughout the development cycle, then the manpower centered around "release time" need not be very high. But right now our peer reviews aren't quite as in depth as they could be, and community testing, while improving of late, is unpredictably applied and concentrated near the end of the cycle. This guarantees a large and unpredictable amount of development effort shortly before the release date, often resulting in a missed release target. So lets think about what happens if we extend the development cycle, including extending freeze dates. Assuming only minor, gradual improvements in code reviews and continuous testing (a very safe assumption, I think), the amount of change introduced into the release will be proportionally higher the longer we leave the landing window open. The greater the change, the larger the amount of effort needed to stabilize the code after the fact. Furthermore, I would speculate that extending the release cycle and putting off the testing and stabilization effort will actually require a super linear increase in the time for that effort. Consider for instance that the longer we make the release cycle, the more likely that bug authors have moved on to another task or project. Since this is an open source project we don't have any way to order the bug author back to work on her code. Even if the original author is available to work on the bug, she may need significant time to shift gears and remember how the code she touched works before she can make significant progress. If the original author is not available, then someone else needs to learn that portion of code and that has even more obvious impact on time to solution and release. I think there are also other effects that will conspire (e.g. unexpected change interactions) to make the testing and stabilization period grow super-linearly with the increase in the landing window. Therefore, I would argue that lengthening the release cycle will neither reduce our manpower needs nor result in more predictable release dates. On the contrary, we need to go in the opposite direction to achieve those goals. We need to shorten the release cycle and have more frequent releases. I would recommend that we move to to a roughly three month release cycle. Some of the benefits might be: * Less change and accumulate before the release * The penalty for missing a release landing window is reduced when releases are more often * Code reviewers have less pressure to land unfinished and/or insufficiently reviewed and tested code when the penalty is reduced * Less change means less to test and fix at release time * Bug authors are more likely to still remember what they did and participate in cleanup. * Less time before bugs that slip through the cracks appear in a major release * Reduces developer frustration with long freeze windows * Encourages developers to rally more frequently around the landing windows instead of falling into a long period of silence and then trying to shove a bunch of code in just before freeze. (They'll still try to ram things in just before freeze, but with more frequent landing windows the amount will be smaller and more manageable.) It was also mentioned in the LWG email that vendors believe that the open source releases need to adhere to an advertised schedule. Having shorter release cycles with smaller and more manageable change will directly contribute to Lustre releases happening on a more regular schedule. Those same vendors tend to be concerned that they will not be able to productise every single release if they happen on a three month schedule. It is important to recognize that a vendor's product schedule need not be directly in sync with every community release. It is actually quite common in the open source world for vendors to select a version to productise, and skip over some community releases to find the next version which they will productise. Consider, for instance, the Linux kernel. RedHat selects a version of the kernel to include in RHEL and then sticks with the base of code fore many years. They will backport changes as they see fit, but their base on that release remains the same. The next kernel that they decide to package in their product will skip over many of the upstream Linux releases. Some Lustre vendors already operate this way, and the ones that do not need to adapt to this common, successful open source model. Shortening the release cycle will help encourage and sustain an active open source community of Lustre developers from a diverse set of organizations. Conversely, lengthening the release cycle will result in less Lustre stability and encourage stagnation. It will make us less nimble, less likely to meet the needs of our current user base, and slower to expand into new markets. Lets start working through what process changes we will need to make to shorten the development cycles and make lustre releases more often. Thanks, Chris On 11/04/2015 01:16 PM, Cory Spitz wrote: > Hello, Lustre developers. > > On today¹s OpenSFS LWG teleconference call (notes at > http://wiki.opensfs.org/LWG_Minutes_2015-11-04) I proposed that we change > the Lustre release cadence from six months to nine months. Chris M. > responded (below) that any discussion about development changes should > happen here on lustre-devel. I agree, developers need to be on-board. > > So what do you think about release changes? What requirements do you > have? What issues would you have if OpenSFS changed the major release > cadence to nine months? > > Thanks, > > -Cory > > On 11/4/15, 1:58 PM, "lwg on behalf of Christopher J. Morrone" > wrote: > >> On 11/04/2015 10:28 AM, Cory Spitz wrote: >> >>> Lustre release cadence >>> We haven¹t been good about hitting our 6 month schedules >>> Cory proposed a 9 month cadence just to recognize reality. Certainly >>> pros/cons to any scheme. Should be up for discussion. How/when to >>> decide? >> >> Any development change like that needs to be discussed on lustre-devel. >> >> Chris >> >> _______________________________________________ >> lwg mailing list >> lwg at lists.opensfs.org >> http://lists.opensfs.org/listinfo.cgi/lwg-opensfs.org > > _______________________________________________ > lustre-devel mailing list > lustre-devel at lists.opensfs.org > http://lists.opensfs.org/listinfo.cgi/lustre-devel-opensfs.org > From andreas.dilger at intel.com Thu Nov 5 22:10:01 2015 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Thu, 5 Nov 2015 22:10:01 +0000 Subject: [lustre-devel] Build Dependency Issue in Lustre Mainline Linux In-Reply-To: <563BB5D7.2040506@canonical.com> References: <563BB5D7.2040506@canonical.com> Message-ID: On 2015/11/05, 13:02, "lustre-devel on behalf of Chris J Arges" wrote: >Just did a fresh git pull --rebase and tried to do 'make deb-pkg' with >an Ubuntu config (which enables lustre). I got the following: > >depmod: WARNING: found 2 modules in dependency cycles! >depmod: WARNING: >/home/arges/src/kernel/linux/./debian/tmp/lib/modules/4.3.0+/kernel/driver >s/staging/lustre/lnet/lnet/lnet.ko >in dependency cycle! >depmod: WARNING: >/home/arges/src/kernel/linux/./debian/tmp/lib/modules/4.3.0+/kernel/driver >s/staging/lustre/lustre/libcfs/libcfs.ko >in dependency cycle! >./scripts/depmod.sh: line 57: 16836 Killed "$DEPMOD" >"$@" "$KERNELRELEASE" $SYMBOL_PREFIX >make[2]: *** [_modinst_post] Error 137 >make[1]: *** [deb-pkg] Error 2 >make: *** [deb-pkg] Error 2 > >This was building fine in v4.3, so I suspect something after this tag is >causing issue. (My HEAD is at 8e483ed13). Could you run git bisect to find the offending patch? The error messages don't really give very much to go on. Cheers, Andreas -- Andreas Dilger Lustre Software Architect Intel High Performance Data Division From aurelien.degremont at cea.fr Fri Nov 6 13:53:51 2015 From: aurelien.degremont at cea.fr (DEGREMONT Aurelien) Date: Fri, 6 Nov 2015 14:53:51 +0100 Subject: [lustre-devel] Should we have fewer releases? In-Reply-To: <563BCDDE.9060103@llnl.gov> References: <563A6351.4080407@llnl.gov> <563BCDDE.9060103@llnl.gov> Message-ID: <563CB0EF.5050005@cea.fr> Hi You're right for most of your comments. However, you forgot one important thing: there is no more public maintenance releases. Your theory is correct if Lustre releases get bugfix only minor releases (i.e: 2.7.1, 2.7.2, ...) like it uses to have. HPC centers cannot upgrade Lustre release very often. Usually they pick one and stick to it for a while, doing at most one or two major upgrades during the computer life cycle (lets say 5 years). The more Lustre releases they will be, the more scattering of Lustre versions in production they will be. As there is no more bugfix release made, admins need to regroup their efforts on fewer releases to benefit from debugging and patches produced by others, on the same Lustre release. Regarding lengthening the release cycle, I clearly agree that having longer landing window won't help at all. That means that lengthening release cycle only mean lengthening the code freeze window. Aurélien Le 05/11/2015 22:45, Christopher J. Morrone a écrit : > Hi, > > I think that Cory meant to send his message to this list. Please read > his comment at the end before reading my reply here. > > Peter Jones is summarized in those notes as saying that how long > releases take seems to depend on how much change was introduce into > the tree. I agree; this is a causal relationship. > > I believe that if our six months releases are often late and take in > the 7-9 month range, then I think that planned nine month releases > will in actuality take 12+ months. > > It may not be the current advocate's reason for suggesting the longer > release cycle, but one argument I have heard many times is that a > longer cycle will reduce the amount of manpower needed to create > releases. I don't think that is substantially true. While there are > some fixed costs in creating a release, there is no real reason that > those fixed costs need be a dominant factor for manpower demands. On > the other hand, required manpower is almost always going to be > strongly proportional to, and dominated by, the amount of change we > introduce. > > If we perform excellent, in-depth reviews on all code changes and we > also perform strong testing throughout the development cycle, then the > manpower centered around "release time" need not be very high. But > right now our peer reviews aren't quite as in depth as they could be, > and community testing, while improving of late, is unpredictably > applied and concentrated near the end of the cycle. This guarantees a > large and unpredictable amount of development effort shortly before > the release date, often resulting in a missed release target. > > So lets think about what happens if we extend the development cycle, > including extending freeze dates. Assuming only minor, gradual > improvements in code reviews and continuous testing (a very safe > assumption, I think), the amount of change introduced into the release > will be proportionally higher the longer we leave the landing window > open. The greater the change, the larger the amount of effort needed > to stabilize the code after the fact. > > Furthermore, I would speculate that extending the release cycle and > putting off the testing and stabilization effort will actually require > a super linear increase in the time for that effort. > > Consider for instance that the longer we make the release cycle, the > more likely that bug authors have moved on to another task or project. > Since this is an open source project we don't have any way to order > the bug author back to work on her code. Even if the original author > is available to work on the bug, she may need significant time to > shift gears and remember how the code she touched works before she can > make significant progress. If the original author is not available, > then someone else needs to learn that portion of code and that has > even more obvious impact on time to solution and release. > > I think there are also other effects that will conspire (e.g. > unexpected change interactions) to make the testing and stabilization > period grow super-linearly with the increase in the landing window. > > Therefore, I would argue that lengthening the release cycle will > neither reduce our manpower needs nor result in more predictable > release dates. > > On the contrary, we need to go in the opposite direction to achieve > those goals. We need to shorten the release cycle and have more > frequent releases. I would recommend that we move to to a roughly > three month release cycle. Some of the benefits might be: > > * Less change and accumulate before the release > * The penalty for missing a release landing window is reduced when > releases are more often > * Code reviewers have less pressure to land unfinished and/or > insufficiently reviewed and tested code when the penalty is reduced > * Less change means less to test and fix at release time > * Bug authors are more likely to still remember what they did and > participate in cleanup. > * Less time before bugs that slip through the cracks appear in a major > release > * Reduces developer frustration with long freeze windows > * Encourages developers to rally more frequently around the landing > windows instead of falling into a long period of silence and then > trying to shove a bunch of code in just before freeze. (They'll still > try to ram things in just before freeze, but with more frequent > landing windows the amount will be smaller and more manageable.) > > It was also mentioned in the LWG email that vendors believe that the > open source releases need to adhere to an advertised schedule. Having > shorter release cycles with smaller and more manageable change will > directly contribute to Lustre releases happening on a more regular > schedule. > > Those same vendors tend to be concerned that they will not be able to > productise every single release if they happen on a three month > schedule. It is important to recognize that a vendor's product > schedule need not be directly in sync with every community release. > It is actually quite common in the open source world for vendors to > select a version to productise, and skip over some community releases > to find the next version which they will productise. Consider, for > instance, the Linux kernel. RedHat selects a version of the kernel to > include in RHEL and then sticks with the base of code fore many > years. They will backport changes as they see fit, but their base on > that release remains the same. The next kernel that they decide to > package in their product will skip over many of the upstream Linux > releases. > > Some Lustre vendors already operate this way, and the ones that do not > need to adapt to this common, successful open source model. > > Shortening the release cycle will help encourage and sustain an active > open source community of Lustre developers from a diverse set of > organizations. > > Conversely, lengthening the release cycle will result in less Lustre > stability and encourage stagnation. It will make us less nimble, less > likely to meet the needs of our current user base, and slower to > expand into new markets. > > Lets start working through what process changes we will need to make > to shorten the development cycles and make lustre releases more often. > > Thanks, > Chris > > On 11/04/2015 01:16 PM, Cory Spitz wrote: >> Hello, Lustre developers. >> >> On today¹s OpenSFS LWG teleconference call (notes at >> http://wiki.opensfs.org/LWG_Minutes_2015-11-04) I proposed that we >> change >> the Lustre release cadence from six months to nine months. Chris M. >> responded (below) that any discussion about development changes should >> happen here on lustre-devel. I agree, developers need to be on-board. >> >> So what do you think about release changes? What requirements do you >> have? What issues would you have if OpenSFS changed the major release >> cadence to nine months? >> >> Thanks, >> >> -Cory >> >> On 11/4/15, 1:58 PM, "lwg on behalf of Christopher J. Morrone" >> wrote: >> >>> On 11/04/2015 10:28 AM, Cory Spitz wrote: >>> >>>> Lustre release cadence >>>> We haven¹t been good about hitting our 6 month schedules >>>> Cory proposed a 9 month cadence just to recognize reality. Certainly >>>> pros/cons to any scheme. Should be up for discussion. How/when to >>>> decide? >>> >>> Any development change like that needs to be discussed on lustre-devel. >>> >>> Chris >>> >>> _______________________________________________ >>> lwg mailing list >>> lwg at lists.opensfs.org >>> http://lists.opensfs.org/listinfo.cgi/lwg-opensfs.org >> >> _______________________________________________ >> lustre-devel mailing list >> lustre-devel at lists.opensfs.org >> http://lists.opensfs.org/listinfo.cgi/lustre-devel-opensfs.org >> > > _______________________________________________ > lustre-devel mailing list > lustre-devel at lists.lustre.org > http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org From rpwagner at sdsc.edu Fri Nov 6 14:33:39 2015 From: rpwagner at sdsc.edu (Rick Wagner) Date: Fri, 6 Nov 2015 14:33:39 +0000 Subject: [lustre-devel] Should we have fewer releases? In-Reply-To: <563CB0EF.5050005@cea.fr> References: <563A6351.4080407@llnl.gov> <563BCDDE.9060103@llnl.gov>,<563CB0EF.5050005@cea.fr> Message-ID: <810E88BF-8140-4BD0-9B92-A85E2EAEEC9D@sdsc.edu> Aurélien, Your point about the lack of bug fix releases is only partially correct. As part of their maintenance contract with OpenSFS Intel HPDD has chosen to focus on feature releases. However, there is nothing preventing the community from managing intermediate releases. Even a curated list of recommended patches and well-document and reproducible build processes would be a start. --Rick > On Nov 6, 2015, at 5:53 AM, DEGREMONT Aurelien wrote: > > Hi > > You're right for most of your comments. > > However, you forgot one important thing: there is no more public maintenance releases. > Your theory is correct if Lustre releases get bugfix only minor releases (i.e: 2.7.1, 2.7.2, ...) like it uses to have. > > HPC centers cannot upgrade Lustre release very often. Usually they pick one and stick to it for a while, doing at most one or two major upgrades during the computer life cycle (lets say 5 years). > The more Lustre releases they will be, the more scattering of Lustre versions in production they will be. As there is no more bugfix release made, admins need to regroup their efforts on fewer releases to benefit from debugging and patches produced by others, on the same Lustre release. > > Regarding lengthening the release cycle, I clearly agree that having longer landing window won't help at all. That means that lengthening release cycle only mean lengthening the code freeze window. > > > Aurélien > > Le 05/11/2015 22:45, Christopher J. Morrone a écrit : >> Hi, >> >> I think that Cory meant to send his message to this list. Please read his comment at the end before reading my reply here. >> >> Peter Jones is summarized in those notes as saying that how long releases take seems to depend on how much change was introduce into the tree. I agree; this is a causal relationship. >> >> I believe that if our six months releases are often late and take in the 7-9 month range, then I think that planned nine month releases will in actuality take 12+ months. >> >> It may not be the current advocate's reason for suggesting the longer release cycle, but one argument I have heard many times is that a longer cycle will reduce the amount of manpower needed to create releases. I don't think that is substantially true. While there are some fixed costs in creating a release, there is no real reason that those fixed costs need be a dominant factor for manpower demands. On the other hand, required manpower is almost always going to be strongly proportional to, and dominated by, the amount of change we introduce. >> >> If we perform excellent, in-depth reviews on all code changes and we also perform strong testing throughout the development cycle, then the manpower centered around "release time" need not be very high. But right now our peer reviews aren't quite as in depth as they could be, and community testing, while improving of late, is unpredictably applied and concentrated near the end of the cycle. This guarantees a large and unpredictable amount of development effort shortly before the release date, often resulting in a missed release target. >> >> So lets think about what happens if we extend the development cycle, including extending freeze dates. Assuming only minor, gradual improvements in code reviews and continuous testing (a very safe assumption, I think), the amount of change introduced into the release will be proportionally higher the longer we leave the landing window open. The greater the change, the larger the amount of effort needed to stabilize the code after the fact. >> >> Furthermore, I would speculate that extending the release cycle and putting off the testing and stabilization effort will actually require a super linear increase in the time for that effort. >> >> Consider for instance that the longer we make the release cycle, the more likely that bug authors have moved on to another task or project. Since this is an open source project we don't have any way to order the bug author back to work on her code. Even if the original author is available to work on the bug, she may need significant time to shift gears and remember how the code she touched works before she can make significant progress. If the original author is not available, then someone else needs to learn that portion of code and that has even more obvious impact on time to solution and release. >> >> I think there are also other effects that will conspire (e.g. unexpected change interactions) to make the testing and stabilization period grow super-linearly with the increase in the landing window. >> >> Therefore, I would argue that lengthening the release cycle will neither reduce our manpower needs nor result in more predictable release dates. >> >> On the contrary, we need to go in the opposite direction to achieve those goals. We need to shorten the release cycle and have more frequent releases. I would recommend that we move to to a roughly three month release cycle. Some of the benefits might be: >> >> * Less change and accumulate before the release >> * The penalty for missing a release landing window is reduced when releases are more often >> * Code reviewers have less pressure to land unfinished and/or insufficiently reviewed and tested code when the penalty is reduced >> * Less change means less to test and fix at release time >> * Bug authors are more likely to still remember what they did and participate in cleanup. >> * Less time before bugs that slip through the cracks appear in a major release >> * Reduces developer frustration with long freeze windows >> * Encourages developers to rally more frequently around the landing windows instead of falling into a long period of silence and then trying to shove a bunch of code in just before freeze. (They'll still try to ram things in just before freeze, but with more frequent landing windows the amount will be smaller and more manageable.) >> >> It was also mentioned in the LWG email that vendors believe that the open source releases need to adhere to an advertised schedule. Having shorter release cycles with smaller and more manageable change will directly contribute to Lustre releases happening on a more regular schedule. >> >> Those same vendors tend to be concerned that they will not be able to productise every single release if they happen on a three month schedule. It is important to recognize that a vendor's product schedule need not be directly in sync with every community release. It is actually quite common in the open source world for vendors to select a version to productise, and skip over some community releases to find the next version which they will productise. Consider, for instance, the Linux kernel. RedHat selects a version of the kernel to include in RHEL and then sticks with the base of code fore many years. They will backport changes as they see fit, but their base on that release remains the same. The next kernel that they decide to package in their product will skip over many of the upstream Linux releases. >> >> Some Lustre vendors already operate this way, and the ones that do not need to adapt to this common, successful open source model. >> >> Shortening the release cycle will help encourage and sustain an active open source community of Lustre developers from a diverse set of organizations. >> >> Conversely, lengthening the release cycle will result in less Lustre stability and encourage stagnation. It will make us less nimble, less likely to meet the needs of our current user base, and slower to expand into new markets. >> >> Lets start working through what process changes we will need to make to shorten the development cycles and make lustre releases more often. >> >> Thanks, >> Chris >> >>> On 11/04/2015 01:16 PM, Cory Spitz wrote: >>> Hello, Lustre developers. >>> >>> On today¹s OpenSFS LWG teleconference call (notes at >>> http://wiki.opensfs.org/LWG_Minutes_2015-11-04) I proposed that we change >>> the Lustre release cadence from six months to nine months. Chris M. >>> responded (below) that any discussion about development changes should >>> happen here on lustre-devel. I agree, developers need to be on-board. >>> >>> So what do you think about release changes? What requirements do you >>> have? What issues would you have if OpenSFS changed the major release >>> cadence to nine months? >>> >>> Thanks, >>> >>> -Cory >>> >>> On 11/4/15, 1:58 PM, "lwg on behalf of Christopher J. Morrone" >>> wrote: >>> >>>>> On 11/04/2015 10:28 AM, Cory Spitz wrote: >>>>> >>>>> Lustre release cadence >>>>> We haven¹t been good about hitting our 6 month schedules >>>>> Cory proposed a 9 month cadence just to recognize reality. Certainly >>>>> pros/cons to any scheme. Should be up for discussion. How/when to >>>>> decide? >>>> >>>> Any development change like that needs to be discussed on lustre-devel. >>>> >>>> Chris >>>> >>>> _______________________________________________ >>>> lwg mailing list >>>> lwg at lists.opensfs.org >>>> http://lists.opensfs.org/listinfo.cgi/lwg-opensfs.org >>> >>> _______________________________________________ >>> lustre-devel mailing list >>> lustre-devel at lists.opensfs.org >>> http://lists.opensfs.org/listinfo.cgi/lustre-devel-opensfs.org >> >> _______________________________________________ >> lustre-devel mailing list >> lustre-devel at lists.lustre.org >> http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org > > _______________________________________________ > lustre-devel mailing list > lustre-devel at lists.lustre.org > http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org From oleg.drokin at intel.com Fri Nov 6 14:39:47 2015 From: oleg.drokin at intel.com (Drokin, Oleg) Date: Fri, 6 Nov 2015 14:39:47 +0000 Subject: [lustre-devel] Should we have fewer releases? In-Reply-To: <563BCDDE.9060103@llnl.gov> References: <563A6351.4080407@llnl.gov> <563BCDDE.9060103@llnl.gov> Message-ID: <7AE60ED4-FCA4-4263-887B-5DFC8A0866DA@intel.com> Hello! On Nov 5, 2015, at 4:45 PM, Christopher J. Morrone wrote: > On the contrary, we need to go in the opposite direction to achieve those goals. We need to shorten the release cycle and have more frequent releases. I would recommend that we move to to a roughly three month release cycle. Some of the benefits might be: > > * Less change and accumulate before the release > * The penalty for missing a release landing window is reduced when releases are more often > * Code reviewers have less pressure to land unfinished and/or insufficiently reviewed and tested code when the penalty is reduced > * Less change means less to test and fix at release time > * Bug authors are more likely to still remember what they did and participate in cleanup. > * Less time before bugs that slip through the cracks appear in a major release > * Reduces developer frustration with long freeze windows > * Encourages developers to rally more frequently around the landing windows instead of falling into a long period of silence and then trying to shove a bunch of code in just before freeze. (They'll still try to ram things in just before freeze, but with more frequent landing windows the amount will be smaller and more manageable.) Bringing this to the logical extreme - we should just have one release per major feature. Sadly, I think the stabilization process is not likely to get any shorter. Either that or interested parties would only jump into testing when enough of interesting features accumulate, after which point there'd be a bunch of bugreports for the current feature plus the backlocd that did not get any significant real-world testing before. We have seen this pattern to some degree already even with current releases. The releases that are ignored by community for one reason or another tend to be not very stable and then the follow-on release gets this "testing debt" baggage that is paid at release time once testing outside of Intel picks up the pace. Bye, Oleg From amitoj1606 at gmail.com Fri Nov 6 14:56:52 2015 From: amitoj1606 at gmail.com (Amitoj Kaur Chawla) Date: Fri, 6 Nov 2015 20:26:52 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: lnet: klnds: socklnd: Move extern declarations to header Message-ID: <20151106145652.GA16452@amitoj-Inspiron-3542> This patch moves extern declarations in socklnd_lib.c to the respective header file, 'socklnd.h'. This patch also removes extern keyword from function declarations since functions have the extern specifier by default. Signed-off-by: Amitoj Kaur Chawla --- drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h | 3 +++ drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h index b349847..f4fa725 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h @@ -679,6 +679,9 @@ int ksocknal_lib_recv_kiov(ksock_conn_t *conn); int ksocknal_lib_get_conn_tunables(ksock_conn_t *conn, int *txmem, int *rxmem, int *nagle); +void ksocknal_read_callback(ksock_conn_t *conn); +void ksocknal_write_callback(ksock_conn_t *conn); + int ksocknal_tunables_init(void); void ksocknal_lib_csum_tx(ksock_tx_t *tx); diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c index 679785b..04a4653 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c @@ -580,8 +580,6 @@ ksocknal_lib_push_conn(ksock_conn_t *conn) ksocknal_connsock_decref(conn); } -extern void ksocknal_read_callback(ksock_conn_t *conn); -extern void ksocknal_write_callback(ksock_conn_t *conn); /* * socket call back in Linux */ -- 1.9.1 From simmonsja at ornl.gov Fri Nov 6 22:06:03 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Fri, 6 Nov 2015 22:06:03 +0000 Subject: [lustre-devel] [PATCH] Staging: lustre: dir: Remove wrapper function In-Reply-To: <1446828929-3742-1-git-send-email-shivanib134@gmail.com> References: <1446828929-3742-1-git-send-email-shivanib134@gmail.com> Message-ID: >From: devel [mailto:driverdev-devel-bounces at linuxdriverproject.org] On Behalf Of Shivani Bhardwaj >Sent: Friday, November 06, 2015 11:55 AM >To: gregkh at linuxfoundation.org >Cc: oleg.drokin at intel.com; devel at driverdev.osuosl.org; andreas.dilger at intel.com; linux-kernel at vger.kernel.org; lustre-devel at lists.lustre.org >Subject: [PATCH] Staging: lustre: dir: Remove wrapper function > >Remove the function ll_check_page() and replace all its calls with the >function it wrapped. > >Signed-off-by: Shivani Bhardwaj >--- > drivers/staging/lustre/lustre/llite/dir.c | 9 ++------- > 1 file changed, 2 insertions(+), 7 deletions(-) Acked-by: James Simmons diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 5c9502b..842e6d6 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -239,12 +239,6 @@ static int ll_dir_filler(void *_hash, struct page *page0) return rc; } -static void ll_check_page(struct inode *dir, struct page *page) -{ - /* XXX: check page format later */ - SetPageChecked(page); -} - void ll_release_page(struct page *page, int remove) { kunmap(page); @@ -432,7 +426,8 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash, goto fail; } if (!PageChecked(page)) - ll_check_page(dir, page); + /* XXX: check page format later */ + SetPageChecked(page); if (PageError(page)) { CERROR("page error: "DFID" at %llu: rc %d\n", PFID(ll_inode2fid(dir)), hash, -5); -- 2.1.0 _______________________________________________ devel mailing list devel at linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel From simmonsja at ornl.gov Fri Nov 6 22:07:26 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Fri, 6 Nov 2015 22:07:26 +0000 Subject: [lustre-devel] [PATCH] staging: lustre: lnet: klnds: socklnd: Move extern declarations to header In-Reply-To: <20151106145652.GA16452@amitoj-Inspiron-3542> References: <20151106145652.GA16452@amitoj-Inspiron-3542> Message-ID: <700a373b14c14161b9893727da948ab5@EXCHCS32.ornl.gov> >From: lustre-devel [mailto:lustre-devel-bounces at lists.lustre.org] On Behalf Of Amitoj Kaur Chawla >Sent: Friday, November 06, 2015 9:57 AM >To: oleg.drokin at intel.com; andreas.dilger at intel.com; gregkh at linuxfoundation.org; lustre-devel at lists.lustre.org; devel at driverdev.osuosl.org; linux-kernel at vger.kernel.org >Subject: [lustre-devel] [PATCH] staging: lustre: lnet: klnds: socklnd: Move extern declarations to header > >This patch moves extern declarations in socklnd_lib.c to the respective >header file, 'socklnd.h'. > >This patch also removes extern keyword from function declarations >since functions have the extern specifier by default. > >Signed-off-by: Amitoj Kaur Chawla >--- > drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h | 3 +++ > drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c | 2 -- > 2 files changed, 3 insertions(+), 2 deletions(-) Acked-by: James Simmons diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h index b349847..f4fa725 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.h @@ -679,6 +679,9 @@ int ksocknal_lib_recv_kiov(ksock_conn_t *conn); int ksocknal_lib_get_conn_tunables(ksock_conn_t *conn, int *txmem, int *rxmem, int *nagle); +void ksocknal_read_callback(ksock_conn_t *conn); +void ksocknal_write_callback(ksock_conn_t *conn); + int ksocknal_tunables_init(void); void ksocknal_lib_csum_tx(ksock_tx_t *tx); diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c index 679785b..04a4653 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_lib.c @@ -580,8 +580,6 @@ ksocknal_lib_push_conn(ksock_conn_t *conn) ksocknal_connsock_decref(conn); } -extern void ksocknal_read_callback(ksock_conn_t *conn); -extern void ksocknal_write_callback(ksock_conn_t *conn); /* * socket call back in Linux */ -- 1.9.1 _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.org http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org From morrone2 at llnl.gov Fri Nov 6 22:08:50 2015 From: morrone2 at llnl.gov (Christopher J. Morrone) Date: Fri, 6 Nov 2015 14:08:50 -0800 Subject: [lustre-devel] Should we have fewer releases? In-Reply-To: <7AE60ED4-FCA4-4263-887B-5DFC8A0866DA@intel.com> References: <563A6351.4080407@llnl.gov> <563BCDDE.9060103@llnl.gov> <7AE60ED4-FCA4-4263-887B-5DFC8A0866DA@intel.com> Message-ID: <563D24F2.8050108@llnl.gov> On 11/06/2015 06:39 AM, Drokin, Oleg wrote: > Hello! > > On Nov 5, 2015, at 4:45 PM, Christopher J. Morrone wrote: >> On the contrary, we need to go in the opposite direction to achieve those goals. We need to shorten the release cycle and have more frequent releases. I would recommend that we move to to a roughly three month release cycle. Some of the benefits might be: >> >> * Less change and accumulate before the release >> * The penalty for missing a release landing window is reduced when releases are more often >> * Code reviewers have less pressure to land unfinished and/or insufficiently reviewed and tested code when the penalty is reduced >> * Less change means less to test and fix at release time >> * Bug authors are more likely to still remember what they did and participate in cleanup. >> * Less time before bugs that slip through the cracks appear in a major release >> * Reduces developer frustration with long freeze windows >> * Encourages developers to rally more frequently around the landing windows instead of falling into a long period of silence and then trying to shove a bunch of code in just before freeze. (They'll still try to ram things in just before freeze, but with more frequent landing windows the amount will be smaller and more manageable.) > > Bringing this to the logical extreme - we should just have one release per major feature. It do not agree that it is logical to extend the argument to that extreme. That is the "Appeal to Extremes" logical fallacy. I also don't think it is appropriate to conflate major releases with major features. When/if we move to a shorter release cycle, it would be entirely appropriate to put out a major release with no headline "major features". It is totally acceptable to release the many changes that did make it in the landing window. Even if none of the changes individually count as "major", they still collectively represent a major amount of work. Right now we combine that major amount of work with seriously destabilizing new features that more than offset all the bug fixing that went on. Why do we insist on making those destabilizing influences a requirement for a release? Whether a major feature makes it into any particular release should be judge primarily on the quality and completeness of code, testing, and documentation for said feature. Further, how many major features can be landed in a release would be gated on the amount of manpower we have for review and testing. If 3 major features are truely complete and ready to land, but we can only fully vet 1 in the landing window, well, only one will land. We'll have to make a judgement call as a community on the priority and work on that. In summary: I think we should decouple the concept of major releases and major features. Major releases do not need to be subject to major features. > Sadly, I think the stabilization process is not likely to get any shorter. Do not see a connection between the amount of change and the time it takes to stabilize that change? Can you explain why you think that? > Either that or interested parties would only jump into testing when enough of interesting features accumulate, > after which point there'd be a bunch of bugreports for the current feature plus the backlocd that did not get any significant real-world testing before. We have seen this pattern > to some degree already even with current releases. The scary future you paint is no different than our present. Organizations like LLNL only move to new major releases every 18 months at the earliest, and we would really like to run the same version for more like three years in some cases. We are too busy drowning in production Lustre issues half the time to get involved in testing except when it is something that is on our roadmap to put into production. I don't think we're alone. Even if it isn't Lustre issues, everyone has day jobs that keep us busy and time for testing things that don't look immediately relevant to upper management can be difficult to justify. So I agree, many people already are skipping the testing of many releases and that will continue into the future. Frankly, I think that relying on an open source community to do rigorous and systematic testing is foolhardy. The only way that really works is if your user base is large in proportion to the size of your code size and complexity. I would estimate the Lustre is low in that ratio, while something like ZFS is probably medium to large, and Linux is large. The testing you get from an open source community is going to be a fairly random in terms of code coverage. In order to the coverage to be reasonably complete, you need _alot_ of people testing. If we rely on a voluntary, at-will community testing as out primary SQA enforcement method, we are not going to ever put out terribly quality code with something as complex and poorly documented as Lustre. Lets not apply the Appeal to Extremes argument to this either. I am not saying that we shouldn't have testing. We absolutely should. We should also strive to make the barriers to testing as low as possible, and make the opportunities for testing as frequent as reasonble. If we have release every three months on a _reliable_ schedule, that will give prospective testers the ability to plan their testing time ahead, increases the probability that each prospective tester will have spare time that aligns with one of our release testing windows. All that said, I think you might also be wrong about no one testing the each releases. ORNL has already demonstrated a commitment to try every version. Cray is stepping up testing. I would like to have my team at LLNL become more active on master in the future, and have our testing person worked into the Lustre development cycle. > The releases that are ignored by community for one reason or another tend to be not very stable and then the follow-on release > gets this "testing debt" baggage that is paid at release time once testing outside of Intel picks up the pace. That is a challenge now, and I acknowledge that it will continue to be a challenge in the future. Making the releases more frequently and on a reliable schedule is not magic; it will not fix everything about our development process on its own. Nevertheless I do believe that it will be a key supporting element in improving our software development and SQA processes. Chris From simmonsja at ornl.gov Fri Nov 6 22:18:17 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Fri, 6 Nov 2015 22:18:17 +0000 Subject: [lustre-devel] [PATCH 07/10] staging: lustre: Handle nodemask on UMP machines In-Reply-To: <201511050801.fy1GmLxM%fengguang.wu@intel.com> References: <1446662406-4590-7-git-send-email-jsimmons@infradead.org> <201511050801.fy1GmLxM%fengguang.wu@intel.com> Message-ID: >All warnings (new ones prefixed by >>): > > In file included from include/linux/bitops.h:36:0, > from drivers/staging/lustre/lustre/libcfs/../../include/linux/libcfs/linux/libcfs.h:44, > from drivers/staging/lustre/lustre/libcfs/../../include/linux/libcfs/libcfs.h:40, > from drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c:38: > drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c: In function 'cfs_cpt_table_alloc': >>> arch/m68k/include/asm/bitops.h:64:5: warning: passing argument 2 of 'bset_mem_set_bit' from incompatible pointer type > bset_mem_set_bit(nr, vaddr) : \ > ^ >>> drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c:61:3: note: in expansion of macro 'set_bit' > set_bit(0, &cptab->ctb_nodemask); Yep and additional patch exist to fix this. Should I just push the fix for this or drop this patch and create a new patch that is combo of both fixes. BTW Greg this new batch of patches are order independent. Sorry for not pointing that out. The rest of the patch appear to be okay. From morrone2 at llnl.gov Fri Nov 6 22:18:30 2015 From: morrone2 at llnl.gov (Christopher J. Morrone) Date: Fri, 6 Nov 2015 14:18:30 -0800 Subject: [lustre-devel] Should we have fewer releases? In-Reply-To: <563CB0EF.5050005@cea.fr> References: <563A6351.4080407@llnl.gov> <563BCDDE.9060103@llnl.gov> <563CB0EF.5050005@cea.fr> Message-ID: <563D2736.1010402@llnl.gov> I agree that the lack of public stable branches is an issue for many. But I also think that the topic of stable branches is somewhat orthogonal to the discussion about the development cycle on the master branch. We can make these decisions about changing master's development process without knowing what we are going to do about stable branches in the future. That said, there are some advantages to the three month release cycle that I propose that would help those who are hurting the most by the loss of the stable branches. Assuming that we make these two changes: 1) Releases happen every three months on schedule 2) Releases are decouple from major releases (we don't hold up major releases for unfinished features, and it is fine to have a major release with no major feature) Then the people most hurt by the lack of stable branches and the least able to purchase support contracts will see these benefits: 1) Less time to wait for a major release with relevant bugs fixes 2) Less reluctance to track the major releases It is really in Lustre's best interest in general for us to move our development model in a direction that makes everyone less afraid of trying new versions of Lustre. We don't have a good reputation there, but I think that is fixable if we make an effort. Chris On 11/06/2015 05:53 AM, DEGREMONT Aurelien wrote: > Hi > > You're right for most of your comments. > > However, you forgot one important thing: there is no more public > maintenance releases. > Your theory is correct if Lustre releases get bugfix only minor releases > (i.e: 2.7.1, 2.7.2, ...) like it uses to have. > > HPC centers cannot upgrade Lustre release very often. Usually they pick > one and stick to it for a while, doing at most one or two major upgrades > during the computer life cycle (lets say 5 years). > The more Lustre releases they will be, the more scattering of Lustre > versions in production they will be. As there is no more bugfix release > made, admins need to regroup their efforts on fewer releases to benefit > from debugging and patches produced by others, on the same Lustre release. > > Regarding lengthening the release cycle, I clearly agree that having > longer landing window won't help at all. That means that lengthening > release cycle only mean lengthening the code freeze window. > > > Aurélien > > Le 05/11/2015 22:45, Christopher J. Morrone a écrit : >> Hi, >> >> I think that Cory meant to send his message to this list. Please read >> his comment at the end before reading my reply here. >> >> Peter Jones is summarized in those notes as saying that how long >> releases take seems to depend on how much change was introduce into >> the tree. I agree; this is a causal relationship. >> >> I believe that if our six months releases are often late and take in >> the 7-9 month range, then I think that planned nine month releases >> will in actuality take 12+ months. >> >> It may not be the current advocate's reason for suggesting the longer >> release cycle, but one argument I have heard many times is that a >> longer cycle will reduce the amount of manpower needed to create >> releases. I don't think that is substantially true. While there are >> some fixed costs in creating a release, there is no real reason that >> those fixed costs need be a dominant factor for manpower demands. On >> the other hand, required manpower is almost always going to be >> strongly proportional to, and dominated by, the amount of change we >> introduce. >> >> If we perform excellent, in-depth reviews on all code changes and we >> also perform strong testing throughout the development cycle, then the >> manpower centered around "release time" need not be very high. But >> right now our peer reviews aren't quite as in depth as they could be, >> and community testing, while improving of late, is unpredictably >> applied and concentrated near the end of the cycle. This guarantees a >> large and unpredictable amount of development effort shortly before >> the release date, often resulting in a missed release target. >> >> So lets think about what happens if we extend the development cycle, >> including extending freeze dates. Assuming only minor, gradual >> improvements in code reviews and continuous testing (a very safe >> assumption, I think), the amount of change introduced into the release >> will be proportionally higher the longer we leave the landing window >> open. The greater the change, the larger the amount of effort needed >> to stabilize the code after the fact. >> >> Furthermore, I would speculate that extending the release cycle and >> putting off the testing and stabilization effort will actually require >> a super linear increase in the time for that effort. >> >> Consider for instance that the longer we make the release cycle, the >> more likely that bug authors have moved on to another task or project. >> Since this is an open source project we don't have any way to order >> the bug author back to work on her code. Even if the original author >> is available to work on the bug, she may need significant time to >> shift gears and remember how the code she touched works before she can >> make significant progress. If the original author is not available, >> then someone else needs to learn that portion of code and that has >> even more obvious impact on time to solution and release. >> >> I think there are also other effects that will conspire (e.g. >> unexpected change interactions) to make the testing and stabilization >> period grow super-linearly with the increase in the landing window. >> >> Therefore, I would argue that lengthening the release cycle will >> neither reduce our manpower needs nor result in more predictable >> release dates. >> >> On the contrary, we need to go in the opposite direction to achieve >> those goals. We need to shorten the release cycle and have more >> frequent releases. I would recommend that we move to to a roughly >> three month release cycle. Some of the benefits might be: >> >> * Less change and accumulate before the release >> * The penalty for missing a release landing window is reduced when >> releases are more often >> * Code reviewers have less pressure to land unfinished and/or >> insufficiently reviewed and tested code when the penalty is reduced >> * Less change means less to test and fix at release time >> * Bug authors are more likely to still remember what they did and >> participate in cleanup. >> * Less time before bugs that slip through the cracks appear in a major >> release >> * Reduces developer frustration with long freeze windows >> * Encourages developers to rally more frequently around the landing >> windows instead of falling into a long period of silence and then >> trying to shove a bunch of code in just before freeze. (They'll still >> try to ram things in just before freeze, but with more frequent >> landing windows the amount will be smaller and more manageable.) >> >> It was also mentioned in the LWG email that vendors believe that the >> open source releases need to adhere to an advertised schedule. Having >> shorter release cycles with smaller and more manageable change will >> directly contribute to Lustre releases happening on a more regular >> schedule. >> >> Those same vendors tend to be concerned that they will not be able to >> productise every single release if they happen on a three month >> schedule. It is important to recognize that a vendor's product >> schedule need not be directly in sync with every community release. It >> is actually quite common in the open source world for vendors to >> select a version to productise, and skip over some community releases >> to find the next version which they will productise. Consider, for >> instance, the Linux kernel. RedHat selects a version of the kernel to >> include in RHEL and then sticks with the base of code fore many >> years. They will backport changes as they see fit, but their base on >> that release remains the same. The next kernel that they decide to >> package in their product will skip over many of the upstream Linux >> releases. >> >> Some Lustre vendors already operate this way, and the ones that do not >> need to adapt to this common, successful open source model. >> >> Shortening the release cycle will help encourage and sustain an active >> open source community of Lustre developers from a diverse set of >> organizations. >> >> Conversely, lengthening the release cycle will result in less Lustre >> stability and encourage stagnation. It will make us less nimble, less >> likely to meet the needs of our current user base, and slower to >> expand into new markets. >> >> Lets start working through what process changes we will need to make >> to shorten the development cycles and make lustre releases more often. >> >> Thanks, >> Chris >> >> On 11/04/2015 01:16 PM, Cory Spitz wrote: >>> Hello, Lustre developers. >>> >>> On today¹s OpenSFS LWG teleconference call (notes at >>> http://wiki.opensfs.org/LWG_Minutes_2015-11-04) I proposed that we >>> change >>> the Lustre release cadence from six months to nine months. Chris M. >>> responded (below) that any discussion about development changes should >>> happen here on lustre-devel. I agree, developers need to be on-board. >>> >>> So what do you think about release changes? What requirements do you >>> have? What issues would you have if OpenSFS changed the major release >>> cadence to nine months? >>> >>> Thanks, >>> >>> -Cory >>> >>> On 11/4/15, 1:58 PM, "lwg on behalf of Christopher J. Morrone" >>> wrote: >>> >>>> On 11/04/2015 10:28 AM, Cory Spitz wrote: >>>> >>>>> Lustre release cadence >>>>> We haven¹t been good about hitting our 6 month schedules >>>>> Cory proposed a 9 month cadence just to recognize reality. Certainly >>>>> pros/cons to any scheme. Should be up for discussion. How/when to >>>>> decide? >>>> >>>> Any development change like that needs to be discussed on lustre-devel. >>>> >>>> Chris >>>> >>>> _______________________________________________ >>>> lwg mailing list >>>> lwg at lists.opensfs.org >>>> http://lists.opensfs.org/listinfo.cgi/lwg-opensfs.org >>> >>> _______________________________________________ >>> lustre-devel mailing list >>> lustre-devel at lists.opensfs.org >>> http://lists.opensfs.org/listinfo.cgi/lustre-devel-opensfs.org >>> >> >> _______________________________________________ >> lustre-devel mailing list >> lustre-devel at lists.lustre.org >> http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org > > . > From shivanib134 at gmail.com Fri Nov 6 16:55:29 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Fri, 6 Nov 2015 22:25:29 +0530 Subject: [lustre-devel] [PATCH] Staging: lustre: dir: Remove wrapper function Message-ID: <1446828929-3742-1-git-send-email-shivanib134@gmail.com> Remove the function ll_check_page() and replace all its calls with the function it wrapped. Signed-off-by: Shivani Bhardwaj --- drivers/staging/lustre/lustre/llite/dir.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 5c9502b..842e6d6 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -239,12 +239,6 @@ static int ll_dir_filler(void *_hash, struct page *page0) return rc; } -static void ll_check_page(struct inode *dir, struct page *page) -{ - /* XXX: check page format later */ - SetPageChecked(page); -} - void ll_release_page(struct page *page, int remove) { kunmap(page); @@ -432,7 +426,8 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash, goto fail; } if (!PageChecked(page)) - ll_check_page(dir, page); + /* XXX: check page format later */ + SetPageChecked(page); if (PageError(page)) { CERROR("page error: "DFID" at %llu: rc %d\n", PFID(ll_inode2fid(dir)), hash, -5); -- 2.1.0 From simmonsja at ornl.gov Sat Nov 7 00:10:09 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Sat, 7 Nov 2015 00:10:09 +0000 Subject: [lustre-devel] Build Dependency Issue in Lustre Mainline Linux In-Reply-To: <563BB5D7.2040506@canonical.com> References: <563BB5D7.2040506@canonical.com> Message-ID: <9c0ab2c280eb401f88d0ffd57ec3987b@EXCHCS32.ornl.gov> >Just did a fresh git pull --rebase and tried to do 'make deb-pkg' with >an Ubuntu config (which enables lustre). I got the following: > >depmod: WARNING: found 2 modules in dependency cycles! >depmod: WARNING: >/home/arges/src/kernel/linux/./debian/tmp/lib/modules/4.3.0+/kernel/drivers/staging/lustre/lnet/lnet/lnet.ko >in dependency cycle! >depmod: WARNING: >/home/arges/src/kernel/linux/./debian/tmp/lib/modules/4.3.0+/kernel/drivers/staging/lustre/lustre/libcfs/libcfs.ko >in dependency cycle! >./scripts/depmod.sh: line 57: 16836 Killed "$DEPMOD" I solved your problem. If you delete IOC_LIBCFS_PING_TEST ioctl case from libcfs/libcfs/module.c it work again. That ioctl has not been is use for some time and it can be removed. What is happening is libcfs_nid2str is being called which requires lnet.ko now. This is a layer violation. I will be sending a patch very shortly. From chris.j.arges at canonical.com Sat Nov 7 00:38:04 2015 From: chris.j.arges at canonical.com (Chris J Arges) Date: Fri, 6 Nov 2015 18:38:04 -0600 Subject: [lustre-devel] Build Dependency Issue in Lustre Mainline Linux In-Reply-To: <9c0ab2c280eb401f88d0ffd57ec3987b@EXCHCS32.ornl.gov> References: <563BB5D7.2040506@canonical.com> <9c0ab2c280eb401f88d0ffd57ec3987b@EXCHCS32.ornl.gov> Message-ID: <563D47EC.6080909@canonical.com> On 11/06/2015 06:10 PM, Simmons, James A. wrote: > >> Just did a fresh git pull --rebase and tried to do 'make deb-pkg' with >> an Ubuntu config (which enables lustre). I got the following: >> >> depmod: WARNING: found 2 modules in dependency cycles! >> depmod: WARNING: >> /home/arges/src/kernel/linux/./debian/tmp/lib/modules/4.3.0+/kernel/drivers/staging/lustre/lnet/lnet/lnet.ko >> in dependency cycle! >> depmod: WARNING: >> /home/arges/src/kernel/linux/./debian/tmp/lib/modules/4.3.0+/kernel/drivers/staging/lustre/lustre/libcfs/libcfs.ko >> in dependency cycle! >> ./scripts/depmod.sh: line 57: 16836 Killed "$DEPMOD" > > I solved your problem. If you delete IOC_LIBCFS_PING_TEST ioctl case from libcfs/libcfs/module.c it work again. > That ioctl has not been is use for some time and it can be removed. What is happening is libcfs_nid2str is being > called which requires lnet.ko now. This is a layer violation. I will be sending a patch very shortly. > Thanks, good to hear. --chris From erblichs at earthlink.net Sat Nov 7 00:46:19 2015 From: erblichs at earthlink.net (Mitchell Erblich) Date: Fri, 6 Nov 2015 16:46:19 -0800 Subject: [lustre-devel] Should we have fewer releases? In-Reply-To: <563D24F2.8050108@llnl.gov> References: <563A6351.4080407@llnl.gov> <563BCDDE.9060103@llnl.gov> <7AE60ED4-FCA4-4263-887B-5DFC8A0866DA@intel.com> <563D24F2.8050108@llnl.gov> Message-ID: <2C17AEE4-DDF8-4279-9D08-38EFBFC34729@earthlink.net> Group, Is their a reason why a person can not be unsubscribed? From morrone2 at llnl.gov Sat Nov 7 01:07:47 2015 From: morrone2 at llnl.gov (Christopher J. Morrone) Date: Fri, 6 Nov 2015 17:07:47 -0800 Subject: [lustre-devel] How do I use mailman? In-Reply-To: <2C17AEE4-DDF8-4279-9D08-38EFBFC34729@earthlink.net> References: <563A6351.4080407@llnl.gov> <563BCDDE.9060103@llnl.gov> <7AE60ED4-FCA4-4263-887B-5DFC8A0866DA@intel.com> <563D24F2.8050108@llnl.gov> <2C17AEE4-DDF8-4279-9D08-38EFBFC34729@earthlink.net> Message-ID: <563D4EE3.3040302@llnl.gov> Mitchell, Anyone that would like to unsubscribe if free to do so. Here is the link to the mailing list's web page: http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org Here are instructions on how to unsubscribe from a mailing list managed by mailman to help you with the process: http://www.gnu.org/software/mailman/mailman-member/node14.html Chris On 11/06/2015 04:46 PM, Mitchell Erblich wrote: > Group, > > Is their a reason why a person can not be unsubscribed? > > > > From gregkh at linuxfoundation.org Sat Nov 7 01:10:48 2015 From: gregkh at linuxfoundation.org (Greg KH) Date: Fri, 6 Nov 2015 17:10:48 -0800 Subject: [lustre-devel] [PATCH v3 2/5] staging: lustre: hash.c: Replace IS_PO2 by is_power_of_2 In-Reply-To: References: Message-ID: <20151107011048.GA7495@kroah.com> On Thu, Oct 29, 2015 at 02:55:50AM +0200, Aya Mahfouz wrote: > Replaces IS_PO2 by is_power_of_2. It is more accurate to use > is_power_of_2 since it returns 1 for numbers that are powers > of 2 only whereas IS_PO2 returns 1 for 0 and numbers that are > powers of 2. > > Reviewed-by: Andreas Dilger > Signed-off-by: Aya Mahfouz > --- > v2: > -changed commit message > -added Andreas Reviewed by tag > v3: > -fixed checkpatch.pl warning > > drivers/staging/lustre/lustre/libcfs/hash.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) This doesn't apply to my tree, can you please refresh it and resend? thanks, greg k-h From gregkh at linuxfoundation.org Sat Nov 7 01:11:09 2015 From: gregkh at linuxfoundation.org (Greg KH) Date: Fri, 6 Nov 2015 17:11:09 -0800 Subject: [lustre-devel] [PATCH v3 5/5] staging: lustre: libcfs.h: remove IS_PO2 and __is_po2 In-Reply-To: <6257d068b94ff8b07a6c756df16325fea0e7536f.1446079745.git.mahfouz.saif.elyazal@gmail.com> References: <6257d068b94ff8b07a6c756df16325fea0e7536f.1446079745.git.mahfouz.saif.elyazal@gmail.com> Message-ID: <20151107011109.GB7495@kroah.com> On Thu, Oct 29, 2015 at 03:00:24AM +0200, Aya Mahfouz wrote: > Removes IS_PO2 and __is_po2 since the uses of IS_PO2 have > been replaced by is_power_of_2 > > Signed-off-by: Aya Mahfouz > --- > v2: > -became patch number 5 in the series > v3: > -no change > > drivers/staging/lustre/include/linux/libcfs/libcfs.h | 7 ------- > 1 file changed, 7 deletions(-) I can't take this yet, as your patch 2/5 didn't apply :( From gregkh at linuxfoundation.org Sat Nov 7 01:12:29 2015 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Fri, 6 Nov 2015 17:12:29 -0800 Subject: [lustre-devel] [PATCH 07/10] staging: lustre: Handle nodemask on UMP machines In-Reply-To: References: <1446662406-4590-7-git-send-email-jsimmons@infradead.org> <201511050801.fy1GmLxM%fengguang.wu@intel.com> Message-ID: <20151107011229.GA14234@kroah.com> On Fri, Nov 06, 2015 at 10:18:17PM +0000, Simmons, James A. wrote: > >All warnings (new ones prefixed by >>): > > > > In file included from include/linux/bitops.h:36:0, > > from drivers/staging/lustre/lustre/libcfs/../../include/linux/libcfs/linux/libcfs.h:44, > > from drivers/staging/lustre/lustre/libcfs/../../include/linux/libcfs/libcfs.h:40, > > from drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c:38: > > drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c: In function 'cfs_cpt_table_alloc': > >>> arch/m68k/include/asm/bitops.h:64:5: warning: passing argument 2 of 'bset_mem_set_bit' from incompatible pointer type > > bset_mem_set_bit(nr, vaddr) : \ > > ^ > >>> drivers/staging/lustre/lustre/libcfs/libcfs_cpu.c:61:3: note: in expansion of macro 'set_bit' > > set_bit(0, &cptab->ctb_nodemask); > > Yep and additional patch exist to fix this. Should I just push the fix for this or drop this patch and create > a new patch that is combo of both fixes. > > BTW Greg this new batch of patches are order independent. Sorry for not pointing that out. The rest of the > patch appear to be okay. Ok, I'll drop this one, and apply the rest, please resend this after you have fixed it up. thanks, greg k-h From gregkh at linuxfoundation.org Sat Nov 7 01:13:32 2015 From: gregkh at linuxfoundation.org (Greg KH) Date: Fri, 6 Nov 2015 17:13:32 -0800 Subject: [lustre-devel] [PATCH] lustre: obdclass: fix sparse warning In-Reply-To: <5635d078.a1ee440a.16126.ffffcaf6@mx.google.com> References: <5635d078.a1ee440a.16126.ffffcaf6@mx.google.com> Message-ID: <20151107011332.GA14291@kroah.com> On Sun, Nov 01, 2015 at 02:12:29PM +0530, Paul Davies C wrote: > Fix the following warning given by sparse: > > drivers/staging/lustre/lustre/obdclass/cl_lock.c:690:5: warning: symbol 'cl_lock_mutex_try' was not declared. Should it be static? > > Signed-off-by: Paul Davies C > --- > drivers/staging/lustre/lustre/obdclass/cl_lock.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c b/drivers/staging/lustre/lustre/obdclass/cl_lock.c > index 5621beb..6f83452 100644 > --- a/drivers/staging/lustre/lustre/obdclass/cl_lock.c > +++ b/drivers/staging/lustre/lustre/obdclass/cl_lock.c > @@ -687,7 +687,7 @@ EXPORT_SYMBOL(cl_lock_mutex_get); > * > * \see cl_lock_mutex_get() > */ > -int cl_lock_mutex_try(const struct lu_env *env, struct cl_lock *lock) > +static int cl_lock_mutex_try(const struct lu_env *env, struct cl_lock *lock) > { > int result; > Someone did this before you did, sorry :( From gregkh at linuxfoundation.org Sat Nov 7 01:16:56 2015 From: gregkh at linuxfoundation.org (Greg KH) Date: Fri, 6 Nov 2015 17:16:56 -0800 Subject: [lustre-devel] [PATCH] staging: lustre: lnet: selftest: Move extern declarations to headers In-Reply-To: <20151105203421.GA12506@amitoj-Inspiron-3542> References: <20151105203421.GA12506@amitoj-Inspiron-3542> Message-ID: <20151107011656.GA4165@kroah.com> On Fri, Nov 06, 2015 at 02:04:21AM +0530, Amitoj Kaur Chawla wrote: > This patch moves extern declarations to respective header files. > > This patch also removes extern keyword from function declarations > since functions have the extern specifier by default. > > Signed-off-by: Amitoj Kaur Chawla Doesn't apply to my staging-testing branch anymore due to patches send before yours :( Please refresh it and resend. thanks, greg k-h From gregkh at linuxfoundation.org Sat Nov 7 03:27:47 2015 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Fri, 6 Nov 2015 19:27:47 -0800 Subject: [lustre-devel] [PATCH] staging: lustre: remove IOC_LIBCFS_PING_TEST ioctl In-Reply-To: <563d5d08.0347370a.f9d83.2af9SMTPIN_ADDED_BROKEN@mx.google.com> References: <563d5d08.0347370a.f9d83.2af9SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: <20151107032747.GA14108@kroah.com> On Fri, Nov 06, 2015 at 09:08:03PM -0500, y at ccs.ornl.gov wrote: > From: James Simmons > > 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 > --- > .../lustre/include/linux/libcfs/libcfs_ioctl.h | 1 - > drivers/staging/lustre/lustre/libcfs/module.c | 17 ----------------- > 2 files changed, 0 insertions(+), 18 deletions(-) You sent me 2 copies of this, which am I supposed to apply? I've dropped both, please resend the correct one. thanks, greg k-h From shraddha.6596 at gmail.com Sat Nov 7 05:46:39 2015 From: shraddha.6596 at gmail.com (Shraddha Barke) Date: Sat, 7 Nov 2015 11:16:39 +0530 Subject: [lustre-devel] [PATCH] Staging: lustre: obd_cksum.h: Remove unused cksum_types_supported_server Message-ID: <1446875199-15537-1-git-send-email-shraddha.6596@gmail.com> cksum_types_supported_server is defined in header file but not used anywhere. Hence remove it. Signed-off-by: Shraddha Barke --- drivers/staging/lustre/lustre/include/obd_cksum.h | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/obd_cksum.h b/drivers/staging/lustre/lustre/include/obd_cksum.h index a0099d7..01db604 100644 --- a/drivers/staging/lustre/lustre/include/obd_cksum.h +++ b/drivers/staging/lustre/lustre/include/obd_cksum.h @@ -133,29 +133,6 @@ static inline cksum_type_t cksum_types_supported_client(void) return ret; } -/* Server uses algos that perform at 50% or better of the Adler */ -static inline cksum_type_t cksum_types_supported_server(void) -{ - int base_speed; - cksum_type_t ret = OBD_CKSUM_ADLER; - - CDEBUG(D_INFO, "Crypto hash speed: crc %d, crc32c %d, adler %d\n", - cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_CRC32)), - cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_CRC32C)), - cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_ADLER))); - - base_speed = cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_ADLER)) / 2; - - if (cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_CRC32C)) >= - base_speed) - ret |= OBD_CKSUM_CRC32C; - if (cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_CRC32)) >= - base_speed) - ret |= OBD_CKSUM_CRC32; - - return ret; -} - /* Select the best checksum algorithm among those supplied in the cksum_types * input. * -- 2.1.4 From oleg.drokin at intel.com Sat Nov 7 08:36:45 2015 From: oleg.drokin at intel.com (Drokin, Oleg) Date: Sat, 7 Nov 2015 08:36:45 +0000 Subject: [lustre-devel] Should we have fewer releases? In-Reply-To: <563D24F2.8050108@llnl.gov> References: <563A6351.4080407@llnl.gov> <563BCDDE.9060103@llnl.gov> <7AE60ED4-FCA4-4263-887B-5DFC8A0866DA@intel.com> <563D24F2.8050108@llnl.gov> Message-ID: <84F441B5-CB1E-4899-BCB1-4A3A25C94B19@intel.com> Hello! On Nov 6, 2015, at 5:08 PM, Christopher J. Morrone wrote: > On 11/06/2015 06:39 AM, Drokin, Oleg wrote: >> Hello! >> >> On Nov 5, 2015, at 4:45 PM, Christopher J. Morrone wrote: >>> On the contrary, we need to go in the opposite direction to achieve those goals. We need to shorten the release cycle and have more frequent releases. I would recommend that we move to to a roughly three month release cycle. Some of the benefits might be: >>> >>> * Less change and accumulate before the release >>> * The penalty for missing a release landing window is reduced when releases are more often >>> * Code reviewers have less pressure to land unfinished and/or insufficiently reviewed and tested code when the penalty is reduced >>> * Less change means less to test and fix at release time >>> * Bug authors are more likely to still remember what they did and participate in cleanup. >>> * Less time before bugs that slip through the cracks appear in a major release >>> * Reduces developer frustration with long freeze windows >>> * Encourages developers to rally more frequently around the landing windows instead of falling into a long period of silence and then trying to shove a bunch of code in just before freeze. (They'll still try to ram things in just before freeze, but with more frequent landing windows the amount will be smaller and more manageable.) >> >> Bringing this to the logical extreme - we should just have one release per major feature. > > It do not agree that it is logical to extend the argument to that extreme. That is the "Appeal to Extremes" logical fallacy. It probably is. But it's sometimes useful still. > I also don't think it is appropriate to conflate major releases with major features. When/if we move to a shorter release cycle, it would be entirely appropriate to put out a major release with no headline "major features". It is totally acceptable to release the many changes that did make it in the landing window. Even if none of the changes individually count as "major", they still collectively represent a major amount of work. Yes, I agree there could be releases with no major new features, though attempts to make them in the past were not met with great enthusiasm. > Right now we combine that major amount of work with seriously destabilizing new features that more than offset all the bug fixing that went on. Why do we insist on making those destabilizing influences a requirement for a release? That's what people want, apparently. Features are developed because there's a need for them. > Whether a major feature makes it into any particular release should be judge primarily on the quality and completeness of code, testing, and documentation for said feature. Further, how many major features can be landed in a release would be gated on the amount of manpower we have for review and testing. If 3 major features are truely complete and ready to land, but we can only fully vet 1 in the landing window, well, only one will land. We'll have to make a judgement call as a community on the priority and work on that. I am skeptical this is going to work. If a feature is perceived to be ready, but is not accepted for whatever reason, those who feel they need it would just find some way of using it anyway. And it would lead to more fragmentation in the end. > In summary: I think we should decouple the concept of major releases and major features. Major releases do not need to be subject to major features. Should there be a period where no new features were developed into the "Ready to include" state, yes - I am all for it. I guess you think this is going to be easier to achieve by shortening time to next release. It's just right now we have such a backlog of features that that might not be a realistic assumption. >> Sadly, I think the stabilization process is not likely to get any shorter. > Do not see a connection between the amount of change and the time it takes to stabilize that change? Can you explain why you think that? Testing (and vetting) takes a fixed time. For large scale community testing we also depend on large systems availability schedule. These do not change. Any problems found would require a retest once the fix is in place. Then there's a backlog of "deferred" bugs that are not deemed super critical, but as number of truly critical bugs goes down, I suspect those bugs from backlog would be viewed as more serious (and I don't think it's a bad thing). Of course I might be all wrong on this, but it's just my feeling. If we take any past Lustre release and add another X months of pure code freeze and stabilization, do you think that particular release would not have benefitted from that? I suspect same is true of (almost?) any other software project. >> Either that or interested parties would only jump into testing when enough of interesting features accumulate, >> after which point there'd be a bunch of bugreports for the current feature plus the backlocd that did not get any significant real-world testing before. We have seen this pattern >> to some degree already even with current releases. > The scary future you paint is no different than our present. Organizations like LLNL only move to new major releases every 18 months at the earliest, and we would really like to run the same version for more like three years in some cases. We are too busy drowning in production Lustre issues half the time to get involved in testing except when it is something that is on our roadmap to put into production. I don't think we're alone. Even if it isn't Lustre issues, everyone has day jobs that keep us busy and time for testing things that don't look immediately relevant to upper management can be difficult to justify. Indeed. I am not painting any scare future, I am just making observations about today. > So I agree, many people already are skipping the testing of many releases and that will continue into the future. > > Frankly, I think that relying on an open source community to do rigorous and systematic testing is foolhardy. The only way that really works is if your user base is large in proportion to the size of your code size and complexity. I would estimate the Lustre is low in that ratio, while something like ZFS is probably medium to large, and Linux is large. > > The testing you get from an open source community is going to be a fairly random in terms of code coverage. In order to the coverage to be reasonably complete, you need _alot_ of people testing. This is very true. We need many more unique environments to extend the coverage. That or finding some way of somehow forcing every possible code path to execute somehow in testing, which is not really realistic. > If we rely on a voluntary, at-will community testing as out primary SQA enforcement method, we are not going to ever put out terribly quality code with something as complex and poorly documented as Lustre. > > Lets not apply the Appeal to Extremes argument to this either. I am not saying that we shouldn't have testing. We absolutely should. We should also strive to make the barriers to testing as low as possible, > and make the opportunities for testing as frequent as reasonble. > > If we have release every three months on a _reliable_ schedule, that will give prospective testers the ability to plan their testing time ahead, increases the probability that each prospective tester will have spare time that aligns with one of our release testing windows. We need all the diverse testing we can get and then some. So there's no disagreement from me here. If you think just by doubling the number of releases gets us double the testing time from community, that alone might be worth it. > All that said, I think you might also be wrong about no one testing the each releases. ORNL has already demonstrated a commitment to try every version. Cray is stepping up testing. I would like to have my team at LLNL become more active on master in the future, and have our testing person worked into the Lustre development cycle. There were releases in the past when this was true for various reasons. >> The releases that are ignored by community for one reason or another tend to be not very stable and then the follow-on release >> gets this "testing debt" baggage that is paid at release time once testing outside of Intel picks up the pace. > > That is a challenge now, and I acknowledge that it will continue to be a challenge in the future. > > Making the releases more frequently and on a reliable schedule is not magic; it will not fix everything about our development process on its own. Nevertheless I do believe that it will be a key supporting element in improving our software development and SQA processes. We just need to ensure the rate at which bugs are introduced is a lot smaller than the rate at which bugs are fixed. ;) And we need to also achieve this without choking new features somehow. Bye, Oleg From shraddha.6596 at gmail.com Sat Nov 7 09:44:24 2015 From: shraddha.6596 at gmail.com (Shraddha Barke) Date: Sat, 7 Nov 2015 15:14:24 +0530 Subject: [lustre-devel] [PATCH] Staging: lustre: lustre_mds: Remove unused md_should_create Message-ID: <1446889464-21260-1-git-send-email-shraddha.6596@gmail.com> md_should_create has been defined in header file but not used. Thus remove it. Signed-off-by: Shraddha Barke --- drivers/staging/lustre/lustre/include/lustre_mds.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_mds.h b/drivers/staging/lustre/lustre/include/lustre_mds.h index a16eb8b..95d27dd 100644 --- a/drivers/staging/lustre/lustre/include/lustre_mds.h +++ b/drivers/staging/lustre/lustre/include/lustre_mds.h @@ -62,12 +62,6 @@ struct mds_group_info { #define MDD_OBD_NAME "mdd_obd" #define MDD_OBD_UUID "mdd_obd_uuid" -static inline int md_should_create(__u64 flags) -{ - return !(flags & MDS_OPEN_DELAY_CREATE || - !(flags & FMODE_WRITE)); -} - /* these are local flags, used only on the client, private */ #define M_CHECK_STALE 0200000000 -- 2.1.4 From mahfouz.saif.elyazal at gmail.com Sat Nov 7 10:03:41 2015 From: mahfouz.saif.elyazal at gmail.com (Aya Mahfouz) Date: Sat, 7 Nov 2015 12:03:41 +0200 Subject: [lustre-devel] [PATCH v3 5/5] staging: lustre: libcfs.h: remove IS_PO2 and __is_po2 In-Reply-To: <20151107011109.GB7495@kroah.com> References: <6257d068b94ff8b07a6c756df16325fea0e7536f.1446079745.git.mahfouz.saif.elyazal@gmail.com> <20151107011109.GB7495@kroah.com> Message-ID: <20151107100341.GA2852@waves> On Fri, Nov 06, 2015 at 05:11:09PM -0800, Greg KH wrote: > On Thu, Oct 29, 2015 at 03:00:24AM +0200, Aya Mahfouz wrote: > > Removes IS_PO2 and __is_po2 since the uses of IS_PO2 have > > been replaced by is_power_of_2 > > > > Signed-off-by: Aya Mahfouz > > --- > > v2: > > -became patch number 5 in the series > > v3: > > -no change > > > > drivers/staging/lustre/include/linux/libcfs/libcfs.h | 7 ------- > > 1 file changed, 7 deletions(-) > > I can't take this yet, as your patch 2/5 didn't apply :( No, problems. I understand that it is hard for these patches to apply as is given that they are quite old. I will recheck if there are new uses of them and resend this patch alone or in another patchset. Thanks, -- Kind Regards, Aya Saif El-yazal Mahfouz From amitoj1606 at gmail.com Sat Nov 7 15:16:33 2015 From: amitoj1606 at gmail.com (Amitoj Kaur Chawla) Date: Sat, 7 Nov 2015 20:46:33 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: obdclass: Move extern declarations to header files Message-ID: <20151107151632.GA7355@amitoj-Inspiron-3542> This patch moves extern declarations to respective header files. This patch also removes extern keyword from function declarations since functions have the extern specifier by default. Signed-off-by: Amitoj Kaur Chawla --- drivers/staging/lustre/lustre/obdclass/cl_internal.h | 3 +++ drivers/staging/lustre/lustre/obdclass/cl_object.c | 2 -- drivers/staging/lustre/lustre/obdclass/class_obd.c | 5 ----- drivers/staging/lustre/lustre/obdclass/llog_internal.h | 7 +++++++ drivers/staging/lustre/lustre/obdclass/obd_config.c | 2 -- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/cl_internal.h b/drivers/staging/lustre/lustre/obdclass/cl_internal.h index 7eb0ad7..a9cc2e2 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_internal.h +++ b/drivers/staging/lustre/lustre/obdclass/cl_internal.h @@ -118,4 +118,7 @@ struct cl_thread_info { struct cl_thread_info *cl_env_info(const struct lu_env *env); +extern __u32 lu_context_tags_default; +extern __u32 lu_session_tags_default; + #endif /* _CL_INTERNAL_H */ diff --git a/drivers/staging/lustre/lustre/obdclass/cl_object.c b/drivers/staging/lustre/lustre/obdclass/cl_object.c index 89ff7f1..a1d76b9 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_object.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_object.c @@ -70,8 +70,6 @@ static struct lock_class_key cl_lock_guard_class; /** Lock class of cl_object_header::coh_attr_guard */ static struct lock_class_key cl_attr_guard_class; -extern __u32 lu_context_tags_default; -extern __u32 lu_session_tags_default; /** * Initialize cl_object_header. */ diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index e8a1558..407354e 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -471,13 +471,9 @@ static int obd_init_checks(void) return ret; } -extern int class_procfs_init(void); -extern int class_procfs_clean(void); - static int __init init_obdclass(void) { int i, err; - int lustre_register_fs(void); LCONSOLE_INFO("Lustre: Build Version: "BUILD_VERSION"\n"); @@ -548,7 +544,6 @@ static int __init init_obdclass(void) static void cleanup_obdclass(void) { int i; - int lustre_unregister_fs(void); lustre_unregister_fs(); diff --git a/drivers/staging/lustre/lustre/obdclass/llog_internal.h b/drivers/staging/lustre/lustre/obdclass/llog_internal.h index b9fe4b0..9f30e01 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_internal.h +++ b/drivers/staging/lustre/lustre/obdclass/llog_internal.h @@ -60,6 +60,13 @@ struct llog_thread_info { }; extern struct lu_context_key llog_thread_key; +int lustre_check_exclusion(struct super_block *sb, char *svname); + +int class_procfs_init(void); +int class_procfs_clean(void); + +int lustre_register_fs(void); +int lustre_unregister_fs(void); int llog_info_init(void); void llog_info_fini(void); diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index b8ca324..6623626 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -1054,8 +1054,6 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars, } EXPORT_SYMBOL(class_process_proc_param); -extern int lustre_check_exclusion(struct super_block *sb, char *svname); - /** Parse a configuration llog, doing various manipulations on them * for various reasons, (modifications for compatibility, skip obsolete * records, change uuids, etc), then class_process_config() resulting -- 1.9.1 From dan.carpenter at oracle.com Sat Nov 7 20:53:50 2015 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Sat, 7 Nov 2015 23:53:50 +0300 Subject: [lustre-devel] [PATCH 07/10] staging: lustre: Handle nodemask on UMP machines In-Reply-To: References: <1446662406-4590-7-git-send-email-jsimmons@infradead.org> <201511050801.fy1GmLxM%fengguang.wu@intel.com> Message-ID: <20151107205350.GL18797@mwanda> The tree has to be git bisectable. Don't break and then fix, send the combo. regards, dan carpenter From shivanib134 at gmail.com Sun Nov 8 09:16:44 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Sun, 8 Nov 2015 14:46:44 +0530 Subject: [lustre-devel] [PATCH 0/2] Remove wrapper functions from workitem Message-ID: This patchset removes unnecessary wrapper functions from the file workitem and replace all their calls with the function that they wrap. After applying this patch, code becomes cleaner. Shivani Bhardwaj (2): staging: lustre: workitem: Remove cfs_wi_sched_lock wrapper staging: lustre: workitem: Remove cfs_wi_sched_unlock wrapper drivers/staging/lustre/lustre/libcfs/workitem.c | 48 ++++++++++--------------- 1 file changed, 18 insertions(+), 30 deletions(-) -- 2.1.0 From shivanib134 at gmail.com Sun Nov 8 09:17:10 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Sun, 8 Nov 2015 14:47:10 +0530 Subject: [lustre-devel] [PATCH 1/2] staging: lustre: workitem: Remove cfs_wi_sched_lock wrapper In-Reply-To: References: Message-ID: <136bf99ca0c65cc577199e26f6fba3182422c7de.1446974107.git.shivanib134@gmail.com> Remove the wrapper function cfs_wi_sched_lock() and replace all its calls with the function it wrapped. Signed-off-by: Shivani Bhardwaj --- drivers/staging/lustre/lustre/libcfs/workitem.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/workitem.c b/drivers/staging/lustre/lustre/libcfs/workitem.c index b57acbf..e8bac9b 100644 --- a/drivers/staging/lustre/lustre/libcfs/workitem.c +++ b/drivers/staging/lustre/lustre/libcfs/workitem.c @@ -87,12 +87,6 @@ static struct cfs_workitem_data { } cfs_wi_data; static inline void -cfs_wi_sched_lock(struct cfs_wi_sched *sched) -{ - spin_lock(&sched->ws_lock); -} - -static inline void cfs_wi_sched_unlock(struct cfs_wi_sched *sched) { spin_unlock(&sched->ws_lock); @@ -101,7 +95,7 @@ cfs_wi_sched_unlock(struct cfs_wi_sched *sched) static inline int cfs_wi_sched_cansleep(struct cfs_wi_sched *sched) { - cfs_wi_sched_lock(sched); + spin_lock(&sched->ws_lock); if (sched->ws_stopping) { cfs_wi_sched_unlock(sched); return 0; @@ -125,7 +119,7 @@ cfs_wi_exit(struct cfs_wi_sched *sched, cfs_workitem_t *wi) LASSERT(!in_interrupt()); /* because we use plain spinlock */ LASSERT(!sched->ws_stopping); - cfs_wi_sched_lock(sched); + spin_lock(&sched->ws_lock); LASSERT(wi->wi_running); if (wi->wi_scheduled) { /* cancel pending schedules */ @@ -161,7 +155,7 @@ cfs_wi_deschedule(struct cfs_wi_sched *sched, cfs_workitem_t *wi) * means the workitem will not be scheduled and will not have * any race with wi_action. */ - cfs_wi_sched_lock(sched); + spin_lock(&sched->ws_lock); rc = !(wi->wi_running); @@ -195,7 +189,7 @@ cfs_wi_schedule(struct cfs_wi_sched *sched, cfs_workitem_t *wi) LASSERT(!in_interrupt()); /* because we use plain spinlock */ LASSERT(!sched->ws_stopping); - cfs_wi_sched_lock(sched); + spin_lock(&sched->ws_lock); if (!wi->wi_scheduled) { LASSERT (list_empty(&wi->wi_list)); @@ -237,7 +231,7 @@ cfs_wi_scheduler (void *arg) spin_unlock(&cfs_wi_data.wi_glock); - cfs_wi_sched_lock(sched); + spin_lock(&sched->ws_lock); while (!sched->ws_stopping) { int nloops = 0; @@ -263,7 +257,7 @@ cfs_wi_scheduler (void *arg) rc = (*wi->wi_action) (wi); - cfs_wi_sched_lock(sched); + spin_lock(&sched->ws_lock); if (rc != 0) /* WI should be dead, even be freed! */ continue; @@ -282,14 +276,14 @@ cfs_wi_scheduler (void *arg) /* don't sleep because some workitems still * expect me to come back soon */ cond_resched(); - cfs_wi_sched_lock(sched); + spin_lock(&sched->ws_lock); continue; } cfs_wi_sched_unlock(sched); rc = wait_event_interruptible_exclusive(sched->ws_waitq, !cfs_wi_sched_cansleep(sched)); - cfs_wi_sched_lock(sched); + spin_lock(&sched->ws_lock); } cfs_wi_sched_unlock(sched); -- 2.1.0 From shivanib134 at gmail.com Sun Nov 8 09:17:34 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Sun, 8 Nov 2015 14:47:34 +0530 Subject: [lustre-devel] [PATCH 2/2] staging: lustre: workitem: Remove cfs_wi_sched_unlock wrapper In-Reply-To: References: Message-ID: <7039ec871e3d3b34c6f6a958d38e14cb87b87761.1446974107.git.shivanib134@gmail.com> Remove the wrapper function cfs_wi_sched_unlock() and replace all its calls with the function it wrapped. Signed-off-by: Shivani Bhardwaj --- drivers/staging/lustre/lustre/libcfs/workitem.c | 26 ++++++++++--------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/workitem.c b/drivers/staging/lustre/lustre/libcfs/workitem.c index e8bac9b..60bb88a 100644 --- a/drivers/staging/lustre/lustre/libcfs/workitem.c +++ b/drivers/staging/lustre/lustre/libcfs/workitem.c @@ -86,26 +86,20 @@ static struct cfs_workitem_data { int wi_stopping; } cfs_wi_data; -static inline void -cfs_wi_sched_unlock(struct cfs_wi_sched *sched) -{ - spin_unlock(&sched->ws_lock); -} - static inline int cfs_wi_sched_cansleep(struct cfs_wi_sched *sched) { spin_lock(&sched->ws_lock); if (sched->ws_stopping) { - cfs_wi_sched_unlock(sched); + spin_unlock(&sched->ws_lock); return 0; } if (!list_empty(&sched->ws_runq)) { - cfs_wi_sched_unlock(sched); + spin_unlock(&sched->ws_lock); return 0; } - cfs_wi_sched_unlock(sched); + spin_unlock(&sched->ws_lock); return 1; } @@ -133,7 +127,7 @@ cfs_wi_exit(struct cfs_wi_sched *sched, cfs_workitem_t *wi) LASSERT(list_empty(&wi->wi_list)); wi->wi_scheduled = 1; /* LBUG future schedule attempts */ - cfs_wi_sched_unlock(sched); + spin_unlock(&sched->ws_lock); return; } @@ -171,7 +165,7 @@ cfs_wi_deschedule(struct cfs_wi_sched *sched, cfs_workitem_t *wi) LASSERT (list_empty(&wi->wi_list)); - cfs_wi_sched_unlock(sched); + spin_unlock(&sched->ws_lock); return rc; } EXPORT_SYMBOL(cfs_wi_deschedule); @@ -205,7 +199,7 @@ cfs_wi_schedule(struct cfs_wi_sched *sched, cfs_workitem_t *wi) } LASSERT (!list_empty(&wi->wi_list)); - cfs_wi_sched_unlock(sched); + spin_unlock(&sched->ws_lock); return; } EXPORT_SYMBOL(cfs_wi_schedule); @@ -252,7 +246,7 @@ cfs_wi_scheduler (void *arg) wi->wi_running = 1; wi->wi_scheduled = 0; - cfs_wi_sched_unlock(sched); + spin_unlock(&sched->ws_lock); nloops++; rc = (*wi->wi_action) (wi); @@ -272,7 +266,7 @@ cfs_wi_scheduler (void *arg) } if (!list_empty(&sched->ws_runq)) { - cfs_wi_sched_unlock(sched); + spin_unlock(&sched->ws_lock); /* don't sleep because some workitems still * expect me to come back soon */ cond_resched(); @@ -280,13 +274,13 @@ cfs_wi_scheduler (void *arg) continue; } - cfs_wi_sched_unlock(sched); + spin_unlock(&sched->ws_lock); rc = wait_event_interruptible_exclusive(sched->ws_waitq, !cfs_wi_sched_cansleep(sched)); spin_lock(&sched->ws_lock); } - cfs_wi_sched_unlock(sched); + spin_unlock(&sched->ws_lock); spin_lock(&cfs_wi_data.wi_glock); sched->ws_nthreads--; -- 2.1.0 From jsimmons at infradead.org Sun Nov 8 16:34:54 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 11:34:54 -0500 Subject: [lustre-devel] [PATCH v2] staging: lustre: remove IOC_LIBCFS_PING_TEST ioctl Message-ID: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> 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 --- .../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 From jsimmons at infradead.org Sun Nov 8 16:34:59 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 11:34:59 -0500 Subject: [lustre-devel] [PATCH] staging: lustre: export cfs_str2mask In-Reply-To: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> References: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447000500-29427-6-git-send-email-jsimmons@infradead.org> 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 --- .../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 From jsimmons at infradead.org Sun Nov 8 16:34:55 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 11:34:55 -0500 Subject: [lustre-devel] [PATCH] staging: lustre: Handle nodemask on UMP machines In-Reply-To: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> References: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447000500-29427-2-git-send-email-jsimmons@infradead.org> 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 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4199 Reviewed-on: http://review.whamcloud.com/9219 Reviewed-by: Liang Zhen Reviewed-by: Li Xi Reviewed-by: Andreas Dilger 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 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4993 Reviewed-on: http://review.whamcloud.com/10332 Reviewed-by: Liang Zhen Reviewed-by: Bob Glossman Reviewed-by: Oleg Drokin --- 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 From jsimmons at infradead.org Sun Nov 8 16:34:56 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 11:34:56 -0500 Subject: [lustre-devel] [PATCH] staging: lustre: add sparse locking annotations In-Reply-To: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> References: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447000500-29427-3-git-send-email-jsimmons@infradead.org> From: frank zago 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 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396 Reviewed-on: http://review.whamcloud.com/11295 Reviewed-by: John L. Hammond Reviewed-by: Patrick Farrell Reviewed-by: Oleg Drokin --- .../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 From jsimmons at infradead.org Sun Nov 8 16:34:57 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 11:34:57 -0500 Subject: [lustre-devel] [PATCH] staging: lustre: added debugging ability for LFSCK In-Reply-To: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> References: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447000500-29427-4-git-send-email-jsimmons@infradead.org> From: Fan Yong Add the ability to debug LFSCK to libcfs. This is broken out of patch http://review.whamcloud.com/6321. Signed-off-by: Fan Yong Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2914 Reviewed-on: http://review.whamcloud.com/6321 Reviewed-by: Alex Zhuravlev Reviewed-by: Andreas Dilger --- .../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 From jsimmons at infradead.org Sun Nov 8 16:35:00 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 11:35:00 -0500 Subject: [lustre-devel] [PATCH] staging: lustre: add libcfs version of cfs_strrstr In-Reply-To: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> References: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447000500-29427-7-git-send-email-jsimmons@infradead.org> From: Fan Yong 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 ntel-bug-id: https://jira.hpdd.intel.com/browse/LU-3951 Reviewed-on: http://review.whamcloud.com/7666 Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin --- .../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 From jsimmons at infradead.org Sun Nov 8 16:34:58 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 11:34:58 -0500 Subject: [lustre-devel] [PATCH] staging: lustre: enum lu_object_header_flags comma style fix In-Reply-To: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> References: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447000500-29427-5-git-send-email-jsimmons@infradead.org> From: Fan Yong 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 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2914 Reviewed-on: http://review.whamcloud.com/6321 Reviewed-by: Alex Zhuravlev Reviewed-by: Andreas Dilger --- 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 From shivanib134 at gmail.com Sun Nov 8 16:52:58 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Sun, 8 Nov 2015 22:22:58 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: mdc_request: Remove mdc_kuc_reregister wrapper Message-ID: <1447001578-4161-1-git-send-email-shivanib134@gmail.com> Remove the wrapper function mdc_kuc_reregister() and replace its call with the function it wrapped. Also, comment has been added for clarity. Signed-off-by: Shivani Bhardwaj --- drivers/staging/lustre/lustre/mdc/mdc_request.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 294c050..e172be1 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -2037,17 +2037,6 @@ static int mdc_hsm_ct_reregister(__u32 data, void *cb_arg) return ((rc != 0) && (rc != -EEXIST)) ? rc : 0; } -/** - * Re-establish all kuc contexts with MDT - * after MDT shutdown/recovery. - */ -static int mdc_kuc_reregister(struct obd_import *imp) -{ - /* re-register HSM agents */ - return libcfs_kkuc_group_foreach(KUC_GRP_HSM, mdc_hsm_ct_reregister, - (void *)imp); -} - static int mdc_set_info_async(const struct lu_env *env, struct obd_export *exp, u32 keylen, void *key, @@ -2210,7 +2199,10 @@ static int mdc_import_event(struct obd_device *obd, struct obd_import *imp, rc = obd_notify_observer(obd, obd, OBD_NOTIFY_ACTIVE, NULL); /* redo the kuc registration after reconnecting */ if (rc == 0) - rc = mdc_kuc_reregister(imp); + /* re-register HSM agents */ + rc = libcfs_kkuc_group_foreach(KUC_GRP_HSM, + mdc_hsm_ct_reregister, + (void *)imp); break; case IMP_EVENT_OCD: rc = obd_notify_observer(obd, obd, OBD_NOTIFY_OCD, NULL); -- 2.1.0 From shivanib134 at gmail.com Sun Nov 8 17:03:46 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Sun, 8 Nov 2015 22:33:46 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: lproc_mgc: Remove unused function mgc_ir_state_seq_show Message-ID: <1447002226-4462-1-git-send-email-shivanib134@gmail.com> Remove the function mgc_ir_state_seq_show() as it is not referenced/called anywhere. Signed-off-by: Shivani Bhardwaj --- drivers/staging/lustre/lustre/mgc/lproc_mgc.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c index 8d5bc5a..ad6a7d9 100644 --- a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c +++ b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c @@ -48,11 +48,6 @@ LPROC_SEQ_FOPS_RO_TYPE(mgc, state); LPROC_SEQ_FOPS_WR_ONLY(mgc, ping); -static int mgc_ir_state_seq_show(struct seq_file *m, void *v) -{ - return lprocfs_mgc_rd_ir_state(m, m->private); -} - LPROC_SEQ_FOPS_RO(mgc_ir_state); static struct lprocfs_vars lprocfs_mgc_obd_vars[] = { -- 2.1.0 From shivanib134 at gmail.com Sun Nov 8 17:11:36 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Sun, 8 Nov 2015 22:41:36 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: lproc_mgc: Remove unused function mgc_ir_state_seq_show In-Reply-To: <1447002226-4462-1-git-send-email-shivanib134@gmail.com> References: <1447002226-4462-1-git-send-email-shivanib134@gmail.com> Message-ID: On Sun, Nov 8, 2015 at 10:33 PM, Shivani Bhardwaj wrote: > Remove the function mgc_ir_state_seq_show() as it is not > referenced/called anywhere. > > Signed-off-by: Shivani Bhardwaj > --- > drivers/staging/lustre/lustre/mgc/lproc_mgc.c | 5 ----- > 1 file changed, 5 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c > index 8d5bc5a..ad6a7d9 100644 > --- a/drivers/staging/lustre/lustre/mgc/lproc_mgc.c > +++ b/drivers/staging/lustre/lustre/mgc/lproc_mgc.c > @@ -48,11 +48,6 @@ LPROC_SEQ_FOPS_RO_TYPE(mgc, state); > > LPROC_SEQ_FOPS_WR_ONLY(mgc, ping); > > -static int mgc_ir_state_seq_show(struct seq_file *m, void *v) > -{ > - return lprocfs_mgc_rd_ir_state(m, m->private); > -} > - > LPROC_SEQ_FOPS_RO(mgc_ir_state); > > static struct lprocfs_vars lprocfs_mgc_obd_vars[] = { > -- > 2.1.0 > I just found out that this is producing errors. Please do not consider this. Thank you Shivani From lkp at intel.com Sun Nov 8 17:19:18 2015 From: lkp at intel.com (kbuild test robot) Date: Mon, 9 Nov 2015 01:19:18 +0800 Subject: [lustre-devel] [PATCH] staging: lustre: lproc_mgc: Remove unused function mgc_ir_state_seq_show In-Reply-To: <1447002226-4462-1-git-send-email-shivanib134@gmail.com> Message-ID: <201511090116.LH4z1Lh1%fengguang.wu@intel.com> Hi Shivani, [auto build test ERROR on: staging/staging-testing] [also build test ERROR on: next-20151106] [cannot apply to: v4.3] url: https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre-lproc_mgc-Remove-unused-function-mgc_ir_state_seq_show/20151109-010718 config: x86_64-allyesconfig (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=x86_64 All error/warnings (new ones prefixed by >>): In file included from drivers/staging/lustre/lustre/mgc/../include/obd_support.h:43:0, from drivers/staging/lustre/lustre/mgc/../include/obd_class.h:39, from drivers/staging/lustre/lustre/mgc/lproc_mgc.c:39: drivers/staging/lustre/lustre/mgc/lproc_mgc.c: In function 'mgc_ir_state_single_open': >> drivers/staging/lustre/lustre/mgc/lproc_mgc.c:51:19: error: 'mgc_ir_state_seq_show' undeclared (first use in this function) LPROC_SEQ_FOPS_RO(mgc_ir_state); ^ drivers/staging/lustre/lustre/mgc/../include/lprocfs_status.h:634:27: note: in definition of macro '__LPROC_SEQ_FOPS' return single_open(file, name##_seq_show, inode->i_private); \ ^ >> drivers/staging/lustre/lustre/mgc/lproc_mgc.c:51:1: note: in expansion of macro 'LPROC_SEQ_FOPS_RO' LPROC_SEQ_FOPS_RO(mgc_ir_state); ^ drivers/staging/lustre/lustre/mgc/lproc_mgc.c:51:19: note: each undeclared identifier is reported only once for each function it appears in LPROC_SEQ_FOPS_RO(mgc_ir_state); ^ drivers/staging/lustre/lustre/mgc/../include/lprocfs_status.h:634:27: note: in definition of macro '__LPROC_SEQ_FOPS' return single_open(file, name##_seq_show, inode->i_private); \ ^ >> drivers/staging/lustre/lustre/mgc/lproc_mgc.c:51:1: note: in expansion of macro 'LPROC_SEQ_FOPS_RO' LPROC_SEQ_FOPS_RO(mgc_ir_state); ^ >> drivers/staging/lustre/lustre/mgc/../include/lprocfs_status.h:632:59: warning: control reaches end of non-void function [-Wreturn-type] static int name##_single_open(struct inode *inode, struct file *file) \ ^ >> drivers/staging/lustre/lustre/mgc/../include/lprocfs_status.h:645:34: note: in expansion of macro '__LPROC_SEQ_FOPS' #define LPROC_SEQ_FOPS_RO(name) __LPROC_SEQ_FOPS(name, NULL) ^ >> drivers/staging/lustre/lustre/mgc/lproc_mgc.c:51:1: note: in expansion of macro 'LPROC_SEQ_FOPS_RO' LPROC_SEQ_FOPS_RO(mgc_ir_state); ^ vim +/mgc_ir_state_seq_show +51 drivers/staging/lustre/lustre/mgc/lproc_mgc.c d7e09d039 Peng Tao 2013-05-02 33 * This file is part of Lustre, http://www.lustre.org/ d7e09d039 Peng Tao 2013-05-02 34 * Lustre is a trademark of Sun Microsystems, Inc. d7e09d039 Peng Tao 2013-05-02 35 */ d7e09d039 Peng Tao 2013-05-02 36 #define DEBUG_SUBSYSTEM S_CLASS d7e09d039 Peng Tao 2013-05-02 37 d7e09d039 Peng Tao 2013-05-02 38 #include 73060ed93 Greg Kroah-Hartman 2014-07-11 @39 #include "../include/obd_class.h" 73060ed93 Greg Kroah-Hartman 2014-07-11 40 #include "../include/lprocfs_status.h" d7e09d039 Peng Tao 2013-05-02 41 #include "mgc_internal.h" d7e09d039 Peng Tao 2013-05-02 42 73bb1da69 Peng Tao 2013-05-29 43 LPROC_SEQ_FOPS_RO_TYPE(mgc, connect_flags); 73bb1da69 Peng Tao 2013-05-29 44 LPROC_SEQ_FOPS_RO_TYPE(mgc, server_uuid); 73bb1da69 Peng Tao 2013-05-29 45 LPROC_SEQ_FOPS_RO_TYPE(mgc, conn_uuid); 73bb1da69 Peng Tao 2013-05-29 46 LPROC_SEQ_FOPS_RO_TYPE(mgc, import); 73bb1da69 Peng Tao 2013-05-29 47 LPROC_SEQ_FOPS_RO_TYPE(mgc, state); 73bb1da69 Peng Tao 2013-05-29 48 73bb1da69 Peng Tao 2013-05-29 49 LPROC_SEQ_FOPS_WR_ONLY(mgc, ping); 73bb1da69 Peng Tao 2013-05-29 50 73bb1da69 Peng Tao 2013-05-29 @51 LPROC_SEQ_FOPS_RO(mgc_ir_state); 73bb1da69 Peng Tao 2013-05-29 52 d7e09d039 Peng Tao 2013-05-02 53 static struct lprocfs_vars lprocfs_mgc_obd_vars[] = { 35b8dfd41 Greg DeAngelis 2014-05-23 54 { "ping", &mgc_ping_fops, NULL, 0222 }, :::::: The code at line 51 was first introduced by commit :::::: 73bb1da692d0dc3e93b9c9e29084d6a5dcbc37a6 staging/lustre: adapt proc_dir_entry change :::::: TO: Peng Tao :::::: CC: Greg Kroah-Hartman --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation -------------- next part -------------- A non-text attachment was scrubbed... Name: .config.gz Type: application/octet-stream Size: 51270 bytes Desc: not available URL: From lkp at intel.com Sun Nov 8 19:10:20 2015 From: lkp at intel.com (kbuild test robot) Date: Mon, 9 Nov 2015 03:10:20 +0800 Subject: [lustre-devel] [PATCH] staging: lustre: lproc_mgc: Remove unused function mgc_ir_state_seq_show In-Reply-To: <1447002226-4462-1-git-send-email-shivanib134@gmail.com> Message-ID: <201511090330.3lmbppa2%fengguang.wu@intel.com> Hi Shivani, [auto build test WARNING on: staging/staging-testing] [also build test WARNING on: next-20151106] [cannot apply to: v4.3] url: https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre-lproc_mgc-Remove-unused-function-mgc_ir_state_seq_show/20151109-010718 config: i386-allyesconfig (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): drivers/staging/lustre/lustre/mgc/lproc_mgc.c: In function 'mgc_ir_state_single_open': drivers/staging/lustre/lustre/mgc/lproc_mgc.c:51:104: error: 'mgc_ir_state_seq_show' undeclared (first use in this function) drivers/staging/lustre/lustre/mgc/lproc_mgc.c:51:104: note: each undeclared identifier is reported only once for each function it appears in >> drivers/staging/lustre/lustre/mgc/lproc_mgc.c:51:65: warning: control reaches end of non-void function [-Wreturn-type] vim +51 drivers/staging/lustre/lustre/mgc/lproc_mgc.c d7e09d039 Peng Tao 2013-05-02 35 */ d7e09d039 Peng Tao 2013-05-02 36 #define DEBUG_SUBSYSTEM S_CLASS d7e09d039 Peng Tao 2013-05-02 37 d7e09d039 Peng Tao 2013-05-02 38 #include 73060ed93 Greg Kroah-Hartman 2014-07-11 39 #include "../include/obd_class.h" 73060ed93 Greg Kroah-Hartman 2014-07-11 40 #include "../include/lprocfs_status.h" d7e09d039 Peng Tao 2013-05-02 41 #include "mgc_internal.h" d7e09d039 Peng Tao 2013-05-02 42 73bb1da69 Peng Tao 2013-05-29 43 LPROC_SEQ_FOPS_RO_TYPE(mgc, connect_flags); 73bb1da69 Peng Tao 2013-05-29 44 LPROC_SEQ_FOPS_RO_TYPE(mgc, server_uuid); 73bb1da69 Peng Tao 2013-05-29 45 LPROC_SEQ_FOPS_RO_TYPE(mgc, conn_uuid); 73bb1da69 Peng Tao 2013-05-29 46 LPROC_SEQ_FOPS_RO_TYPE(mgc, import); 73bb1da69 Peng Tao 2013-05-29 47 LPROC_SEQ_FOPS_RO_TYPE(mgc, state); 73bb1da69 Peng Tao 2013-05-29 48 73bb1da69 Peng Tao 2013-05-29 49 LPROC_SEQ_FOPS_WR_ONLY(mgc, ping); 73bb1da69 Peng Tao 2013-05-29 50 73bb1da69 Peng Tao 2013-05-29 @51 LPROC_SEQ_FOPS_RO(mgc_ir_state); 73bb1da69 Peng Tao 2013-05-29 52 d7e09d039 Peng Tao 2013-05-02 53 static struct lprocfs_vars lprocfs_mgc_obd_vars[] = { 35b8dfd41 Greg DeAngelis 2014-05-23 54 { "ping", &mgc_ping_fops, NULL, 0222 }, 35b8dfd41 Greg DeAngelis 2014-05-23 55 { "connect_flags", &mgc_connect_flags_fops, NULL, 0 }, 35b8dfd41 Greg DeAngelis 2014-05-23 56 { "mgs_server_uuid", &mgc_server_uuid_fops, NULL, 0 }, 35b8dfd41 Greg DeAngelis 2014-05-23 57 { "mgs_conn_uuid", &mgc_conn_uuid_fops, NULL, 0 }, 35b8dfd41 Greg DeAngelis 2014-05-23 58 { "import", &mgc_import_fops, NULL, 0 }, 35b8dfd41 Greg DeAngelis 2014-05-23 59 { "state", &mgc_state_fops, NULL, 0 }, :::::: The code at line 51 was first introduced by commit :::::: 73bb1da692d0dc3e93b9c9e29084d6a5dcbc37a6 staging/lustre: adapt proc_dir_entry change :::::: TO: Peng Tao :::::: CC: Greg Kroah-Hartman --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation -------------- next part -------------- A non-text attachment was scrubbed... Name: .config.gz Type: application/octet-stream Size: 51856 bytes Desc: not available URL: From jsimmons at infradead.org Sun Nov 8 19:17:05 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 14:17:05 -0500 Subject: [lustre-devel] [PATCH 00/13] bring lustre's kernel_comm code up to date Message-ID: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> This patch series brings the kernel_comm code used by Lustre up to the latest verison with various fixes and style improvements which makes the code compliant with the linux kernel standard. Henri Doreau (1): staging: lustre: Prevent duplicate CT registrations Hongchao Zhang (1): staging: lustre: embed kr_data into kkuc_reg James Simmons (8): staging: lustre: kg_sem semaphore handling is incorrectly staging: lustre: convert kernelcomm group to unsigned int staging: lustre: remove unnecessary NULL checks in kernel_comm.c staging: lustre: cleanup block comment style in kernel_comm code staging: lustre: add space around '+' in kernel_comm code staging: lustre: use proper braces in libcfs_kkuc_group_put staging: lustre: return proper error code for libcfs_kkuc_msg_put staging: lustre: cleanup white space in kernel comm code John L. Hammond (1): staging: lustre: remove hsm_nl proc file frank zago (2): staging: lustre: move kernel_user_comm.c from libcfs to lustre staging: lustre: split kernel comm between user and kernel .../staging/lustre/include/linux/libcfs/libcfs.h | 1 - .../staging/lustre/lustre/include/lustre_export.h | 7 ++ .../lustre/lustre/include/lustre_kernelcomm.h | 56 ++++++++++++++ .../include/uapi_kernelcomm.h} | 72 ++++++------------ drivers/staging/lustre/lustre/libcfs/Makefile | 5 +- drivers/staging/lustre/lustre/llite/dir.c | 1 + drivers/staging/lustre/lustre/lmv/lmv_obd.c | 30 ++++++--- drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 77 -------------------- drivers/staging/lustre/lustre/mdc/mdc_request.c | 21 ++++-- drivers/staging/lustre/lustre/obdclass/Makefile | 10 ++-- drivers/staging/lustre/lustre/obdclass/genops.c | 1 + .../kernel_user_comm.c => obdclass/kernelcomm.c} | 76 ++++++++++--------- 12 files changed, 171 insertions(+), 186 deletions(-) create mode 100644 drivers/staging/lustre/lustre/include/lustre_kernelcomm.h rename drivers/staging/lustre/{include/linux/libcfs/libcfs_kernelcomm.h => lustre/include/uapi_kernelcomm.h} (51%) rename drivers/staging/lustre/lustre/{libcfs/kernel_user_comm.c => obdclass/kernelcomm.c} (82%) From jsimmons at infradead.org Sun Nov 8 19:17:13 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 14:17:13 -0500 Subject: [lustre-devel] [PATCH 08/13] staging: lustre: remove unnecessary NULL checks in kernel_comm.c In-Reply-To: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> References: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447010238-25775-9-git-send-email-jsimmons@infradead.org> Fix checkpatch.pl reports of NULL comparison in kernel_comm.c. Signed-off-by: James Simmons --- .../staging/lustre/lustre/obdclass/kernelcomm.c | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c index 1081253..c9405e6 100644 --- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c +++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c @@ -59,7 +59,7 @@ int libcfs_kkuc_msg_put(struct file *filp, void *payload) mm_segment_t fs; int rc = -ENOSYS; - if (filp == NULL || IS_ERR(filp)) + if (!filp || IS_ERR(filp)) return -EBADF; if (kuch->kuc_magic != KUC_MAGIC) { @@ -121,12 +121,12 @@ int libcfs_kkuc_group_add(struct file *filp, int uid, unsigned int group, } /* fput in group_rem */ - if (filp == NULL) + if (!filp) return -EBADF; /* freed in group_rem */ reg = kmalloc(sizeof(*reg) + data_len, 0); - if (reg == NULL) + if (!reg) return -ENOMEM; reg->kr_fp = filp; @@ -134,7 +134,7 @@ int libcfs_kkuc_group_add(struct file *filp, int uid, unsigned int group, memcpy(reg->kr_data, data, data_len); down_write(&kg_sem); - if (kkuc_groups[group].next == NULL) + if (!kkuc_groups[group].next) INIT_LIST_HEAD(&kkuc_groups[group]); list_add(®->kr_chain, &kkuc_groups[group]); up_write(&kg_sem); @@ -149,7 +149,7 @@ int libcfs_kkuc_group_rem(int uid, unsigned int group) { struct kkuc_reg *reg, *next; - if (kkuc_groups[group].next == NULL) + if (!kkuc_groups[group].next) return 0; if (uid == 0) { @@ -169,7 +169,7 @@ int libcfs_kkuc_group_rem(int uid, unsigned int group) list_del(®->kr_chain); CDEBUG(D_KUC, "Removed uid=%d fp=%p from group %d\n", reg->kr_uid, reg->kr_fp, group); - if (reg->kr_fp != NULL) + if (reg->kr_fp) fput(reg->kr_fp); kfree(reg); } @@ -188,7 +188,7 @@ int libcfs_kkuc_group_put(unsigned int group, void *payload) down_write(&kg_sem); list_for_each_entry(reg, &kkuc_groups[group], kr_chain) { - if (reg->kr_fp != NULL) { + if (reg->kr_fp) { rc = libcfs_kkuc_msg_put(reg->kr_fp, payload); if (rc == 0) one_success = 1; @@ -227,12 +227,12 @@ int libcfs_kkuc_group_foreach(unsigned int group, libcfs_kkuc_cb_t cb_func, } /* no link for this group */ - if (kkuc_groups[group].next == NULL) + if (!kkuc_groups[group].next) return 0; down_read(&kg_sem); list_for_each_entry(reg, &kkuc_groups[group], kr_chain) { - if (reg->kr_fp != NULL) + if (reg->kr_fp) rc = cb_func(reg->kr_data, cb_arg); } up_read(&kg_sem); -- 1.7.1 From jsimmons at infradead.org Sun Nov 8 19:17:15 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 14:17:15 -0500 Subject: [lustre-devel] [PATCH 10/13] staging: lustre: add space around '+' in kernel_comm code In-Reply-To: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> References: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447010238-25775-11-git-send-email-jsimmons@infradead.org> Add in missing space arouund '+' in the kernel_comm code. Signed-off-by: James Simmons --- .../lustre/lustre/include/uapi_kernelcomm.h | 2 +- .../staging/lustre/lustre/obdclass/kernelcomm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h b/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h index a8feab6..5ace9f8 100644 --- a/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h +++ b/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h @@ -54,7 +54,7 @@ struct kuc_hdr { __u16 kuc_msglen; } __aligned(sizeof(__u64)); -#define KUC_CHANGELOG_MSG_MAXSIZE (sizeof(struct kuc_hdr)+CR_MAXSIZE) +#define KUC_CHANGELOG_MSG_MAXSIZE (sizeof(struct kuc_hdr) + CR_MAXSIZE) #define KUC_MAGIC 0x191C /*Lustre9etLinC */ diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c index eb5b0be..709b1ab 100644 --- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c +++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c @@ -102,7 +102,7 @@ struct kkuc_reg { char kr_data[0]; }; -static struct list_head kkuc_groups[KUC_GRP_MAX+1] = {}; +static struct list_head kkuc_groups[KUC_GRP_MAX + 1] = {}; /* Protect message sending against remove and adds */ static DECLARE_RWSEM(kg_sem); -- 1.7.1 From jsimmons at infradead.org Sun Nov 8 19:17:16 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 14:17:16 -0500 Subject: [lustre-devel] [PATCH 11/13] staging: lustre: use proper braces in libcfs_kkuc_group_put In-Reply-To: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> References: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447010238-25775-12-git-send-email-jsimmons@infradead.org> Add in missing braces for libcfs_kkuc_group_put();. Signed-off-by: James Simmons --- .../staging/lustre/lustre/obdclass/kernelcomm.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c index 709b1ab..46cb81a 100644 --- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c +++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c @@ -192,9 +192,9 @@ int libcfs_kkuc_group_put(unsigned int group, void *payload) list_for_each_entry(reg, &kkuc_groups[group], kr_chain) { if (reg->kr_fp) { rc = libcfs_kkuc_msg_put(reg->kr_fp, payload); - if (rc == 0) + if (rc == 0) { one_success = 1; - else if (rc == -EPIPE) { + } else if (rc == -EPIPE) { fput(reg->kr_fp); reg->kr_fp = NULL; } -- 1.7.1 From jsimmons at infradead.org Sun Nov 8 19:17:18 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 14:17:18 -0500 Subject: [lustre-devel] [PATCH 13/13] staging: lustre: cleanup white space in kernel comm code In-Reply-To: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> References: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447010238-25775-14-git-send-email-jsimmons@infradead.org> Cleanup the last white space issues in the kernel comm code. Signed-off-by: James Simmons --- .../lustre/lustre/include/uapi_kernelcomm.h | 10 +++++----- .../staging/lustre/lustre/obdclass/kernelcomm.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h b/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h index 5ace9f8..5e99836 100644 --- a/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h +++ b/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h @@ -56,17 +56,17 @@ struct kuc_hdr { #define KUC_CHANGELOG_MSG_MAXSIZE (sizeof(struct kuc_hdr) + CR_MAXSIZE) -#define KUC_MAGIC 0x191C /*Lustre9etLinC */ +#define KUC_MAGIC 0x191C /*Lustre9etLinC */ /* kuc_msgtype values are defined in each transport */ enum kuc_transport_type { - KUC_TRANSPORT_GENERIC = 1, - KUC_TRANSPORT_HSM = 2, - KUC_TRANSPORT_CHANGELOG = 3, + KUC_TRANSPORT_GENERIC = 1, + KUC_TRANSPORT_HSM = 2, + KUC_TRANSPORT_CHANGELOG = 3, }; enum kuc_generic_message_type { - KUC_MSG_SHUTDOWN = 1, + KUC_MSG_SHUTDOWN = 1, }; /* KUC Broadcast Groups. This determines which userspace process hears which diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c index 281cfd6..a2efb08 100644 --- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c +++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c @@ -185,7 +185,7 @@ EXPORT_SYMBOL(libcfs_kkuc_group_rem); int libcfs_kkuc_group_put(unsigned int group, void *payload) { struct kkuc_reg *reg; - int rc = 0; + int rc = 0; int one_success = 0; down_write(&kg_sem); -- 1.7.1 From jsimmons at infradead.org Sun Nov 8 19:17:11 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 14:17:11 -0500 Subject: [lustre-devel] [PATCH 06/13] staging: lustre: embed kr_data into kkuc_reg In-Reply-To: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> References: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447010238-25775-7-git-send-email-jsimmons@infradead.org> From: Hongchao Zhang In struct kkuc_reg, the "kr_data" is difficult to be freed outside of libcfs, then it's better to change it to be inline data instead of the data pointer. Signed-off-by: Hongchao Zhang Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6485 Reviewed-on: http://review.whamcloud.com/14638 Reviewed-by: John L. Hammond Reviewed-by: James Simmons Reviewed-by: frank zago Reviewed-by: Robert Read Reviewed-by: Henri Doreau Reviewed-by: Oleg Drokin --- .../lustre/lustre/include/lustre_kernelcomm.h | 4 +- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 22 ++++++------------- drivers/staging/lustre/lustre/mdc/mdc_request.c | 2 +- .../staging/lustre/lustre/obdclass/kernelcomm.c | 12 ++++------ 4 files changed, 15 insertions(+), 25 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h index bb305f4..235b980 100644 --- a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h +++ b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h @@ -47,8 +47,8 @@ typedef int (*libcfs_kkuc_cb_t)(void *data, void *cb_arg); int libcfs_kkuc_msg_put(struct file *fp, void *payload); int libcfs_kkuc_group_put(int group, void *payload); int libcfs_kkuc_group_add(struct file *fp, int uid, unsigned int group, - void *data); -int libcfs_kkuc_group_rem(int uid, int group, void **pdata); + void *data, size_t data_len); +int libcfs_kkuc_group_rem(int uid, int group); int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func, void *cb_arg); diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 2ad2904..c2c8b72 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -795,7 +795,6 @@ static void lmv_hsm_req_build(struct lmv_obd *lmv, static int lmv_hsm_ct_unregister(struct lmv_obd *lmv, unsigned int cmd, int len, struct lustre_kernelcomm *lk, void *uarg) { - struct kkuc_ct_data *kcd = NULL; int rc = 0; __u32 i; @@ -810,9 +809,7 @@ static int lmv_hsm_ct_unregister(struct lmv_obd *lmv, unsigned int cmd, int len, * Unreached coordinators will get EPIPE on next requests * and will unregister automatically. */ - rc = libcfs_kkuc_group_rem(lk->lk_uid, lk->lk_group, (void **)&kcd); - if (kcd) - kfree(kcd); + rc = libcfs_kkuc_group_rem(lk->lk_uid, lk->lk_group); return rc; } @@ -824,7 +821,7 @@ static int lmv_hsm_ct_register(struct lmv_obd *lmv, unsigned int cmd, int len, __u32 i, j; int err, rc = 0; bool any_set = false; - struct kkuc_ct_data *kcd; + struct kkuc_ct_data kcd = { 0 }; /* All or nothing: try to register to all MDS. * In case of failure, unregister from previous MDS, @@ -864,20 +861,15 @@ static int lmv_hsm_ct_register(struct lmv_obd *lmv, unsigned int cmd, int len, if (!filp) return -EBADF; - kcd = kzalloc(sizeof(*kcd), GFP_NOFS); - if (!kcd) { - fput(filp); - return -ENOMEM; - } - kcd->kcd_magic = KKUC_CT_DATA_MAGIC; - kcd->kcd_uuid = lmv->cluuid; - kcd->kcd_archive = lk->lk_data; + kcd.kcd_magic = KKUC_CT_DATA_MAGIC; + kcd.kcd_uuid = lmv->cluuid; + kcd.kcd_archive = lk->lk_data; - rc = libcfs_kkuc_group_add(filp, lk->lk_uid, lk->lk_group, kcd); + rc = libcfs_kkuc_group_add(filp, lk->lk_uid, lk->lk_group, + &kcd, sizeof(kcd)); if (rc) { if (filp) fput(filp); - kfree(kcd); } return rc; diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index a4c543a..ee1c040 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -2391,7 +2391,7 @@ static int mdc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage) case OBD_CLEANUP_EXPORTS: /* Failsafe, ok if racy */ if (obd->obd_type->typ_refcnt <= 1) - libcfs_kkuc_group_rem(0, KUC_GRP_HSM, NULL); + libcfs_kkuc_group_rem(0, KUC_GRP_HSM); obd_cleanup_client_import(obd); ptlrpc_lprocfs_unregister_obd(obd); diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c index e3f5a3c..e290246 100644 --- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c +++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c @@ -97,7 +97,7 @@ struct kkuc_reg { struct list_head kr_chain; int kr_uid; struct file *kr_fp; - void *kr_data; + char kr_data[0]; }; static struct list_head kkuc_groups[KUC_GRP_MAX+1] = {}; @@ -111,7 +111,7 @@ static DECLARE_RWSEM(kg_sem); * @param data user data */ int libcfs_kkuc_group_add(struct file *filp, int uid, unsigned int group, - void *data) + void *data, size_t data_len) { struct kkuc_reg *reg; @@ -125,13 +125,13 @@ int libcfs_kkuc_group_add(struct file *filp, int uid, unsigned int group, return -EBADF; /* freed in group_rem */ - reg = kmalloc(sizeof(*reg), 0); + reg = kmalloc(sizeof(*reg) + data_len, 0); if (reg == NULL) return -ENOMEM; reg->kr_fp = filp; reg->kr_uid = uid; - reg->kr_data = data; + memcpy(reg->kr_data, data, data_len); down_write(&kg_sem); if (kkuc_groups[group].next == NULL) @@ -145,7 +145,7 @@ int libcfs_kkuc_group_add(struct file *filp, int uid, unsigned int group, } EXPORT_SYMBOL(libcfs_kkuc_group_add); -int libcfs_kkuc_group_rem(int uid, int group, void **pdata) +int libcfs_kkuc_group_rem(int uid, int group) { struct kkuc_reg *reg, *next; @@ -171,8 +171,6 @@ int libcfs_kkuc_group_rem(int uid, int group, void **pdata) reg->kr_uid, reg->kr_fp, group); if (reg->kr_fp != NULL) fput(reg->kr_fp); - if (pdata) - *pdata = reg->kr_data; kfree(reg); } } -- 1.7.1 From jsimmons at infradead.org Sun Nov 8 19:17:09 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 14:17:09 -0500 Subject: [lustre-devel] [PATCH 04/13] staging: lustre: move kernel_user_comm.c from libcfs to lustre In-Reply-To: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> References: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447010238-25775-5-git-send-email-jsimmons@infradead.org> From: frank zago Move the kernel portion from libcfs to obdclass. This code is only used by lustre. This is broken out of the original patch 14270. The part covered by this change is as follows: The original code in kernel_user_comm.c is split into two parts: * obdclass/kernelcomm.c for the kernel part. filp_user_write() was moved there, and linux-fs.c deleted; * liblustreapi_kernelconn.c for the user part. The calls to CDEBUG have been removed, and calls to CERROR have been transformed to llapi_err_noerrno. The type lustre_kernelcomm has been removed and replace by struct lustre_kernelcomm. Various names and filenames have been harmonized to *kernelcomm*. Signed-off-by: frank zago Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: http://review.whamcloud.com/14270 Reviewed-by: Nathan Rutman Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- drivers/staging/lustre/lustre/libcfs/Makefile | 5 ++--- drivers/staging/lustre/lustre/obdclass/Makefile | 10 +++++----- .../kernel_user_comm.c => obdclass/kernelcomm.c} | 0 3 files changed, 7 insertions(+), 8 deletions(-) rename drivers/staging/lustre/lustre/{libcfs/kernel_user_comm.c => obdclass/kernelcomm.c} (100%) diff --git a/drivers/staging/lustre/lustre/libcfs/Makefile b/drivers/staging/lustre/lustre/libcfs/Makefile index 03d3f3d..277c123 100644 --- a/drivers/staging/lustre/lustre/libcfs/Makefile +++ b/drivers/staging/lustre/lustre/libcfs/Makefile @@ -11,8 +11,7 @@ libcfs-linux-objs += linux-mem.o libcfs-linux-objs := $(addprefix linux/,$(libcfs-linux-objs)) libcfs-all-objs := debug.o fail.o module.o tracefile.o \ - libcfs_string.o hash.o kernel_user_comm.o \ - prng.o workitem.o libcfs_cpu.o \ - libcfs_mem.o libcfs_lock.o + libcfs_string.o hash.o prng.o workitem.o \ + libcfs_cpu.o libcfs_mem.o libcfs_lock.o libcfs-objs := $(libcfs-linux-objs) $(libcfs-all-objs) diff --git a/drivers/staging/lustre/lustre/obdclass/Makefile b/drivers/staging/lustre/lustre/obdclass/Makefile index acc6857..c404eb3 100644 --- a/drivers/staging/lustre/lustre/obdclass/Makefile +++ b/drivers/staging/lustre/lustre/obdclass/Makefile @@ -2,8 +2,8 @@ obj-$(CONFIG_LUSTRE_FS) += obdclass.o obdclass-y := linux/linux-module.o linux/linux-obdo.o linux/linux-sysctl.o \ llog.o llog_cat.o llog_obd.o llog_swab.o class_obd.o debug.o \ - genops.o uuid.o lprocfs_status.o \ - lustre_handles.o lustre_peer.o \ - statfs_pack.o obdo.o obd_config.o obd_mount.o \ - lu_object.o cl_object.o \ - cl_page.o cl_lock.o cl_io.o lu_ref.o acl.o lprocfs_counters.o + genops.o uuid.o lprocfs_status.o lprocfs_counters.o \ + lustre_handles.o lustre_peer.o statfs_pack.o \ + obdo.o obd_config.o obd_mount.o lu_object.o lu_ref.o \ + cl_object.o cl_page.o cl_lock.o cl_io.o \ + acl.o kernelcomm.o diff --git a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c similarity index 100% rename from drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c rename to drivers/staging/lustre/lustre/obdclass/kernelcomm.c -- 1.7.1 From jsimmons at infradead.org Sun Nov 8 19:17:08 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 14:17:08 -0500 Subject: [lustre-devel] [PATCH 03/13] staging: lustre: Prevent duplicate CT registrations In-Reply-To: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> References: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447010238-25775-4-git-send-email-jsimmons@infradead.org> From: Henri Doreau Associate copytool registration to a given MDC import so that multiple mounts of the same filesystem do not lead to having the copytool registered multiple time. Signed-off-by: Henri Doreau Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3882 Reviewed-on: http://review.whamcloud.com/7612 Reviewed-by: John L. Hammond Reviewed-by: Jinshan Xiong Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../include/linux/libcfs/libcfs_kernelcomm.h | 6 ++-- .../staging/lustre/lustre/include/lustre_export.h | 7 ++++ .../lustre/lustre/libcfs/kernel_user_comm.c | 15 +++++--- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 39 +++++++++++++++----- drivers/staging/lustre/lustre/mdc/mdc_request.c | 22 +++++++---- 5 files changed, 62 insertions(+), 27 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h index 41f3d81..3a89a3b 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h @@ -77,7 +77,7 @@ enum kuc_generic_message_type { }; /* prototype for callback function on kuc groups */ -typedef int (*libcfs_kkuc_cb_t)(__u32 data, void *cb_arg); +typedef int (*libcfs_kkuc_cb_t)(void *data, void *cb_arg); /* KUC Broadcast Groups. This determines which userspace process hears which * messages. Mutliple transports may be used within a group, or multiple @@ -92,8 +92,8 @@ typedef int (*libcfs_kkuc_cb_t)(__u32 data, void *cb_arg); int libcfs_kkuc_msg_put(struct file *fp, void *payload); int libcfs_kkuc_group_put(int group, void *payload); int libcfs_kkuc_group_add(struct file *fp, int uid, unsigned int group, - __u32 data); -int libcfs_kkuc_group_rem(int uid, int group); + void *data); +int libcfs_kkuc_group_rem(int uid, int group, void **pdata); int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func, void *cb_arg); diff --git a/drivers/staging/lustre/lustre/include/lustre_export.h b/drivers/staging/lustre/lustre/include/lustre_export.h index 1daf4c5..e0a5171 100644 --- a/drivers/staging/lustre/lustre/include/lustre_export.h +++ b/drivers/staging/lustre/lustre/include/lustre_export.h @@ -338,6 +338,13 @@ static inline bool imp_connect_disp_stripe(struct obd_import *imp) struct obd_export *class_conn2export(struct lustre_handle *conn); +#define KKUC_CT_DATA_MAGIC 0x092013cea +struct kkuc_ct_data { + __u32 kcd_magic; + struct obd_uuid kcd_uuid; + __u32 kcd_archive; +}; + /** @} export */ #endif /* __EXPORT_H */ diff --git a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c index 1a052ac..3b4731a 100644 --- a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c +++ b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c @@ -95,10 +95,10 @@ EXPORT_SYMBOL(libcfs_kkuc_msg_put); * group from any fs */ /** A single group registration has a uid and a file pointer */ struct kkuc_reg { - struct list_head kr_chain; - int kr_uid; + struct list_head kr_chain; + int kr_uid; struct file *kr_fp; - __u32 kr_data; + void *kr_data; }; static struct list_head kkuc_groups[KUC_GRP_MAX+1] = {}; @@ -109,9 +109,10 @@ static DECLARE_RWSEM(kg_sem); * @param filp pipe to write into * @param uid identifier for this receiver * @param group group number + * @param data user data */ int libcfs_kkuc_group_add(struct file *filp, int uid, unsigned int group, - __u32 data) + void *data) { struct kkuc_reg *reg; @@ -145,7 +146,7 @@ int libcfs_kkuc_group_add(struct file *filp, int uid, unsigned int group, } EXPORT_SYMBOL(libcfs_kkuc_group_add); -int libcfs_kkuc_group_rem(int uid, int group) +int libcfs_kkuc_group_rem(int uid, int group, void **pdata) { struct kkuc_reg *reg, *next; @@ -171,6 +172,8 @@ int libcfs_kkuc_group_rem(int uid, int group) reg->kr_uid, reg->kr_fp, group); if (reg->kr_fp != NULL) fput(reg->kr_fp); + if (pdata) + *pdata = reg->kr_data; kfree(reg); } } @@ -213,7 +216,7 @@ EXPORT_SYMBOL(libcfs_kkuc_group_put); * Calls a callback function for each link of the given kuc group. * @param group the group to call the function on. * @param cb_func the function to be called. - * @param cb_arg iextra argument to be passed to the callback function. + * @param cb_arg extra argument to be passed to the callback function. */ int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func, void *cb_arg) diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index a4de9a3..8b2ae38 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -794,7 +794,9 @@ static void lmv_hsm_req_build(struct lmv_obd *lmv, static int lmv_hsm_ct_unregister(struct lmv_obd *lmv, unsigned int cmd, int len, struct lustre_kernelcomm *lk, void *uarg) { - int i, rc = 0; + struct kkuc_ct_data *kcd = NULL; + int rc = 0; + __u32 i; /* unregister request (call from llapi_hsm_copytool_fini) */ for (i = 0; i < lmv->desc.ld_tgt_count; i++) { @@ -807,17 +809,21 @@ static int lmv_hsm_ct_unregister(struct lmv_obd *lmv, unsigned int cmd, int len, * Unreached coordinators will get EPIPE on next requests * and will unregister automatically. */ - rc = libcfs_kkuc_group_rem(lk->lk_uid, lk->lk_group); + rc = libcfs_kkuc_group_rem(lk->lk_uid, lk->lk_group, (void **)&kcd); + if (kcd) + kfree(kcd); + return rc; } static int lmv_hsm_ct_register(struct lmv_obd *lmv, unsigned int cmd, int len, struct lustre_kernelcomm *lk, void *uarg) { - struct file *filp; - int i, j, err; - int rc = 0; - bool any_set = false; + struct file *filp; + __u32 i, j; + int err, rc = 0; + bool any_set = false; + struct kkuc_ct_data *kcd; /* All or nothing: try to register to all MDS. * In case of failure, unregister from previous MDS, @@ -854,12 +860,25 @@ static int lmv_hsm_ct_register(struct lmv_obd *lmv, unsigned int cmd, int len, /* at least one registration done, with no failure */ filp = fget(lk->lk_wfd); - if (filp == NULL) { + if (!filp) return -EBADF; - } - rc = libcfs_kkuc_group_add(filp, lk->lk_uid, lk->lk_group, lk->lk_data); - if (rc != 0 && filp != NULL) + + kcd = kzalloc(sizeof(*kcd), GFP_NOFS); + if (!kcd) { fput(filp); + return -ENOMEM; + } + kcd->kcd_magic = KKUC_CT_DATA_MAGIC; + kcd->kcd_uuid = lmv->cluuid; + kcd->kcd_archive = lk->lk_data; + + rc = libcfs_kkuc_group_add(filp, lk->lk_uid, lk->lk_group, kcd); + if (rc) { + if (filp) + fput(filp); + kfree(kcd); + } + return rc; } diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 294c050..b3a237e 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -2020,21 +2020,27 @@ static int mdc_hsm_copytool_send(int len, void *val) /** * callback function passed to kuc for re-registering each HSM copytool * running on MDC, after MDT shutdown/recovery. - * @param data archive id served by the copytool + * @param data copytool registration data * @param cb_arg callback argument (obd_import) */ -static int mdc_hsm_ct_reregister(__u32 data, void *cb_arg) +static int mdc_hsm_ct_reregister(void *data, void *cb_arg) { + struct kkuc_ct_data *kcd = data; struct obd_import *imp = (struct obd_import *)cb_arg; - __u32 archive = data; int rc; - CDEBUG(D_HA, "recover copytool registration to MDT (archive=%#x)\n", - archive); - rc = mdc_ioc_hsm_ct_register(imp, archive); + if (!kcd || kcd->kcd_magic != KKUC_CT_DATA_MAGIC) + return -EPROTO; + + if (!obd_uuid_equals(&kcd->kcd_uuid, &imp->imp_obd->obd_uuid)) + return 0; + + CDEBUG(D_HA, "%s: recover copytool registration to MDT (archive=%#x)\n", + imp->imp_obd->obd_name, kcd->kcd_archive); + rc = mdc_ioc_hsm_ct_register(imp, kcd->kcd_archive); /* ignore error if the copytool is already registered */ - return ((rc != 0) && (rc != -EEXIST)) ? rc : 0; + return (rc == -EEXIST) ? 0 : rc; } /** @@ -2384,7 +2390,7 @@ static int mdc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage) case OBD_CLEANUP_EXPORTS: /* Failsafe, ok if racy */ if (obd->obd_type->typ_refcnt <= 1) - libcfs_kkuc_group_rem(0, KUC_GRP_HSM); + libcfs_kkuc_group_rem(0, KUC_GRP_HSM, NULL); obd_cleanup_client_import(obd); ptlrpc_lprocfs_unregister_obd(obd); -- 1.7.1 From jsimmons at infradead.org Sun Nov 8 19:17:07 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 14:17:07 -0500 Subject: [lustre-devel] [PATCH 02/13] staging: lustre: kg_sem semaphore handling is incorrectly In-Reply-To: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> References: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447010238-25775-3-git-send-email-jsimmons@infradead.org> During the removal of the cfs wrappers the kg_sem semaphore was handled incorrectly. We need to take a write lock when writing data to the kkuc_groups. The libcfs_kkuc_group_foreach needs to only take a read lock. This makes use match the OpenSFS development branch. Signed-off-by: James Simmons --- .../lustre/lustre/libcfs/kernel_user_comm.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c index d8230ae..1a052ac 100644 --- a/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c +++ b/drivers/staging/lustre/lustre/libcfs/kernel_user_comm.c @@ -186,7 +186,7 @@ int libcfs_kkuc_group_put(int group, void *payload) int rc = 0; int one_success = 0; - down_read(&kg_sem); + down_write(&kg_sem); list_for_each_entry(reg, &kkuc_groups[group], kr_chain) { if (reg->kr_fp != NULL) { rc = libcfs_kkuc_msg_put(reg->kr_fp, payload); @@ -198,7 +198,7 @@ int libcfs_kkuc_group_put(int group, void *payload) } } } - up_read(&kg_sem); + up_write(&kg_sem); /* don't return an error if the message has been delivered * at least to one agent */ @@ -230,12 +230,12 @@ int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func, if (kkuc_groups[group].next == NULL) return 0; - down_write(&kg_sem); + down_read(&kg_sem); list_for_each_entry(reg, &kkuc_groups[group], kr_chain) { if (reg->kr_fp != NULL) rc = cb_func(reg->kr_data, cb_arg); } - up_write(&kg_sem); + up_read(&kg_sem); return rc; } -- 1.7.1 From jsimmons at infradead.org Sun Nov 8 19:17:06 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 14:17:06 -0500 Subject: [lustre-devel] [PATCH 01/13] staging: lustre: remove hsm_nl proc file In-Reply-To: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> References: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447010238-25775-2-git-send-email-jsimmons@infradead.org> From: John L. Hammond Remove the file /proc/fs/lustre/mdc/*/hsm_nl which was introduced "for testing purposes." Signed-off-by: John L. Hammond Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2489 Reviewed-on: http://review.whamcloud.com/6656 Reviewed-by: jacques-Charles Lafoucriere Reviewed-by: Aurelien Degremont Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 77 ------------------------- 1 files changed, 0 insertions(+), 77 deletions(-) diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c index 1c95f87..84e5862 100644 --- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c +++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c @@ -82,82 +82,6 @@ static ssize_t max_rpcs_in_flight_store(struct kobject *kobj, } LUSTRE_RW_ATTR(max_rpcs_in_flight); -static int mdc_kuc_open(struct inode *inode, struct file *file) -{ - return single_open(file, NULL, inode->i_private); -} - -/* temporary for testing */ -static ssize_t mdc_kuc_write(struct file *file, - const char __user *buffer, - size_t count, loff_t *off) -{ - struct obd_device *obd = - ((struct seq_file *)file->private_data)->private; - struct kuc_hdr *lh; - struct hsm_action_list *hal; - struct hsm_action_item *hai; - int len; - int fd, rc; - - rc = lprocfs_write_helper(buffer, count, &fd); - if (rc) - return rc; - - if (fd < 0) - return -ERANGE; - CWARN("message to fd %d\n", fd); - - len = sizeof(*lh) + sizeof(*hal) + MTI_NAME_MAXLEN + - /* for mockup below */ 2 * cfs_size_round(sizeof(*hai)); - - lh = kzalloc(len, GFP_NOFS); - if (!lh) - return -ENOMEM; - - lh->kuc_magic = KUC_MAGIC; - lh->kuc_transport = KUC_TRANSPORT_HSM; - lh->kuc_msgtype = HMT_ACTION_LIST; - lh->kuc_msglen = len; - - hal = (struct hsm_action_list *)(lh + 1); - hal->hal_version = HAL_VERSION; - hal->hal_archive_id = 1; - hal->hal_flags = 0; - obd_uuid2fsname(hal->hal_fsname, obd->obd_name, MTI_NAME_MAXLEN); - - /* mock up an action list */ - hal->hal_count = 2; - hai = hai_zero(hal); - hai->hai_action = HSMA_ARCHIVE; - hai->hai_fid.f_oid = 5; - hai->hai_len = sizeof(*hai); - hai = hai_next(hai); - hai->hai_action = HSMA_RESTORE; - hai->hai_fid.f_oid = 10; - hai->hai_len = sizeof(*hai); - - /* This works for either broadcast or unicast to a single fd */ - if (fd == 0) { - rc = libcfs_kkuc_group_put(KUC_GRP_HSM, lh); - } else { - struct file *fp = fget(fd); - - rc = libcfs_kkuc_msg_put(fp, lh); - fput(fp); - } - kfree(lh); - if (rc < 0) - return rc; - return count; -} - -static struct file_operations mdc_kuc_fops = { - .open = mdc_kuc_open, - .write = mdc_kuc_write, - .release = single_release, -}; - LPROC_SEQ_FOPS_WR_ONLY(mdc, ping); LPROC_SEQ_FOPS_RO_TYPE(mdc, connect_flags); @@ -196,7 +120,6 @@ static struct lprocfs_vars lprocfs_mdc_obd_vars[] = { { "timeouts", &mdc_timeouts_fops, NULL, 0 }, { "import", &mdc_import_fops, NULL, 0 }, { "state", &mdc_state_fops, NULL, 0 }, - { "hsm_nl", &mdc_kuc_fops, NULL, 0200 }, { "pinger_recov", &mdc_pinger_recov_fops, NULL, 0 }, { NULL } }; -- 1.7.1 From jsimmons at infradead.org Sun Nov 8 19:17:17 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 14:17:17 -0500 Subject: [lustre-devel] [PATCH 12/13] staging: lustre: return proper error code for libcfs_kkuc_msg_put In-Reply-To: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> References: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447010238-25775-13-git-send-email-jsimmons@infradead.org> The functon libcfs_kkuc_msg_put() returns -ENOSYS which is not correct. Return -ENXIO instead if the kuc header is corrupt. Signed-off-by: James Simmons --- .../staging/lustre/lustre/obdclass/kernelcomm.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c index 46cb81a..281cfd6 100644 --- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c +++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c @@ -57,14 +57,14 @@ int libcfs_kkuc_msg_put(struct file *filp, void *payload) ssize_t count = kuch->kuc_msglen; loff_t offset = 0; mm_segment_t fs; - int rc = -ENOSYS; + int rc = -ENXIO; if (!filp || IS_ERR(filp)) return -EBADF; if (kuch->kuc_magic != KUC_MAGIC) { CERROR("KernelComm: bad magic %x\n", kuch->kuc_magic); - return -ENOSYS; + return rc; } fs = get_fs(); -- 1.7.1 From jsimmons at infradead.org Sun Nov 8 19:17:10 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 14:17:10 -0500 Subject: [lustre-devel] [PATCH 05/13] staging: lustre: split kernel comm between user and kernel In-Reply-To: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> References: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447010238-25775-6-git-send-email-jsimmons@infradead.org> From: frank zago Split the kernel comm header in libcfs into two new headers to handle both kernel space and user space for the lustre layer. This is broken out of the original patch 14270. The part covered by this change is as follows: The original libcfs_kernelcomm.h header is split into three parts: * lustre_kernelcomm.h, a new header for the kernel parts; * uapi_kernelcomm.h, a new header for the data structures shared between userspace and kernelspace; * lustreapi_internal.h receives the private liblustreapi prototypes. Various names and filenames have been harmonized to *kernelcomm*. The unused symbol KUC_FL_BLOCK has been removed. Signed-off-by: frank zago Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245 Reviewed-on: http://review.whamcloud.com/14270 Reviewed-by: Nathan Rutman Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin Signed-off-by: James Simmons --- .../staging/lustre/include/linux/libcfs/libcfs.h | 1 - .../lustre/lustre/include/lustre_kernelcomm.h | 56 ++++++++++++++++++++ .../include/uapi_kernelcomm.h} | 50 ++++------------- drivers/staging/lustre/lustre/llite/dir.c | 1 + drivers/staging/lustre/lustre/lmv/lmv_obd.c | 1 + drivers/staging/lustre/lustre/mdc/mdc_request.c | 1 + drivers/staging/lustre/lustre/obdclass/genops.c | 1 + .../staging/lustre/lustre/obdclass/kernelcomm.c | 5 +- 8 files changed, 74 insertions(+), 42 deletions(-) create mode 100644 drivers/staging/lustre/lustre/include/lustre_kernelcomm.h rename drivers/staging/lustre/{include/linux/libcfs/libcfs_kernelcomm.h => lustre/include/uapi_kernelcomm.h} (62%) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index 4d74e8a..e35f59f 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -122,7 +122,6 @@ void cfs_get_random_bytes(void *buf, int size); #include "libcfs_prim.h" #include "libcfs_time.h" #include "libcfs_string.h" -#include "libcfs_kernelcomm.h" #include "libcfs_workitem.h" #include "libcfs_hash.h" #include "libcfs_fail.h" diff --git a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h new file mode 100644 index 0000000..bb305f4 --- /dev/null +++ b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h @@ -0,0 +1,56 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.gnu.org/licenses/gpl-2.0.html + * + * GPL HEADER END + */ +/* + * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. + * Use is subject to license terms. + * + * Copyright (c) 2013, Intel Corporation. + */ +/* + * This file is part of Lustre, http://www.lustre.org/ + * + * Author: Nathan Rutman + * + * Kernel <-> userspace communication routines. + * The definitions below are used in the kernel and userspace. + */ + +#ifndef __LUSTRE_KERNELCOMM_H__ +#define __LUSTRE_KERNELCOMM_H__ + +/* For declarations shared with userspace */ +#include "uapi_kernelcomm.h" + +/* prototype for callback function on kuc groups */ +typedef int (*libcfs_kkuc_cb_t)(void *data, void *cb_arg); + +/* Kernel methods */ +int libcfs_kkuc_msg_put(struct file *fp, void *payload); +int libcfs_kkuc_group_put(int group, void *payload); +int libcfs_kkuc_group_add(struct file *fp, int uid, unsigned int group, + void *data); +int libcfs_kkuc_group_rem(int uid, int group, void **pdata); +int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func, + void *cb_arg); + +#endif /* __LUSTRE_KERNELCOMM_H__ */ + diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h b/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h similarity index 62% rename from drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h rename to drivers/staging/lustre/lustre/include/uapi_kernelcomm.h index 3a89a3b..5e0b8de 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_kernelcomm.h +++ b/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h @@ -15,37 +15,29 @@ * * You should have received a copy of the GNU General Public License * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. + * http://www.gnu.org/licenses/gpl-2.0.html * * GPL HEADER END */ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2013, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. * * Author: Nathan Rutman * - * libcfs/include/libcfs/libcfs_kernelcomm.h - * * Kernel <-> userspace communication routines. * The definitions below are used in the kernel and userspace. - * */ -#ifndef __LIBCFS_KERNELCOMM_H__ -#define __LIBCFS_KERNELCOMM_H__ +#ifndef __UAPI_KERNELCOMM_H__ +#define __UAPI_KERNELCOMM_H__ -#ifndef __LIBCFS_LIBCFS_H__ -#error Do not #include this file directly. #include instead -#endif +#include /* KUC message header. * All current and future KUC messages should use this header. @@ -63,7 +55,6 @@ struct kuc_hdr { #define KUC_CHANGELOG_MSG_MAXSIZE (sizeof(struct kuc_hdr)+CR_MAXSIZE) #define KUC_MAGIC 0x191C /*Lustre9etLinC */ -#define KUC_FL_BLOCK 0x01 /* Wait for send */ /* kuc_msgtype values are defined in each transport */ enum kuc_transport_type { @@ -76,43 +67,26 @@ enum kuc_generic_message_type { KUC_MSG_SHUTDOWN = 1, }; -/* prototype for callback function on kuc groups */ -typedef int (*libcfs_kkuc_cb_t)(void *data, void *cb_arg); - /* KUC Broadcast Groups. This determines which userspace process hears which * messages. Mutliple transports may be used within a group, or multiple * groups may use the same transport. Broadcast * groups need not be used if e.g. a UID is specified instead; * use group 0 to signify unicast. */ -#define KUC_GRP_HSM 0x02 -#define KUC_GRP_MAX KUC_GRP_HSM - -/* Kernel methods */ -int libcfs_kkuc_msg_put(struct file *fp, void *payload); -int libcfs_kkuc_group_put(int group, void *payload); -int libcfs_kkuc_group_add(struct file *fp, int uid, unsigned int group, - void *data); -int libcfs_kkuc_group_rem(int uid, int group, void **pdata); -int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func, - void *cb_arg); +#define KUC_GRP_HSM 0x02 +#define KUC_GRP_MAX KUC_GRP_HSM #define LK_FLG_STOP 0x01 +#define LK_NOFD -1U /* kernelcomm control structure, passed from userspace to kernel */ -typedef struct lustre_kernelcomm { +struct lustre_kernelcomm { __u32 lk_wfd; __u32 lk_rfd; __u32 lk_uid; __u32 lk_group; __u32 lk_data; __u32 lk_flags; -} __packed lustre_kernelcomm; - -/* Userspace methods */ -int libcfs_ukuc_start(lustre_kernelcomm *l, int groups); -int libcfs_ukuc_stop(lustre_kernelcomm *l); -int libcfs_ukuc_msg_get(lustre_kernelcomm *l, char *buf, int maxsize, - int transport); +} __packed; -#endif /* __LIBCFS_KERNELCOMM_H__ */ +#endif /* __UAPI_KERNELCOMM_H__ */ diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 5c2ef92..70c4fe8 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -55,6 +55,7 @@ #include "../include/lustre_lite.h" #include "../include/lustre_dlm.h" #include "../include/lustre_fid.h" +#include "../include/lustre_kernelcomm.h" #include "llite_internal.h" /* diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index 8b2ae38..2ad2904 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -53,6 +53,7 @@ #include "../include/lprocfs_status.h" #include "../include/lustre_lite.h" #include "../include/lustre_fid.h" +#include "../include/lustre_kernelcomm.h" #include "lmv_internal.h" static void lmv_activate_target(struct lmv_obd *lmv, diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index b3a237e..a4c543a 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -48,6 +48,7 @@ #include "../include/lprocfs_status.h" #include "../include/lustre_param.h" #include "../include/lustre_log.h" +#include "../include/lustre_kernelcomm.h" #include "mdc_internal.h" diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index 26f54f9..6c0e3c1 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -42,6 +42,7 @@ #define DEBUG_SUBSYSTEM S_CLASS #include "../include/obd_class.h" #include "../include/lprocfs_status.h" +#include "../include/lustre_kernelcomm.h" spinlock_t obd_types_lock; diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c index 3b4731a..e3f5a3c 100644 --- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c +++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c @@ -42,9 +42,8 @@ #define DEBUG_SUBSYSTEM S_CLASS #define D_KUC D_OTHER -#include "../../include/linux/libcfs/libcfs.h" - -/* This is the kernel side (liblustre as well). */ +#include "../include/obd_support.h" +#include "../include/lustre_kernelcomm.h" /** * libcfs_kkuc_msg_put - send an message from kernel to userspace -- 1.7.1 From jsimmons at infradead.org Sun Nov 8 19:17:12 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 14:17:12 -0500 Subject: [lustre-devel] [PATCH 07/13] staging: lustre: convert kernelcomm group to unsigned int In-Reply-To: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> References: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447010238-25775-8-git-send-email-jsimmons@infradead.org> The group variable was converted to an unsigned int in libcfs_kkuc_group_add() to avoid a potential overflow. The variable group is used in other kernelcomm functions so it makes sense to convert the rest of the group variables to unsigned int. Signed-off-by: James Simmons --- .../lustre/lustre/include/lustre_kernelcomm.h | 6 +++--- .../staging/lustre/lustre/obdclass/kernelcomm.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h index 235b980..14bad00 100644 --- a/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h +++ b/drivers/staging/lustre/lustre/include/lustre_kernelcomm.h @@ -45,11 +45,11 @@ typedef int (*libcfs_kkuc_cb_t)(void *data, void *cb_arg); /* Kernel methods */ int libcfs_kkuc_msg_put(struct file *fp, void *payload); -int libcfs_kkuc_group_put(int group, void *payload); +int libcfs_kkuc_group_put(unsigned int group, void *payload); int libcfs_kkuc_group_add(struct file *fp, int uid, unsigned int group, void *data, size_t data_len); -int libcfs_kkuc_group_rem(int uid, int group); -int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func, +int libcfs_kkuc_group_rem(int uid, unsigned int group); +int libcfs_kkuc_group_foreach(unsigned int group, libcfs_kkuc_cb_t cb_func, void *cb_arg); #endif /* __LUSTRE_KERNELCOMM_H__ */ diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c index e290246..1081253 100644 --- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c +++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c @@ -145,7 +145,7 @@ int libcfs_kkuc_group_add(struct file *filp, int uid, unsigned int group, } EXPORT_SYMBOL(libcfs_kkuc_group_add); -int libcfs_kkuc_group_rem(int uid, int group) +int libcfs_kkuc_group_rem(int uid, unsigned int group) { struct kkuc_reg *reg, *next; @@ -180,7 +180,7 @@ int libcfs_kkuc_group_rem(int uid, int group) } EXPORT_SYMBOL(libcfs_kkuc_group_rem); -int libcfs_kkuc_group_put(int group, void *payload) +int libcfs_kkuc_group_put(unsigned int group, void *payload) { struct kkuc_reg *reg; int rc = 0; @@ -215,7 +215,7 @@ EXPORT_SYMBOL(libcfs_kkuc_group_put); * @param cb_func the function to be called. * @param cb_arg extra argument to be passed to the callback function. */ -int libcfs_kkuc_group_foreach(int group, libcfs_kkuc_cb_t cb_func, +int libcfs_kkuc_group_foreach(unsigned int group, libcfs_kkuc_cb_t cb_func, void *cb_arg) { struct kkuc_reg *reg; -- 1.7.1 From jsimmons at infradead.org Sun Nov 8 19:17:14 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 14:17:14 -0500 Subject: [lustre-devel] [PATCH 09/13] staging: lustre: cleanup block comment style in kernel_comm code In-Reply-To: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> References: <1447010238-25775-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447010238-25775-10-git-send-email-jsimmons@infradead.org> Fixup the comments to the linux kernel style for the source and headers related to the kernel_comm work. Signed-off-by: James Simmons --- .../lustre/lustre/include/uapi_kernelcomm.h | 10 ++++++---- .../staging/lustre/lustre/obdclass/kernelcomm.c | 12 ++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h b/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h index 5e0b8de..a8feab6 100644 --- a/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h +++ b/drivers/staging/lustre/lustre/include/uapi_kernelcomm.h @@ -45,11 +45,13 @@ */ struct kuc_hdr { __u16 kuc_magic; - __u8 kuc_transport; /* Each new Lustre feature should use a different - transport */ + /* Each new Lustre feature should use a different transport */ + __u8 kuc_transport; __u8 kuc_flags; - __u16 kuc_msgtype; /* Message type or opcode, transport-specific */ - __u16 kuc_msglen; /* Including header */ + /* Message type or opcode, transport-specific */ + __u16 kuc_msgtype; + /* Including header */ + __u16 kuc_msglen; } __aligned(sizeof(__u64)); #define KUC_CHANGELOG_MSG_MAXSIZE (sizeof(struct kuc_hdr)+CR_MAXSIZE) diff --git a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c index c9405e6..eb5b0be 100644 --- a/drivers/staging/lustre/lustre/obdclass/kernelcomm.c +++ b/drivers/staging/lustre/lustre/obdclass/kernelcomm.c @@ -89,9 +89,11 @@ int libcfs_kkuc_msg_put(struct file *filp, void *payload) } EXPORT_SYMBOL(libcfs_kkuc_msg_put); -/* Broadcast groups are global across all mounted filesystems; +/* + * Broadcast groups are global across all mounted filesystems; * i.e. registering for a group on 1 fs will get messages for that - * group from any fs */ + * group from any fs + */ /** A single group registration has a uid and a file pointer */ struct kkuc_reg { struct list_head kr_chain; @@ -200,8 +202,10 @@ int libcfs_kkuc_group_put(unsigned int group, void *payload) } up_write(&kg_sem); - /* don't return an error if the message has been delivered - * at least to one agent */ + /* + * don't return an error if the message has been delivered + * at least to one agent + */ if (one_success) rc = 0; -- 1.7.1 From jsimmons at infradead.org Sun Nov 8 23:09:36 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 18:09:36 -0500 Subject: [lustre-devel] [PATCH] staging: lustre: remove unnecessary EXPORT_SYMBOL for lnet layer Message-ID: <1447024177-2219-1-git-send-email-jsimmons@infradead.org> From: frank zago A lot of symbols don't need to be exported at all because they are only used in the module they belong to. Signed-off-by: frank zago Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5829 Reviewed-on: http://review.whamcloud.com/13320 Reviewed-by: James Simmons Reviewed-by: Isaac Huang Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/api-ni.c | 3 --- drivers/staging/lustre/lnet/lnet/lib-move.c | 1 - drivers/staging/lustre/lnet/selftest/conctl.c | 2 -- 3 files changed, 0 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 284150f..9f78dc8 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -354,7 +354,6 @@ lnet_counters_reset(void) lnet_net_unlock(LNET_LOCK_EX); } -EXPORT_SYMBOL(lnet_counters_reset); static char * lnet_res_type2str(int type) @@ -1153,7 +1152,6 @@ lnet_init(void) lnet_register_lnd(&the_lolnd); return 0; } -EXPORT_SYMBOL(lnet_init); /** * Finalize LNet library. @@ -1177,7 +1175,6 @@ lnet_fini(void) the_lnet.ln_init = 0; } -EXPORT_SYMBOL(lnet_fini); /** * Set LNet PID and start LNet interfaces, routing, and forwarding. diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index 5631f60..03a721e 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -1645,7 +1645,6 @@ lnet_msgtyp2str(int type) return ""; } } -EXPORT_SYMBOL(lnet_msgtyp2str); void lnet_print_hdr(lnet_hdr_t *hdr) diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c index 556c837..a534665 100644 --- a/drivers/staging/lustre/lnet/selftest/conctl.c +++ b/drivers/staging/lustre/lnet/selftest/conctl.c @@ -925,5 +925,3 @@ out: return rc; } - -EXPORT_SYMBOL(lstcon_ioctl_entry); -- 1.7.1 From jsimmons at infradead.org Sun Nov 8 23:09:37 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 18:09:37 -0500 Subject: [lustre-devel] [PATCH] staging: lustre: update Intel copyright messages 2015 In-Reply-To: <1447024177-2219-1-git-send-email-jsimmons@infradead.org> References: <1447024177-2219-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447024177-2219-2-git-send-email-jsimmons@infradead.org> From: Andreas Dilger Update copyright messages in files modified by Intel employees in 2015 by non-trivial patches. Exclude patches that are only deleting code, renaming functions, or adding or removing whitespace. Signed-off-by: Andreas Dilger Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7243 Reviewed-on: http://review.whamcloud.com/16758 Reviewed-by: James Nunez Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- .../staging/lustre/include/linux/libcfs/libcfs.h | 2 +- .../lustre/include/linux/libcfs/libcfs_cpu.h | 3 ++- .../lustre/include/linux/libcfs/libcfs_hash.h | 2 +- .../staging/lustre/include/linux/lnet/lib-lnet.h | 2 +- .../staging/lustre/include/linux/lnet/lib-types.h | 2 +- drivers/staging/lustre/include/linux/lnet/nidstr.h | 2 +- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 2 +- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h | 2 +- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c | 2 +- .../staging/lustre/lnet/klnds/socklnd/socklnd.c | 2 +- drivers/staging/lustre/lnet/lnet/acceptor.c | 2 +- drivers/staging/lustre/lnet/lnet/api-ni.c | 2 +- drivers/staging/lustre/lnet/lnet/config.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-move.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-ptl.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-socket.c | 2 +- drivers/staging/lustre/lnet/lnet/module.c | 2 +- drivers/staging/lustre/lnet/lnet/router.c | 2 +- drivers/staging/lustre/lnet/selftest/brw_test.c | 2 +- drivers/staging/lustre/lnet/selftest/rpc.c | 2 +- drivers/staging/lustre/lustre/fid/fid_request.c | 2 +- drivers/staging/lustre/lustre/fid/lproc_fid.c | 2 +- drivers/staging/lustre/lustre/fld/fld_internal.h | 2 +- drivers/staging/lustre/lustre/fld/fld_request.c | 2 +- drivers/staging/lustre/lustre/fld/lproc_fld.c | 2 +- drivers/staging/lustre/lustre/include/cl_object.h | 2 +- .../staging/lustre/lustre/include/lprocfs_status.h | 2 +- drivers/staging/lustre/lustre/include/lu_object.h | 2 +- .../lustre/lustre/include/lustre/ll_fiemap.h | 2 ++ .../lustre/lustre/include/lustre/lustre_idl.h | 2 +- .../lustre/lustre/include/lustre/lustre_user.h | 2 +- drivers/staging/lustre/lustre/include/lustre_dlm.h | 2 +- .../staging/lustre/lustre/include/lustre_export.h | 2 +- drivers/staging/lustre/lustre/include/lustre_fid.h | 2 +- drivers/staging/lustre/lustre/include/lustre_fld.h | 2 +- drivers/staging/lustre/lustre/include/lustre_ha.h | 2 +- drivers/staging/lustre/lustre/include/lustre_log.h | 2 +- drivers/staging/lustre/lustre/include/lustre_net.h | 2 +- .../staging/lustre/lustre/include/lustre_param.h | 2 +- .../lustre/lustre/include/lustre_req_layout.h | 2 +- drivers/staging/lustre/lustre/include/obd.h | 2 +- drivers/staging/lustre/lustre/include/obd_class.h | 2 +- .../staging/lustre/lustre/include/obd_support.h | 2 +- drivers/staging/lustre/lustre/lclient/lcommon_cl.c | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_lib.c | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_lock.c | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 2 +- drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 2 +- drivers/staging/lustre/lustre/libcfs/fail.c | 2 +- drivers/staging/lustre/lustre/libcfs/libcfs_lock.c | 2 +- .../staging/lustre/lustre/libcfs/libcfs_string.c | 2 +- .../staging/lustre/lustre/libcfs/linux/linux-cpu.c | 3 ++- .../lustre/lustre/libcfs/linux/linux-curproc.c | 2 +- drivers/staging/lustre/lustre/libcfs/module.c | 2 +- drivers/staging/lustre/lustre/llite/dcache.c | 2 +- drivers/staging/lustre/lustre/llite/dir.c | 2 +- drivers/staging/lustre/lustre/llite/file.c | 2 +- .../staging/lustre/lustre/llite/llite_internal.h | 2 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +- drivers/staging/lustre/lustre/llite/llite_mmap.c | 2 +- drivers/staging/lustre/lustre/llite/lproc_llite.c | 2 +- drivers/staging/lustre/lustre/llite/namei.c | 2 +- drivers/staging/lustre/lustre/llite/rw.c | 2 +- drivers/staging/lustre/lustre/llite/statahead.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_dev.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_internal.h | 2 ++ drivers/staging/lustre/lustre/llite/vvp_io.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_lock.c | 2 ++ drivers/staging/lustre/lustre/llite/vvp_object.c | 2 +- drivers/staging/lustre/lustre/llite/vvp_page.c | 2 +- drivers/staging/lustre/lustre/llite/xattr.c | 2 +- drivers/staging/lustre/lustre/llite/xattr_cache.c | 2 ++ drivers/staging/lustre/lustre/lmv/lmv_intent.c | 2 +- drivers/staging/lustre/lustre/lmv/lmv_internal.h | 2 +- drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 +- .../staging/lustre/lustre/lov/lov_cl_internal.h | 2 +- drivers/staging/lustre/lustre/lov/lov_dev.c | 2 +- drivers/staging/lustre/lustre/lov/lov_ea.c | 2 +- drivers/staging/lustre/lustre/lov/lov_internal.h | 2 +- drivers/staging/lustre/lustre/lov/lov_io.c | 2 +- drivers/staging/lustre/lustre/lov/lov_merge.c | 2 +- drivers/staging/lustre/lustre/lov/lov_obd.c | 2 +- drivers/staging/lustre/lustre/lov/lov_object.c | 2 +- drivers/staging/lustre/lustre/lov/lov_offset.c | 2 +- drivers/staging/lustre/lustre/lov/lov_pack.c | 2 +- drivers/staging/lustre/lustre/lov/lov_page.c | 2 +- drivers/staging/lustre/lustre/lov/lov_request.c | 2 +- drivers/staging/lustre/lustre/lov/lovsub_dev.c | 2 ++ drivers/staging/lustre/lustre/lov/lovsub_object.c | 2 +- drivers/staging/lustre/lustre/lov/lproc_lov.c | 2 +- drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_internal.h | 2 +- drivers/staging/lustre/lustre/mdc/mdc_lib.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_locks.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_reint.c | 2 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 2 +- drivers/staging/lustre/lustre/mgc/mgc_request.c | 2 +- drivers/staging/lustre/lustre/obdclass/cl_io.c | 2 +- drivers/staging/lustre/lustre/obdclass/cl_object.c | 2 +- drivers/staging/lustre/lustre/obdclass/cl_page.c | 2 +- drivers/staging/lustre/lustre/obdclass/class_obd.c | 2 +- drivers/staging/lustre/lustre/obdclass/genops.c | 2 +- .../lustre/lustre/obdclass/linux/linux-sysctl.c | 2 +- drivers/staging/lustre/lustre/obdclass/llog.c | 2 +- drivers/staging/lustre/lustre/obdclass/llog_cat.c | 2 +- .../staging/lustre/lustre/obdclass/llog_internal.h | 2 +- drivers/staging/lustre/lustre/obdclass/llog_obd.c | 2 +- drivers/staging/lustre/lustre/obdclass/llog_swab.c | 2 +- .../lustre/lustre/obdclass/lprocfs_status.c | 2 +- drivers/staging/lustre/lustre/obdclass/lu_object.c | 2 +- .../staging/lustre/lustre/obdclass/obd_config.c | 2 +- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 2 +- .../staging/lustre/lustre/obdecho/echo_client.c | 2 +- drivers/staging/lustre/lustre/osc/lproc_osc.c | 2 +- drivers/staging/lustre/lustre/osc/osc_cache.c | 2 +- .../staging/lustre/lustre/osc/osc_cl_internal.h | 2 +- drivers/staging/lustre/lustre/osc/osc_dev.c | 2 +- drivers/staging/lustre/lustre/osc/osc_internal.h | 2 +- drivers/staging/lustre/lustre/osc/osc_io.c | 2 +- drivers/staging/lustre/lustre/osc/osc_lock.c | 2 +- drivers/staging/lustre/lustre/osc/osc_object.c | 2 +- drivers/staging/lustre/lustre/osc/osc_page.c | 2 +- drivers/staging/lustre/lustre/osc/osc_quota.c | 2 +- drivers/staging/lustre/lustre/osc/osc_request.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/client.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/events.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/import.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/layout.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/llog_client.c | 2 +- .../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/niobuf.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/pers.c | 2 ++ drivers/staging/lustre/lustre/ptlrpc/pinger.c | 2 +- .../staging/lustre/lustre/ptlrpc/ptlrpc_internal.h | 2 +- drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/recover.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_config.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_plain.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/service.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/wiretest.c | 2 +- 144 files changed, 152 insertions(+), 138 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index 4d74e8a..049f6a9 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h index 7878678..1530b04 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_cpu.h @@ -22,7 +22,8 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, Intel Corporation. + * + * Copyright (c) 2012, 2015 Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h index f14db92..c3f2332 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015 Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index b61d504..b67a660 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -23,7 +23,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012 - 2015, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index d792c4a..3bb9468 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -23,7 +23,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012 - 2015, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/include/linux/lnet/nidstr.h b/drivers/staging/lustre/include/linux/lnet/nidstr.h index 46ad914..4fc9ddc 100644 --- a/drivers/staging/lustre/include/linux/lnet/nidstr.h +++ b/drivers/staging/lustre/include/linux/lnet/nidstr.h @@ -23,7 +23,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011 - 2015, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ #ifndef _LNET_NIDSTRINGS_H #define _LNET_NIDSTRINGS_H diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index de0f85f..72af486 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h index 5f78b42..55bf30d 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.h @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c index 8989e36..3389688 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c index ebde036..05aa90e 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c b/drivers/staging/lustre/lnet/lnet/acceptor.c index 92ca1dd..fed57d9 100644 --- a/drivers/staging/lustre/lnet/lnet/acceptor.c +++ b/drivers/staging/lustre/lnet/lnet/acceptor.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 284150f..41e0a91 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c index 5390ee9..284a3c2 100644 --- a/drivers/staging/lustre/lnet/lnet/config.c +++ b/drivers/staging/lustre/lnet/lnet/config.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index 5631f60..919410d 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c b/drivers/staging/lustre/lnet/lnet/lib-ptl.c index b4f573a..bd7b071 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c +++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c @@ -21,7 +21,7 @@ * GPL HEADER END */ /* - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lnet/lnet/lib-socket.c b/drivers/staging/lustre/lnet/lnet/lib-socket.c index 6f7ef4c..589ecc8 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-socket.c +++ b/drivers/staging/lustre/lnet/lnet/lib-socket.c @@ -23,7 +23,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, 2015 Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lnet/lnet/module.c b/drivers/staging/lustre/lnet/lnet/module.c index ac2fdf0..c93c007 100644 --- a/drivers/staging/lustre/lnet/lnet/module.c +++ b/drivers/staging/lustre/lnet/lnet/module.c @@ -27,7 +27,7 @@ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index fe49f1b..d98941d 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -1,7 +1,7 @@ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. * * This file is part of Portals * http://sourceforge.net/projects/sandiaportals/ diff --git a/drivers/staging/lustre/lnet/selftest/brw_test.c b/drivers/staging/lustre/lnet/selftest/brw_test.c index 0f26226..1f04cc1 100644 --- a/drivers/staging/lustre/lnet/selftest/brw_test.c +++ b/drivers/staging/lustre/lnet/selftest/brw_test.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c index 752e614..544b8e1 100644 --- a/drivers/staging/lustre/lnet/selftest/rpc.c +++ b/drivers/staging/lustre/lnet/selftest/rpc.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c b/drivers/staging/lustre/lustre/fid/fid_request.c index fe7c39a..ff8f38d 100644 --- a/drivers/staging/lustre/lustre/fid/fid_request.c +++ b/drivers/staging/lustre/lustre/fid/fid_request.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2013, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/fid/lproc_fid.c b/drivers/staging/lustre/lustre/fid/lproc_fid.c index ce90c1c..39f2aa3 100644 --- a/drivers/staging/lustre/lustre/fid/lproc_fid.c +++ b/drivers/staging/lustre/lustre/fid/lproc_fid.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/fld/fld_internal.h b/drivers/staging/lustre/lustre/fld/fld_internal.h index 959b8e6..12eb164 100644 --- a/drivers/staging/lustre/lustre/fld/fld_internal.h +++ b/drivers/staging/lustre/lustre/fld/fld_internal.h @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, 2013, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/fld/fld_request.c b/drivers/staging/lustre/lustre/fld/fld_request.c index 469df68..d92c01b 100644 --- a/drivers/staging/lustre/lustre/fld/fld_request.c +++ b/drivers/staging/lustre/lustre/fld/fld_request.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2013, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/fld/lproc_fld.c b/drivers/staging/lustre/lustre/fld/lproc_fld.c index 603f56e..41ceaa8 100644 --- a/drivers/staging/lustre/lustre/fld/lproc_fld.c +++ b/drivers/staging/lustre/lustre/fld/lproc_fld.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, 2013, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/cl_object.h b/drivers/staging/lustre/lustre/include/cl_object.h index 73564f8..1e7391a 100644 --- a/drivers/staging/lustre/lustre/include/cl_object.h +++ b/drivers/staging/lustre/lustre/include/cl_object.h @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h index f18c0c7..0ac8e0e 100644 --- a/drivers/staging/lustre/lustre/include/lprocfs_status.h +++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/lu_object.h b/drivers/staging/lustre/lustre/include/lu_object.h index fa78689..1d79341 100644 --- a/drivers/staging/lustre/lustre/include/lu_object.h +++ b/drivers/staging/lustre/lustre/include/lu_object.h @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/lustre/ll_fiemap.h b/drivers/staging/lustre/lustre/include/lustre/ll_fiemap.h index 06ce8c9..09088f4 100644 --- a/drivers/staging/lustre/lustre/include/lustre/ll_fiemap.h +++ b/drivers/staging/lustre/lustre/include/lustre/ll_fiemap.h @@ -26,6 +26,8 @@ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2014, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h index 0b721c6..b064b58 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h index 80f8ec5..2b4dd65 100644 --- a/drivers/staging/lustre/lustre/include/lustre/lustre_user.h +++ b/drivers/staging/lustre/lustre/include/lustre/lustre_user.h @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2010, 2012, Intel Corporation. + * Copyright (c) 2010, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h index 138479a..9b319f1 100644 --- a/drivers/staging/lustre/lustre/include/lustre_dlm.h +++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2010, 2012, Intel Corporation. + * Copyright (c) 2010, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/lustre_export.h b/drivers/staging/lustre/lustre/include/lustre_export.h index 1daf4c5..311e5aa 100644 --- a/drivers/staging/lustre/lustre/include/lustre_export.h +++ b/drivers/staging/lustre/lustre/include/lustre_export.h @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/lustre_fid.h b/drivers/staging/lustre/lustre/include/lustre_fid.h index 47c3f37..9b1a9c6 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fid.h +++ b/drivers/staging/lustre/lustre/include/lustre_fid.h @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/lustre_fld.h b/drivers/staging/lustre/lustre/include/lustre_fld.h index d8b3db9..5511626 100644 --- a/drivers/staging/lustre/lustre/include/lustre_fld.h +++ b/drivers/staging/lustre/lustre/include/lustre_fld.h @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2013, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/lustre_ha.h b/drivers/staging/lustre/lustre/include/lustre_ha.h index 49dfbb1..5488a69 100644 --- a/drivers/staging/lustre/lustre/include/lustre_ha.h +++ b/drivers/staging/lustre/lustre/include/lustre_ha.h @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/lustre_log.h b/drivers/staging/lustre/lustre/include/lustre_log.h index 1de0c4d..53af4cd 100644 --- a/drivers/staging/lustre/lustre/include/lustre_log.h +++ b/drivers/staging/lustre/lustre/include/lustre_log.h @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/lustre_net.h b/drivers/staging/lustre/lustre/include/lustre_net.h index 0127f45..d834ddd 100644 --- a/drivers/staging/lustre/lustre/include/lustre_net.h +++ b/drivers/staging/lustre/lustre/include/lustre_net.h @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2010, 2012, Intel Corporation. + * Copyright (c) 2010, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/lustre_param.h b/drivers/staging/lustre/lustre/include/lustre_param.h index 8f6c0b2..383fe6f 100644 --- a/drivers/staging/lustre/lustre/include/lustre_param.h +++ b/drivers/staging/lustre/lustre/include/lustre_param.h @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/lustre_req_layout.h b/drivers/staging/lustre/lustre/include/lustre_req_layout.h index df292f6..46a662f 100644 --- a/drivers/staging/lustre/lustre/include/lustre_req_layout.h +++ b/drivers/staging/lustre/lustre/include/lustre_req_layout.h @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h index 5c90b59..bcbe613 100644 --- a/drivers/staging/lustre/lustre/include/obd.h +++ b/drivers/staging/lustre/lustre/include/obd.h @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/obd_class.h b/drivers/staging/lustre/lustre/include/obd_class.h index 0b7e90a..97d8039 100644 --- a/drivers/staging/lustre/lustre/include/obd_class.h +++ b/drivers/staging/lustre/lustre/include/obd_class.h @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/include/obd_support.h b/drivers/staging/lustre/lustre/include/obd_support.h index a22a530..d031437 100644 --- a/drivers/staging/lustre/lustre/include/obd_support.h +++ b/drivers/staging/lustre/lustre/include/obd_support.h @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c index 12c7f0e..34dde7d 100644 --- a/drivers/staging/lustre/lustre/lclient/lcommon_cl.c +++ b/drivers/staging/lustre/lustre/lclient/lcommon_cl.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h index db3c9b7..849cc98 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c index ccce1e5..3c8d441 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2010, 2012, Intel Corporation. + * Copyright (c) 2010, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c index 7f8c700..cf9ec0c 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2010, 2012, Intel Corporation. + * Copyright (c) 2010, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c index ca11511..79aeb2b 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lockd.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2010, 2012, Intel Corporation. + * Copyright (c) 2010, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c index e59b286..3d7c137 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2010, 2012, Intel Corporation. + * Copyright (c) 2010, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c index fdf81b8..b9eb377 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2010, 2012, Intel Corporation. + * Copyright (c) 2010, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c index b55a4f0..0ae6100 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2010, 2012, Intel Corporation. + * Copyright (c) 2010, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/libcfs/fail.c b/drivers/staging/lustre/lustre/libcfs/fail.c index ea059b0..2783143 100644 --- a/drivers/staging/lustre/lustre/libcfs/fail.c +++ b/drivers/staging/lustre/lustre/libcfs/fail.c @@ -26,7 +26,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c index 94bc007..15782d9 100644 --- a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c +++ b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c @@ -21,7 +21,7 @@ * GPL HEADER END */ /* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015 Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c index d40be53..205a3ed 100644 --- a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c +++ b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015 Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c index 58a4034..e52afe3 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-cpu.c @@ -22,7 +22,8 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012, Intel Corporation. + * + * Copyright (c) 2012, 2015 Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c index c74c809..68515d9 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c index 570f05c..9224607 100644 --- a/drivers/staging/lustre/lustre/libcfs/module.c +++ b/drivers/staging/lustre/lustre/libcfs/module.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015 Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c index 80cba04..3d6745e 100644 --- a/drivers/staging/lustre/lustre/llite/dcache.c +++ b/drivers/staging/lustre/lustre/llite/dcache.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 5c2ef92..7b35531 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 02f2759..baffd52 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index 157c328..eb8d6a7 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 4a8c759..1db93af 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/llite_mmap.c b/drivers/staging/lustre/lustre/llite/llite_mmap.c index 7df9783..bbae95c 100644 --- a/drivers/staging/lustre/lustre/llite/llite_mmap.c +++ b/drivers/staging/lustre/lustre/llite/llite_mmap.c @@ -27,7 +27,7 @@ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/lproc_llite.c b/drivers/staging/lustre/lustre/llite/lproc_llite.c index 190fc44..f134ad9 100644 --- a/drivers/staging/lustre/lustre/llite/lproc_llite.c +++ b/drivers/staging/lustre/lustre/llite/lproc_llite.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 2ca2200..14370b9 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/rw.c b/drivers/staging/lustre/lustre/llite/rw.c index f79193f..465e2f6 100644 --- a/drivers/staging/lustre/lustre/llite/rw.c +++ b/drivers/staging/lustre/lustre/llite/rw.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c index 18f5f2b..e87aa12 100644 --- a/drivers/staging/lustre/lustre/llite/statahead.c +++ b/drivers/staging/lustre/lustre/llite/statahead.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/vvp_dev.c b/drivers/staging/lustre/lustre/llite/vvp_dev.c index d16d6cf..fdca4ec 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_dev.c +++ b/drivers/staging/lustre/lustre/llite/vvp_dev.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/vvp_internal.h b/drivers/staging/lustre/lustre/llite/vvp_internal.h index b5a6661..2e39533 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_internal.h +++ b/drivers/staging/lustre/lustre/llite/vvp_internal.h @@ -26,6 +26,8 @@ /* * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2013, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c b/drivers/staging/lustre/lustre/llite/vvp_io.c index 37773c1..346b8a1 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_io.c +++ b/drivers/staging/lustre/lustre/llite/vvp_io.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/vvp_lock.c b/drivers/staging/lustre/lustre/llite/vvp_lock.c index f7b1144..ff09480 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_lock.c +++ b/drivers/staging/lustre/lustre/llite/vvp_lock.c @@ -26,6 +26,8 @@ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2014, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/vvp_object.c b/drivers/staging/lustre/lustre/llite/vvp_object.c index e13afb7..c82714e 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_object.c +++ b/drivers/staging/lustre/lustre/llite/vvp_object.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/vvp_page.c b/drivers/staging/lustre/lustre/llite/vvp_page.c index 92f60c3..99c0d7a 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_page.c +++ b/drivers/staging/lustre/lustre/llite/vvp_page.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index 4b7eb33..92f579e 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/llite/xattr_cache.c b/drivers/staging/lustre/lustre/llite/xattr_cache.c index e1e599c..d140276 100644 --- a/drivers/staging/lustre/lustre/llite/xattr_cache.c +++ b/drivers/staging/lustre/lustre/llite/xattr_cache.c @@ -1,6 +1,8 @@ /* * Copyright 2012 Xyratex Technology Limited * + * Copyright (c) 2013, 2015, Intel Corporation. + * * Author: Andrew Perepechko * */ diff --git a/drivers/staging/lustre/lustre/lmv/lmv_intent.c b/drivers/staging/lustre/lustre/lmv/lmv_intent.c index 3c585ae..66de27f 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_intent.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_intent.c @@ -27,7 +27,7 @@ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lmv/lmv_internal.h b/drivers/staging/lustre/lustre/lmv/lmv_internal.h index 467cfb3..eb8e673 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_internal.h +++ b/drivers/staging/lustre/lustre/lmv/lmv_internal.h @@ -27,7 +27,7 @@ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c index a4de9a3..bbafe0a 100644 --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c @@ -27,7 +27,7 @@ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lov/lov_cl_internal.h b/drivers/staging/lustre/lustre/lov/lov_cl_internal.h index 1c0fe65..66a2492 100644 --- a/drivers/staging/lustre/lustre/lov/lov_cl_internal.h +++ b/drivers/staging/lustre/lustre/lov/lov_cl_internal.h @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015 Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lov/lov_dev.c b/drivers/staging/lustre/lustre/lov/lov_dev.c index 2e8b566..3733fdc 100644 --- a/drivers/staging/lustre/lustre/lov/lov_dev.c +++ b/drivers/staging/lustre/lustre/lov/lov_dev.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lov/lov_ea.c b/drivers/staging/lustre/lustre/lov/lov_ea.c index 34c1346..b3c9c85 100644 --- a/drivers/staging/lustre/lustre/lov/lov_ea.c +++ b/drivers/staging/lustre/lustre/lov/lov_ea.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lov/lov_internal.h b/drivers/staging/lustre/lustre/lov/lov_internal.h index b802873..2d00bad 100644 --- a/drivers/staging/lustre/lustre/lov/lov_internal.h +++ b/drivers/staging/lustre/lustre/lov/lov_internal.h @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lov/lov_io.c b/drivers/staging/lustre/lustre/lov/lov_io.c index 5e6228b..93fe69e 100644 --- a/drivers/staging/lustre/lustre/lov/lov_io.c +++ b/drivers/staging/lustre/lustre/lov/lov_io.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lov/lov_merge.c b/drivers/staging/lustre/lustre/lov/lov_merge.c index dd1cf3d..97115be 100644 --- a/drivers/staging/lustre/lustre/lov/lov_merge.c +++ b/drivers/staging/lustre/lustre/lov/lov_merge.c @@ -27,7 +27,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lov/lov_obd.c b/drivers/staging/lustre/lustre/lov/lov_obd.c index b52609a..6c2bdfe 100644 --- a/drivers/staging/lustre/lustre/lov/lov_obd.c +++ b/drivers/staging/lustre/lustre/lov/lov_obd.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c index c7ff817..3b79ebc 100644 --- a/drivers/staging/lustre/lustre/lov/lov_object.c +++ b/drivers/staging/lustre/lustre/lov/lov_object.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lov/lov_offset.c b/drivers/staging/lustre/lustre/lov/lov_offset.c index 9c8c77c..aa520aa 100644 --- a/drivers/staging/lustre/lustre/lov/lov_offset.c +++ b/drivers/staging/lustre/lustre/lov/lov_offset.c @@ -27,7 +27,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lov/lov_pack.c b/drivers/staging/lustre/lustre/lov/lov_pack.c index 2fb1e97..1985231 100644 --- a/drivers/staging/lustre/lustre/lov/lov_pack.c +++ b/drivers/staging/lustre/lustre/lov/lov_pack.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lov/lov_page.c b/drivers/staging/lustre/lustre/lov/lov_page.c index 463cadb..037ae91 100644 --- a/drivers/staging/lustre/lustre/lov/lov_page.c +++ b/drivers/staging/lustre/lustre/lov/lov_page.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lov/lov_request.c b/drivers/staging/lustre/lustre/lov/lov_request.c index bb1a03f..42deda7 100644 --- a/drivers/staging/lustre/lustre/lov/lov_request.c +++ b/drivers/staging/lustre/lustre/lov/lov_request.c @@ -27,7 +27,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lov/lovsub_dev.c b/drivers/staging/lustre/lustre/lov/lovsub_dev.c index 8bc04c8..f1795c3 100644 --- a/drivers/staging/lustre/lustre/lov/lovsub_dev.c +++ b/drivers/staging/lustre/lustre/lov/lovsub_dev.c @@ -26,6 +26,8 @@ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2013, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lov/lovsub_object.c b/drivers/staging/lustre/lustre/lov/lovsub_object.c index d775e28..5ba5ee1 100644 --- a/drivers/staging/lustre/lustre/lov/lovsub_object.c +++ b/drivers/staging/lustre/lustre/lov/lovsub_object.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015 Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/lov/lproc_lov.c b/drivers/staging/lustre/lustre/lov/lproc_lov.c index a0be15c..337241d 100644 --- a/drivers/staging/lustre/lustre/lov/lproc_lov.c +++ b/drivers/staging/lustre/lustre/lov/lproc_lov.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015 Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c index 1c95f87..5a441bb 100644 --- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c +++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/mdc/mdc_internal.h b/drivers/staging/lustre/lustre/mdc/mdc_internal.h index df50bdb..3d2997a 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_internal.h +++ b/drivers/staging/lustre/lustre/mdc/mdc_internal.h @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, Intel Corporation. + * Copyright (c) 2011, 2015 Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c index 227fc9e..7218532 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c index d4bf34b..ef9a1e1 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/mdc/mdc_reint.c b/drivers/staging/lustre/lustre/mdc/mdc_reint.c index c87c7d8..ac7695a 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_reint.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_reint.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 294c050..c06a6e1 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -27,7 +27,7 @@ * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index 69b2364..aff0791 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c index e67cea7..ab7e110 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_io.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/obdclass/cl_object.c b/drivers/staging/lustre/lustre/obdclass/cl_object.c index a1a6024..73ea845 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_object.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_object.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/obdclass/cl_page.c b/drivers/staging/lustre/lustre/obdclass/cl_page.c index 2f569ed..61f28eb 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_page.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_page.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c index beb59f0..0975e44 100644 --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c @@ -27,7 +27,7 @@ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c b/drivers/staging/lustre/lustre/obdclass/genops.c index 26f54f9..228c44c 100644 --- a/drivers/staging/lustre/lustre/obdclass/genops.c +++ b/drivers/staging/lustre/lustre/obdclass/genops.c @@ -27,7 +27,7 @@ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c index 518288d..42fc26f 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-sysctl.c @@ -27,7 +27,7 @@ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c index 7cb55ef..f956d7e 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog.c +++ b/drivers/staging/lustre/lustre/obdclass/llog.c @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/obdclass/llog_cat.c b/drivers/staging/lustre/lustre/obdclass/llog_cat.c index c442cae..0f05e9c 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_cat.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_cat.c @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/obdclass/llog_internal.h b/drivers/staging/lustre/lustre/obdclass/llog_internal.h index b9fe4b0..7fb48dd 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_internal.h +++ b/drivers/staging/lustre/lustre/obdclass/llog_internal.h @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/obdclass/llog_obd.c b/drivers/staging/lustre/lustre/obdclass/llog_obd.c index 3900b9d..9bc5199 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_obd.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_obd.c @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/obdclass/llog_swab.c b/drivers/staging/lustre/lustre/obdclass/llog_swab.c index 9354f75..3aa7393 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog_swab.c +++ b/drivers/staging/lustre/lustre/obdclass/llog_swab.c @@ -27,7 +27,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c index dda5ad1..51fe15f 100644 --- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c +++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/obdclass/lu_object.c b/drivers/staging/lustre/lustre/obdclass/lu_object.c index 0193608..76ad9dc 100644 --- a/drivers/staging/lustre/lustre/obdclass/lu_object.c +++ b/drivers/staging/lustre/lustre/obdclass/lu_object.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index c231e0d..49cdc64 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/obdclass/obd_mount.c b/drivers/staging/lustre/lustre/obdclass/obd_mount.c index 7617c57..b5aa816 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_mount.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_mount.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index 35a2f59..7dc6e2e 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c b/drivers/staging/lustre/lustre/osc/lproc_osc.c index c4d44e7..1091536 100644 --- a/drivers/staging/lustre/lustre/osc/lproc_osc.c +++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c b/drivers/staging/lustre/lustre/osc/osc_cache.c index cfb83bc..5a6a305 100644 --- a/drivers/staging/lustre/lustre/osc/osc_cache.c +++ b/drivers/staging/lustre/lustre/osc/osc_cache.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. * */ /* diff --git a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h index d2d6845..415c27e 100644 --- a/drivers/staging/lustre/lustre/osc/osc_cl_internal.h +++ b/drivers/staging/lustre/lustre/osc/osc_cl_internal.h @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/osc/osc_dev.c b/drivers/staging/lustre/lustre/osc/osc_dev.c index 69b523c..7078cc5 100644 --- a/drivers/staging/lustre/lustre/osc/osc_dev.c +++ b/drivers/staging/lustre/lustre/osc/osc_dev.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/osc/osc_internal.h b/drivers/staging/lustre/lustre/osc/osc_internal.h index db2ee9c..a4c6146 100644 --- a/drivers/staging/lustre/lustre/osc/osc_internal.h +++ b/drivers/staging/lustre/lustre/osc/osc_internal.h @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/osc/osc_io.c b/drivers/staging/lustre/lustre/osc/osc_io.c index d413496..abd0beb 100644 --- a/drivers/staging/lustre/lustre/osc/osc_io.c +++ b/drivers/staging/lustre/lustre/osc/osc_io.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/osc/osc_lock.c b/drivers/staging/lustre/lustre/osc/osc_lock.c index 194490d..71f2810 100644 --- a/drivers/staging/lustre/lustre/osc/osc_lock.c +++ b/drivers/staging/lustre/lustre/osc/osc_lock.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/osc/osc_object.c b/drivers/staging/lustre/lustre/osc/osc_object.c index ba57f8d..c29a0d4 100644 --- a/drivers/staging/lustre/lustre/osc/osc_object.c +++ b/drivers/staging/lustre/lustre/osc/osc_object.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/osc/osc_page.c b/drivers/staging/lustre/lustre/osc/osc_page.c index 61eaf71..2439d80 100644 --- a/drivers/staging/lustre/lustre/osc/osc_page.c +++ b/drivers/staging/lustre/lustre/osc/osc_page.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/osc/osc_quota.c b/drivers/staging/lustre/lustre/osc/osc_quota.c index 1997831..e70e796 100644 --- a/drivers/staging/lustre/lustre/osc/osc_quota.c +++ b/drivers/staging/lustre/lustre/osc/osc_quota.c @@ -23,7 +23,7 @@ /* * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. * * Code originally extracted from quota directory */ diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c index d6c1447..b2642a7 100644 --- a/drivers/staging/lustre/lustre/osc/osc_request.c +++ b/drivers/staging/lustre/lustre/osc/osc_request.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c b/drivers/staging/lustre/lustre/ptlrpc/client.c index a9f1bf5..efdda09 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/client.c +++ b/drivers/staging/lustre/lustre/ptlrpc/client.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/events.c b/drivers/staging/lustre/lustre/ptlrpc/events.c index 9c2fd34..9901569 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/events.c +++ b/drivers/staging/lustre/lustre/ptlrpc/events.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015 Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c b/drivers/staging/lustre/lustre/ptlrpc/import.c index bfa410f..f752c78 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/import.c +++ b/drivers/staging/lustre/lustre/ptlrpc/import.c @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/layout.c b/drivers/staging/lustre/lustre/ptlrpc/layout.c index d7c4f47..c0e613c 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/layout.c +++ b/drivers/staging/lustre/lustre/ptlrpc/layout.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/llog_client.c b/drivers/staging/lustre/lustre/ptlrpc/llog_client.c index 5122205..e877020 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/llog_client.c +++ b/drivers/staging/lustre/lustre/ptlrpc/llog_client.c @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c index 2aecab2..cc55b79 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c +++ b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c index 09ddeef..c5d7ff5 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/niobuf.c +++ b/drivers/staging/lustre/lustre/ptlrpc/niobuf.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/pers.c b/drivers/staging/lustre/lustre/ptlrpc/pers.c index 2a2a9fb..ec3af10 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pers.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pers.c @@ -26,6 +26,8 @@ /* * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. + * + * Copyright (c) 2014, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c index 5c719f1..fb2d523 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h index 833ed94..8f67e05 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h +++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpc_internal.h @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c index ac87aa1..60fb0ce 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c +++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c @@ -27,7 +27,7 @@ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/recover.c b/drivers/staging/lustre/lustre/ptlrpc/recover.c index 7b1d729..db6626c 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/recover.c +++ b/drivers/staging/lustre/lustre/ptlrpc/recover.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c index cd8a998..6152c1b 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_config.c b/drivers/staging/lustre/lustre/ptlrpc/sec_config.c index 7a20670..4b0b81c 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_config.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_config.c @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c b/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c index f448b45..905a414 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, 2012, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c index f45898f..8598300 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/service.c +++ b/drivers/staging/lustre/lustre/ptlrpc/service.c @@ -27,7 +27,7 @@ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2010, 2012, Intel Corporation. + * Copyright (c) 2010, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ diff --git a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c index 40f720c..61d9ca9 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/wiretest.c +++ b/drivers/staging/lustre/lustre/ptlrpc/wiretest.c @@ -27,7 +27,7 @@ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2011, Intel Corporation. + * Copyright (c) 2011, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ -- 1.7.1 From jsimmons at infradead.org Mon Nov 9 04:27:15 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 23:27:15 -0500 Subject: [lustre-devel] [PATCH] staging: lustre: remove {linux, posix}-tracefile.h Message-ID: <1447043236-30519-1-git-send-email-jsimmons@infradead.org> From: John L. Hammond Move the definition of the trace buffer type enum in libcfs/libcfs/tracefile.h. Remove the then unneeded headers libcfs/libcfs/linux/linux-tracefile.h and libcfs/libcfs/posix/posix-tracefile.h. Signed-off-by: John L. Hammond Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675 Reviewed-on: http://review.whamcloud.com/11983 Reviewed-by: Bob Glossman Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- .../lustre/lustre/libcfs/linux/linux-tracefile.h | 48 -------------------- drivers/staging/lustre/lustre/libcfs/tracefile.h | 7 +++- 2 files changed, 6 insertions(+), 49 deletions(-) delete mode 100644 drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.h diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.h b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.h deleted file mode 100644 index ba84e4f..0000000 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * GPL HEADER START - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 only, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License version 2 for more details (a copy is included - * in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU General Public License - * version 2 along with this program; If not, see - * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf - * - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, - * CA 95054 USA or visit www.sun.com if you need additional information or - * have any questions. - * - * GPL HEADER END - */ -/* - * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. - * Use is subject to license terms. - */ -/* - * This file is part of Lustre, http://www.lustre.org/ - * Lustre is a trademark of Sun Microsystems, Inc. - */ - -#ifndef __LIBCFS_LINUX_TRACEFILE_H__ -#define __LIBCFS_LINUX_TRACEFILE_H__ - -/** - * three types of trace_data in linux - */ -typedef enum { - CFS_TCD_TYPE_PROC = 0, - CFS_TCD_TYPE_SOFTIRQ, - CFS_TCD_TYPE_IRQ, - CFS_TCD_TYPE_MAX -} cfs_trace_buf_type_t; - -#endif diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.h b/drivers/staging/lustre/lustre/libcfs/tracefile.h index 6b37798..b71b94f 100644 --- a/drivers/staging/lustre/lustre/libcfs/tracefile.h +++ b/drivers/staging/lustre/lustre/libcfs/tracefile.h @@ -39,7 +39,12 @@ #include "../../include/linux/libcfs/libcfs.h" -#include "linux/linux-tracefile.h" +typedef enum { + CFS_TCD_TYPE_PROC = 0, + CFS_TCD_TYPE_SOFTIRQ, + CFS_TCD_TYPE_IRQ, + CFS_TCD_TYPE_MAX +} cfs_trace_buf_type_t; /* trace file lock routines */ -- 1.7.1 From jsimmons at infradead.org Mon Nov 9 04:27:16 2015 From: jsimmons at infradead.org (James Simmons) Date: Sun, 8 Nov 2015 23:27:16 -0500 Subject: [lustre-devel] [PATCH] staging: lustre: remove obsolete comment in tracefile.h In-Reply-To: <1447043236-30519-1-git-send-email-jsimmons@infradead.org> References: <1447043236-30519-1-git-send-email-jsimmons@infradead.org> Message-ID: <1447043236-30519-2-git-send-email-jsimmons@infradead.org> From: John L. Hammond Remove comment about tracefile handling for user land version of libcfs that no longer exist. Broken out of patch http://review.whamcloud.com/11983. Signed-off-by: John L. Hammond Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675 Reviewed-on: http://review.whamcloud.com/11983 Reviewed-by: Bob Glossman Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lustre/libcfs/tracefile.h | 7 ------- 1 files changed, 0 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.h b/drivers/staging/lustre/lustre/libcfs/tracefile.h index 6b37798..fd8086b 100644 --- a/drivers/staging/lustre/lustre/libcfs/tracefile.h +++ b/drivers/staging/lustre/lustre/libcfs/tracefile.h @@ -251,13 +251,6 @@ void cfs_print_to_console(struct ptldebug_header *hdr, int mask, int cfs_trace_lock_tcd(struct cfs_trace_cpu_data *tcd, int walking); void cfs_trace_unlock_tcd(struct cfs_trace_cpu_data *tcd, int walking); -/** - * trace_buf_type_t, trace_buf_idx_get() and trace_console_buffers[][] - * are not public libcfs API; they should be defined in - * platform-specific tracefile include files - * (see, for example, linux-tracefile.h). - */ - extern char *cfs_trace_console_buffers[NR_CPUS][CFS_TCD_TYPE_MAX]; cfs_trace_buf_type_t cfs_trace_buf_idx_get(void); -- 1.7.1 From oleg.drokin at intel.com Mon Nov 9 11:08:43 2015 From: oleg.drokin at intel.com (Drokin, Oleg) Date: Mon, 9 Nov 2015 11:08:43 +0000 Subject: [lustre-devel] [PATCH] staging: lustre: export cfs_str2mask In-Reply-To: <1447000500-29427-6-git-send-email-jsimmons@infradead.org> References: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> <1447000500-29427-6-git-send-email-jsimmons@infradead.org> Message-ID: <5F41E759-F653-4A35-B2E5-15544BCF4BD2@intel.com> 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 > --- > .../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 > lustre-devel at lists.lustre.org > http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org From sudipm.mukherjee at gmail.com Mon Nov 9 11:19:39 2015 From: sudipm.mukherjee at gmail.com (Sudip Mukherjee) Date: Mon, 9 Nov 2015 16:49:39 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: Handle nodemask on UMP machines In-Reply-To: <1447000500-29427-2-git-send-email-jsimmons@infradead.org> References: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> <1447000500-29427-2-git-send-email-jsimmons@infradead.org> Message-ID: <20151109111939.GB3868@sudip-pc> 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 > Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4199 > Reviewed-on: http://review.whamcloud.com/9219 > Reviewed-by: Liang Zhen > Reviewed-by: Li Xi > Reviewed-by: Andreas Dilger 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 > Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4993 > Reviewed-on: http://review.whamcloud.com/10332 > Reviewed-by: Liang Zhen > Reviewed-by: Bob Glossman > Reviewed-by: Oleg Drokin And then again here. regards sudip From shivanib134 at gmail.com Mon Nov 9 18:54:17 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Tue, 10 Nov 2015 00:24:17 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: acl: Remove lustre_posix_acl_xattr_free wrapper Message-ID: <1447095257-21165-1-git-send-email-shivanib134@gmail.com> Remove the wrapper function lustre_posix_acl_xattr_free() and replace its call in the file xattr with the function kfree() that it wrapped. Also, its prototype from the header lustre_eacl is removed as it is no longer of any use. Signed-off-by: Shivani Bhardwaj --- drivers/staging/lustre/lustre/include/lustre_eacl.h | 2 -- drivers/staging/lustre/lustre/llite/xattr.c | 5 ++++- drivers/staging/lustre/lustre/obdclass/acl.c | 9 --------- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_eacl.h b/drivers/staging/lustre/lustre/include/lustre_eacl.h index fee4d2c..0b66593 100644 --- a/drivers/staging/lustre/lustre/include/lustre_eacl.h +++ b/drivers/staging/lustre/lustre/include/lustre_eacl.h @@ -76,8 +76,6 @@ extern int lustre_posix_acl_xattr_filter(posix_acl_xattr_header *header, size_t size, posix_acl_xattr_header **out); extern void -lustre_posix_acl_xattr_free(posix_acl_xattr_header *header, int size); -extern void lustre_ext_acl_xattr_free(ext_acl_xattr_header *header); extern ext_acl_xattr_header * lustre_acl_xattr_merge2ext(posix_acl_xattr_header *posix_header, int size, diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c index 4b7eb33..f9b1dee 100644 --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -193,7 +193,10 @@ int ll_setxattr_common(struct inode *inode, const char *name, ll_i2suppgid(inode), &req); #ifdef CONFIG_FS_POSIX_ACL if (new_value != NULL) - lustre_posix_acl_xattr_free(new_value, size); + /* + * Release the posix ACL space. + */ + kfree(new_value); if (acl != NULL) lustre_ext_acl_xattr_free(acl); #endif diff --git a/drivers/staging/lustre/lustre/obdclass/acl.c b/drivers/staging/lustre/lustre/obdclass/acl.c index 2e20cf6..49ba885 100644 --- a/drivers/staging/lustre/lustre/obdclass/acl.c +++ b/drivers/staging/lustre/lustre/obdclass/acl.c @@ -236,15 +236,6 @@ _out: EXPORT_SYMBOL(lustre_posix_acl_xattr_filter); /* - * Release the posix ACL space. - */ -void lustre_posix_acl_xattr_free(posix_acl_xattr_header *header, int size) -{ - kfree(header); -} -EXPORT_SYMBOL(lustre_posix_acl_xattr_free); - -/* * Release the extended ACL space. */ void lustre_ext_acl_xattr_free(ext_acl_xattr_header *header) -- 2.1.0 From simmonsja at ornl.gov Mon Nov 9 19:11:15 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Mon, 9 Nov 2015 19:11:15 +0000 Subject: [lustre-devel] [PATCH] Staging: lustre: obd_cksum.h: Remove unused cksum_types_supported_server In-Reply-To: <1446875199-15537-1-git-send-email-shraddha.6596@gmail.com> References: <1446875199-15537-1-git-send-email-shraddha.6596@gmail.com> Message-ID: <8f8563f394e44c77bc531839d801ff16@EXCHCS32.ornl.gov> >From: lustre-devel [mailto:lustre-devel-bounces at lists.lustre.org] On Behalf Of Shraddha Barke >Sent: Saturday, November 07, 2015 12:47 AM >To: Greg Kroah-Hartman; lustre-devel at lists.lustre.org >Subject: [lustre-devel] [PATCH] Staging: lustre: obd_cksum.h: Remove unused cksum_types_supported_server > >cksum_types_supported_server is defined in header file but not used >anywhere. Hence remove it. > >Signed-off-by: Shraddha Barke >--- > drivers/staging/lustre/lustre/include/obd_cksum.h | 23 ----------------------- > 1 file changed, 23 deletions(-) Server side left that is safe to remove. Acked-by: James Simmons diff --git a/drivers/staging/lustre/lustre/include/obd_cksum.h b/drivers/staging/lustre/lustre/include/obd_cksum.h index a0099d7..01db604 100644 --- a/drivers/staging/lustre/lustre/include/obd_cksum.h +++ b/drivers/staging/lustre/lustre/include/obd_cksum.h @@ -133,29 +133,6 @@ static inline cksum_type_t cksum_types_supported_client(void) return ret; } -/* Server uses algos that perform at 50% or better of the Adler */ -static inline cksum_type_t cksum_types_supported_server(void) -{ - int base_speed; - cksum_type_t ret = OBD_CKSUM_ADLER; - - CDEBUG(D_INFO, "Crypto hash speed: crc %d, crc32c %d, adler %d\n", - cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_CRC32)), - cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_CRC32C)), - cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_ADLER))); - - base_speed = cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_ADLER)) / 2; - - if (cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_CRC32C)) >= - base_speed) - ret |= OBD_CKSUM_CRC32C; - if (cfs_crypto_hash_speed(cksum_obd2cfs(OBD_CKSUM_CRC32)) >= - base_speed) - ret |= OBD_CKSUM_CRC32; - - return ret; -} - /* Select the best checksum algorithm among those supplied in the cksum_types * input. * -- 2.1.4 _______________________________________________ lustre-devel mailing list lustre-devel at lists.lustre.org http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org From lkp at intel.com Mon Nov 9 19:43:50 2015 From: lkp at intel.com (kbuild test robot) Date: Tue, 10 Nov 2015 03:43:50 +0800 Subject: [lustre-devel] [PATCH] staging: lustre: acl: fix ifnullfree.cocci warnings In-Reply-To: <1447095257-21165-1-git-send-email-shivanib134@gmail.com> References: <201511100309.kmJ2bdfD%fengguang.wu@intel.com> Message-ID: <20151109194350.GA117144@cairo> drivers/staging/lustre/lustre/llite/xattr.c:199:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. NULL check before some freeing functions is not needed. Based on checkpatch warning "kfree(NULL) is safe this check is probably not required" and kfreeaddr.cocci by Julia Lawall. Generated by: scripts/coccinelle/free/ifnullfree.cocci CC: Shivani Bhardwaj Signed-off-by: Fengguang Wu --- xattr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/staging/lustre/lustre/llite/xattr.c +++ b/drivers/staging/lustre/lustre/llite/xattr.c @@ -192,11 +192,10 @@ int ll_setxattr_common(struct inode *ino valid, name, pv, size, 0, flags, ll_i2suppgid(inode), &req); #ifdef CONFIG_FS_POSIX_ACL - if (new_value != NULL) /* * Release the posix ACL space. */ - kfree(new_value); + kfree(new_value); if (acl != NULL) lustre_ext_acl_xattr_free(acl); #endif From lkp at intel.com Mon Nov 9 19:43:50 2015 From: lkp at intel.com (kbuild test robot) Date: Tue, 10 Nov 2015 03:43:50 +0800 Subject: [lustre-devel] [PATCH] staging: lustre: acl: Remove lustre_posix_acl_xattr_free wrapper In-Reply-To: <1447095257-21165-1-git-send-email-shivanib134@gmail.com> Message-ID: <201511100309.kmJ2bdfD%fengguang.wu@intel.com> Hi Shivani, [auto build test WARNING on staging/staging-testing] [also build test WARNING on v4.3 next-20151109] url: https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre-acl-Remove-lustre_posix_acl_xattr_free-wrapper/20151110-025757 coccinelle warnings: (new ones prefixed by >>) >> drivers/staging/lustre/lustre/llite/xattr.c:199:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. Please review and possibly fold the followup patch. --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation From gregkh at linuxfoundation.org Mon Nov 9 19:59:02 2015 From: gregkh at linuxfoundation.org (Greg KH) Date: Mon, 9 Nov 2015 11:59:02 -0800 Subject: [lustre-devel] [PATCH] staging: lustre: acl: fix ifnullfree.cocci warnings In-Reply-To: <20151109194350.GA117144@cairo> References: <201511100309.kmJ2bdfD%fengguang.wu@intel.com> <20151109194350.GA117144@cairo> Message-ID: <20151109195902.GB11820@kroah.com> On Tue, Nov 10, 2015 at 03:43:50AM +0800, kbuild test robot wrote: > drivers/staging/lustre/lustre/llite/xattr.c:199:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. > > NULL check before some freeing functions is not needed. > > Based on checkpatch warning > "kfree(NULL) is safe this check is probably not required" > and kfreeaddr.cocci by Julia Lawall. > > Generated by: scripts/coccinelle/free/ifnullfree.cocci > > CC: Shivani Bhardwaj > Signed-off-by: Fengguang Wu > --- > > xattr.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > --- a/drivers/staging/lustre/lustre/llite/xattr.c > +++ b/drivers/staging/lustre/lustre/llite/xattr.c > @@ -192,11 +192,10 @@ int ll_setxattr_common(struct inode *ino > valid, name, pv, size, 0, flags, > ll_i2suppgid(inode), &req); > #ifdef CONFIG_FS_POSIX_ACL > - if (new_value != NULL) > /* > * Release the posix ACL space. > */ > - kfree(new_value); > + kfree(new_value); Looks like a bug in coccinelle, the comment line should also be indented to the left. Julia, any ideas? thanks, greg k-h From gregkh at linuxfoundation.org Mon Nov 9 20:44:20 2015 From: gregkh at linuxfoundation.org (Greg KH) Date: Mon, 9 Nov 2015 12:44:20 -0800 Subject: [lustre-devel] AnonHugePages Virtual Memory Commit bug In-Reply-To: References: Message-ID: <20151109204420.GA14121@kroah.com> On Mon, Nov 09, 2015 at 02:08:01PM -0600, Prem Kumar wrote: > Dear All, > > Sorry to intervene and being rude and send this message directly to you folks. > I have made several attempts to reach to linux-kernel at vger.kernel.org and my > attempts have failed miserably and I have not be able make any progress on this > issue I have had for months now.  Please don't post html email, and then your message will go through to linux-kernel with no problems. Fix that and you should be fine. But: > I feel this is a bug. I am at kernel: 2.6.32-431.17.1.el6.x86_64 Please ask for support from Red Hat who provides you with this kernel, you are the one paying for that support, so please use it. There's nothing that the kernel community can do with a vendor-specific kernel, especially one as old as this one. good luck! greg k-h From 0x7f454c46 at gmail.com Sat Nov 7 20:37:40 2015 From: 0x7f454c46 at gmail.com (Dmitry Safonov) Date: Sat, 7 Nov 2015 23:37:40 +0300 Subject: [lustre-devel] next-20151101 - depmod issues with Lustre modules In-Reply-To: <8398.1446478793@turing-police.cc.vt.edu> References: <8398.1446478793@turing-police.cc.vt.edu> Message-ID: Reproduced on mainline v4.3-9038-g27eb427bdc0960 with Arch Linux default config (attached): depmod: ERROR: Found 2 modules in dependency cycles! depmod: ERROR: Cycle detected: lnet -> libcfs -> lnet make: *** [_modinst_post] Error 1 2015-11-02 18:39 GMT+03:00 Valdis Kletnieks : > next-20151101 compiles fine, but depmod has a cow: > > depmod: ERROR: Found 2 modules in dependency cycles! > depmod: ERROR: Cycle detected: lnet -> libcfs -> lnet > > Sorry, not sure which commit(s) introduced the issue. next-20151022 > was OK. > > -------------- next part -------------- A non-text attachment was scrubbed... Name: config Type: application/octet-stream Size: 175570 bytes Desc: not available URL: From prem.it.kumar at gmail.com Mon Nov 9 20:08:01 2015 From: prem.it.kumar at gmail.com (Prem Kumar) Date: Mon, 9 Nov 2015 14:08:01 -0600 Subject: [lustre-devel] AnonHugePages Virtual Memory Commit bug Message-ID: Dear All, Sorry to intervene and being rude and send this message directly to you folks. I have made several attempts to reach to linux-kernel at vger.kernel.org and my attempts have failed miserably and I have not be able make any progress on this issue I have had for months now. With all humbleness I request your help so that I can get assistance with this issue of mine. Please guide me. I get hundreds-thousands of emails from vger.kernel.org, not a problem, but I cannot post my question to the email above. Any help will be like God's grace for me now. My ISSUE: I feel this is a bug. I am at kernel: 2.6.32-431.17.1.el6.x86_64 I have run into this many a times and only reboot has been the fix. Issue is on every idle(not running any user processes) machine(diskless node, & no swap) I see AnonHugePages limits the amount of memory that can be allocated to any new process/program on that that system. When ever I see this happen, atop always show vmcom > vmlim, i a situation where there is no swap disk I am thinking this is causing the system to lock up that memory from use by any other process on that system. Any help here is appreciated. Regards, Prem # cat /proc/meminfo MemTotal: 24724728 kB MemFree: 7062824 kB Buffers: 0 kB Cached: 656692 kB SwapCached: 0 kB Active: 16583276 kB Inactive: 417380 kB Active(anon): 16518316 kB Inactive(anon): 251616 kB Active(file): 64960 kB Inactive(file): 165764 kB Unevictable: 0 kB Mlocked: 0 kB SwapTotal: 0 kB SwapFree: 0 kB Dirty: 0 kB Writeback: 0 kB AnonPages: 16344124 kB Mapped: 19316 kB Shmem: 425968 kB Slab: 127992 kB SReclaimable: 22996 kB SUnreclaim: 104996 kB KernelStack: 2944 kB PageTables: 56548 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 12362364 kB Committed_AS: 17369952 kB VmallocTotal: 34359738367 kB VmallocUsed: 493700 kB VmallocChunk: 34346083172 kB HardwareCorrupted: 0 kB AnonHugePages: 16015360 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB DirectMap4k: 7652 kB DirectMap2M: 25145344 kB On Mon, Nov 9, 2015 at 1:43 PM, kbuild test robot wrote: > drivers/staging/lustre/lustre/llite/xattr.c:199:2-7: WARNING: NULL check > before freeing functions like kfree, debugfs_remove, > debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider > reorganizing relevant code to avoid passing NULL values. > > NULL check before some freeing functions is not needed. > > Based on checkpatch warning > "kfree(NULL) is safe this check is probably not required" > and kfreeaddr.cocci by Julia Lawall. > > Generated by: scripts/coccinelle/free/ifnullfree.cocci > > CC: Shivani Bhardwaj > Signed-off-by: Fengguang Wu > --- > > xattr.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > --- a/drivers/staging/lustre/lustre/llite/xattr.c > +++ b/drivers/staging/lustre/lustre/llite/xattr.c > @@ -192,11 +192,10 @@ int ll_setxattr_common(struct inode *ino > valid, name, pv, size, 0, flags, > ll_i2suppgid(inode), &req); > #ifdef CONFIG_FS_POSIX_ACL > - if (new_value != NULL) > /* > * Release the posix ACL space. > */ > - kfree(new_value); > + kfree(new_value); > if (acl != NULL) > lustre_ext_acl_xattr_free(acl); > #endif > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo at vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From torvalds at linux-foundation.org Sat Nov 7 22:30:44 2015 From: torvalds at linux-foundation.org (Linus Torvalds) Date: Sat, 7 Nov 2015 14:30:44 -0800 Subject: [lustre-devel] next-20151101 - depmod issues with Lustre modules In-Reply-To: References: <8398.1446478793@turing-police.cc.vt.edu> Message-ID: On Sat, Nov 7, 2015 at 12:37 PM, Dmitry Safonov <0x7f454c46 at gmail.com> wrote: > Reproduced on mainline v4.3-9038-g27eb427bdc0960 with > Arch Linux default config (attached): > > depmod: ERROR: Found 2 modules in dependency cycles! > depmod: ERROR: Cycle detected: lnet -> libcfs -> lnet > make: *** [_modinst_post] Error 1 The reason seems to be that - lnet.ko provides the following functions needed by libcfs.ko: libcfs_next_nidstring libcfs_nid2str_r - libcfs.ko provides the following functions needed by lnet.ko: libcfs_debug libcfs_debug_msg libcfs_deregister_ioctl libcfs_register_ioctl libcfs_subsystem_debug lustre_insert_debugfs but I may have messed up something. Anyway, the problem seems to be that - insanely - lnet.ko provides those libcfs nid handling functions. They should be in libcfs, as far as I can tell, just judging by the name. Also judging by the use. The cause seems to be commit 47ca6ec2673e ("staging: lustre: move nidstring handling to LNet layer") by James Simmons. I do wonder if linux-next could perhaps do some modprobe testing too? Linus From y at ccs.ornl.gov Sat Nov 7 02:08:03 2015 From: y at ccs.ornl.gov (y at ccs.ornl.gov) Date: Fri, 6 Nov 2015 21:08:03 -0500 Subject: [lustre-devel] [PATCH] staging: lustre: remove IOC_LIBCFS_PING_TEST ioctl Message-ID: <1446862083-23815-1-git-send-email-y> From: James Simmons 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 --- .../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 50e8fd2..5e22820 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 From simmonsja at ornl.gov Mon Nov 9 21:41:15 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Mon, 9 Nov 2015 21:41:15 +0000 Subject: [lustre-devel] next-20151101 - depmod issues with Lustre modules In-Reply-To: References: <8398.1446478793@turing-police.cc.vt.edu> Message-ID: <966fe8db98d34137928b3cc86b7a2f17@EXCHCS32.ornl.gov> >Reproduced on mainline v4.3-9038-g27eb427bdc0960 with >Arch Linux default config (attached): > >depmod: ERROR: Found 2 modules in dependency cycles! >depmod: ERROR: Cycle detected: lnet -> libcfs -> lnet >make: *** [_modinst_post] Error 1 I submitted a patch (staging: lustre: remove IOC_LIBCFS_PING_TEST ioctl) to fix this. It should be merged soon. From julia.lawall at lip6.fr Mon Nov 9 22:04:40 2015 From: julia.lawall at lip6.fr (Julia Lawall) Date: Mon, 9 Nov 2015 22:04:40 +0000 (GMT) Subject: [lustre-devel] [PATCH] staging: lustre: acl: fix ifnullfree.cocci warnings In-Reply-To: <20151109195902.GB11820@kroah.com> References: <201511100309.kmJ2bdfD%fengguang.wu@intel.com> <20151109194350.GA117144@cairo> <20151109195902.GB11820@kroah.com> Message-ID: On Mon, 9 Nov 2015, Greg KH wrote: > On Tue, Nov 10, 2015 at 03:43:50AM +0800, kbuild test robot wrote: > > drivers/staging/lustre/lustre/llite/xattr.c:199:2-7: WARNING: NULL check before freeing functions like kfree, debugfs_remove, debugfs_remove_recursive or usb_free_urb is not needed. Maybe consider reorganizing relevant code to avoid passing NULL values. > > > > NULL check before some freeing functions is not needed. > > > > Based on checkpatch warning > > "kfree(NULL) is safe this check is probably not required" > > and kfreeaddr.cocci by Julia Lawall. > > > > Generated by: scripts/coccinelle/free/ifnullfree.cocci > > > > CC: Shivani Bhardwaj > > Signed-off-by: Fengguang Wu > > --- > > > > xattr.c | 3 +-- > > 1 file changed, 1 insertion(+), 2 deletions(-) > > > > --- a/drivers/staging/lustre/lustre/llite/xattr.c > > +++ b/drivers/staging/lustre/lustre/llite/xattr.c > > @@ -192,11 +192,10 @@ int ll_setxattr_common(struct inode *ino > > valid, name, pv, size, 0, flags, > > ll_i2suppgid(inode), &req); > > #ifdef CONFIG_FS_POSIX_ACL > > - if (new_value != NULL) > > /* > > * Release the posix ACL space. > > */ > > - kfree(new_value); > > + kfree(new_value); > > Looks like a bug in coccinelle, the comment line should also be indented > to the left. > > Julia, any ideas? I think it's on the border of what the person is going to have to resign themselves to doing by hand. I'm not sure which side of the border it is on, but I try to focus more on getting the code printed in the right place than on the comments. I can check on it, though, and maybe an easy fix is possible. thanks, julia From simmonsja at ornl.gov Tue Nov 10 00:44:48 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Tue, 10 Nov 2015 00:44:48 +0000 Subject: [lustre-devel] [PATCH] staging: lustre: export cfs_str2mask In-Reply-To: <5F41E759-F653-4A35-B2E5-15544BCF4BD2@intel.com> References: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> <1447000500-29427-6-git-send-email-jsimmons@infradead.org> <5F41E759-F653-4A35-B2E5-15544BCF4BD2@intel.com> Message-ID: >> 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 >> --- >> .../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. From simmonsja at ornl.gov Tue Nov 10 00:46:56 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Tue, 10 Nov 2015 00:46:56 +0000 Subject: [lustre-devel] [PATCH] staging: lustre: Handle nodemask on UMP machines In-Reply-To: <20151109111939.GB3868@sudip-pc> References: <1447000500-29427-1-git-send-email-jsimmons@infradead.org> <1447000500-29427-2-git-send-email-jsimmons@infradead.org> <20151109111939.GB3868@sudip-pc> Message-ID: <9bac5dac537b42d89c5bd7e88ed31f80@EXCHCS32.ornl.gov> >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 >> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4199 >> Reviewed-on: http://review.whamcloud.com/9219 >> Reviewed-by: Liang Zhen >> Reviewed-by: Li Xi >> Reviewed-by: Andreas Dilger > >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. From simmonsja at ornl.gov Tue Nov 10 00:50:04 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Tue, 10 Nov 2015 00:50:04 +0000 Subject: [lustre-devel] AnonHugePages Virtual Memory Commit bug In-Reply-To: References: Message-ID: >Dear All, > >Sorry to intervene and being rude and send this message directly to you folks. I have made several attempts to reach to linux-kernel at vger.kernel.org and my attempts have failed miserably and I have not be able make any >progress on this issue I have had for months now. > >With all humbleness I request your help so that I can get assistance with this issue of mine. Please guide me. I get hundreds-thousands of emails from vger.kernel.org, not a problem, but I cannot post my >question to the email above. Any help will be like God's grace for me now. > >My ISSUE: > > >I feel this is a bug. I am at kernel: 2.6.32-431.17.1.el6.x86_64 > >I have run into this many a times and only reboot has been the fix. > >Issue is on every idle(not running any user processes) machine(diskless node, & no swap) I see AnonHugePages limits the amount of memory that can be allocated to any new process/program on that that system. > >When ever I see this happen, atop always show vmcom > vmlim, i a situation where there is no swap disk I am thinking this is causing the system to lock up that memory from use by any other process on that system. Since you are new from my reading it looks like you are using the OpenSFS branch of Lustre. In that case please don’t post to the staging driver mailing list or the kernel mailing list. Which version are you using for your clients and servers and what distro? -------------- next part -------------- An HTML attachment was scrubbed... URL: From simmonsja at ornl.gov Tue Nov 10 01:03:03 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Tue, 10 Nov 2015 01:03:03 +0000 Subject: [lustre-devel] [PATCH] Staging: lustre: lustre_mds: Remove unused md_should_create In-Reply-To: <1446889464-21260-1-git-send-email-shraddha.6596@gmail.com> References: <1446889464-21260-1-git-send-email-shraddha.6596@gmail.com> Message-ID: <3ded8eac5c2d43cba0306ac4b052c9e3@EXCHCS32.ornl.gov> >From: lustre-devel [mailto:lustre-devel-bounces at lists.lustre.org] On Behalf Of Shraddha Barke >Sent: Saturday, November 07, 2015 4:44 AM >To: Greg Kroah-Hartman; lustre-devel at lists.lustre.org >Subject: [lustre-devel] [PATCH] Staging: lustre: lustre_mds: Remove unused md_should_create > >md_should_create has been defined in header file but not used. >Thus remove it. > >Signed-off-by: Shraddha Barke >--- > drivers/staging/lustre/lustre/include/lustre_mds.h | 6 ------> >1 file changed, 6 deletions(-) Lustre_mds.h is one of those dysfunctional headers used by client and server code. With the porting of some patches and a little rearranging this file could go away. I'm working out a plan for the pushing of the patches and should have it ready in a few days. Basically a lot of work went into cleaning up the CLIO client code since the performance was really bad from all the abstraction. You can read about it at https://jira.hpdd.intel.com/browse/LU-5880. That work needs very badly merged to the upstream client. From shivanib134 at gmail.com Tue Nov 10 04:51:00 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Tue, 10 Nov 2015 10:21:00 +0530 Subject: [lustre-devel] [PATCH v2 0/8] Remove wrapper function and clean up the code Message-ID: This patchset removes an unnecessary wrapper function, its prototype and replaces all its calls in different files with the standard function that it wraps. After applying this patch, code becomes cleaner. Changes in v2: Fix commit message and merge a patch Shivani Bhardwaj (8): Staging: lustre: dir: Replace function calls Staging: lustre: file: Replace function calls with standard function Staging: lustre: namei: Replace calls with kfree Staging: lustre: xattr_cache: Change function calls to kfree Staging: lustre: symlink: Substitute standard function Staging: lustre: llite_nfs: Replace function calls with kfree Staging: lustre: llite_close: Substitute function calls Staging: lustre: llite: Remove ll_finish_md_op_data wrapper drivers/staging/lustre/lustre/llite/dir.c | 14 ++++++------- drivers/staging/lustre/lustre/llite/file.c | 24 +++++++++++----------- drivers/staging/lustre/lustre/llite/llite_close.c | 2 +- .../staging/lustre/lustre/llite/llite_internal.h | 1 - drivers/staging/lustre/lustre/llite/llite_lib.c | 13 ++++-------- drivers/staging/lustre/lustre/llite/llite_nfs.c | 2 +- drivers/staging/lustre/lustre/llite/namei.c | 12 +++++------ drivers/staging/lustre/lustre/llite/symlink.c | 2 +- drivers/staging/lustre/lustre/llite/xattr_cache.c | 2 +- 9 files changed, 33 insertions(+), 39 deletions(-) -- 2.1.0 From shivanib134 at gmail.com Tue Nov 10 04:51:41 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Tue, 10 Nov 2015 10:21:41 +0530 Subject: [lustre-devel] [PATCH v2 1/8] Staging: lustre: dir: Replace function calls In-Reply-To: References: Message-ID: <11b41372e68c9a5edc4043b3bb7c408aabfb760a.1447129813.git.shivanib134@gmail.com> Replace the calls of the function ll_finish_md_op_data() with the standard function kfree(). Signed-off-by: Shivani Bhardwaj --- Changes in v2: Fix commit message and merge a patch drivers/staging/lustre/lustre/llite/dir.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 5c2ef92..ba3f469 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -182,7 +182,7 @@ static int ll_dir_filler(void *_hash, struct page *page0) op_data->op_npages = npages; op_data->op_offset = hash; rc = md_readpage(exp, op_data, page_pool, &request); - ll_finish_md_op_data(op_data); + kfree(op_data); if (rc < 0) { /* page0 is special, which was added into page cache early */ delete_from_page_cache(page0); @@ -363,7 +363,7 @@ struct page *ll_get_dir_page(struct inode *dir, __u64 hash, rc = md_enqueue(ll_i2sbi(dir)->ll_md_exp, &einfo, &it, op_data, &lockh, NULL, 0, NULL, 0); - ll_finish_md_op_data(op_data); + kfree(op_data); request = (struct ptlrpc_request *)it.d.lustre.it_data; if (request) @@ -669,7 +669,7 @@ static int ll_dir_setdirstripe(struct inode *dir, struct lmv_user_md *lump, from_kuid(&init_user_ns, current_fsuid()), from_kgid(&init_user_ns, current_fsgid()), cfs_curproc_cap_pack(), 0, &request); - ll_finish_md_op_data(op_data); + kfree(op_data); if (err) goto err_exit; err_exit: @@ -730,7 +730,7 @@ int ll_dir_setstripe(struct inode *inode, struct lov_user_md *lump, /* swabbing is done in lov_setstripe() on server side */ rc = md_setattr(sbi->ll_md_exp, op_data, lump, lum_size, NULL, 0, &req, NULL); - ll_finish_md_op_data(op_data); + kfree(op_data); ptlrpc_req_finished(req); if (rc) { if (rc != -EPERM && rc != -EACCES) @@ -802,7 +802,7 @@ int ll_dir_getstripe(struct inode *inode, struct lov_mds_md **lmmp, op_data->op_valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA; rc = md_getattr(sbi->ll_md_exp, op_data, &req); - ll_finish_md_op_data(op_data); + kfree(op_data); if (rc < 0) { CDEBUG(D_INFO, "md_getattr failed on inode %lu/%u: rc %d\n", inode->i_ino, @@ -868,7 +868,7 @@ int ll_get_mdt_idx(struct inode *inode) op_data->op_flags |= MF_GET_MDT_IDX; rc = md_getattr(sbi->ll_md_exp, op_data, NULL); mdtidx = op_data->op_mds; - ll_finish_md_op_data(op_data); + kfree(op_data); if (rc < 0) { CDEBUG(D_INFO, "md_getattr_name: %d\n", rc); return rc; @@ -1301,7 +1301,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg) op_data->op_valid = OBD_MD_FLID; rc = md_getattr_name(sbi->ll_md_exp, op_data, &request); - ll_finish_md_op_data(op_data); + kfree(op_data); if (rc < 0) { CDEBUG(D_INFO, "md_getattr_name: %d\n", rc); goto out_free; -- 2.1.0 From shivanib134 at gmail.com Tue Nov 10 04:52:19 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Tue, 10 Nov 2015 10:22:19 +0530 Subject: [lustre-devel] [PATCH v2 2/8] Staging: lustre: file: Replace function calls with standard function In-Reply-To: References: Message-ID: Replace the calls of the function ll_finish_md_op_data() with the standard function kfree(). Signed-off-by: Shivani Bhardwaj --- Changes in v2: Fix commit message and merge a patch drivers/staging/lustre/lustre/llite/file.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 02f2759..186b5af 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -202,7 +202,7 @@ static int ll_close_inode_openhandle(struct obd_export *md_exp, rc = -EBUSY; } - ll_finish_md_op_data(op_data); + kfree(op_data); out: if (exp_connect_som(exp) && !epoch_close && @@ -420,7 +420,7 @@ static int ll_intent_file_open(struct dentry *dentry, void *lmm, itp->it_flags |= MDS_OPEN_BY_FID; rc = md_intent_lock(sbi->ll_md_exp, op_data, lmm, lmmsize, itp, 0 /*unused */, &req, ll_md_blocking_ast, 0); - ll_finish_md_op_data(op_data); + kfree(op_data); if (rc == -ESTALE) { /* reason for keep own exit path - don`t flood log * with messages with -ESTALE errors. @@ -819,7 +819,7 @@ ll_lease_open(struct inode *inode, struct file *file, fmode_t fmode, * open in ll_md_blocking_ast(). Otherwise as ll_md_blocking_lease_ast * doesn't deal with openhandle, so normal openhandle will be leaked. */ LDLM_FL_NO_LRU | LDLM_FL_EXCL); - ll_finish_md_op_data(op_data); + kfree(op_data); ptlrpc_req_finished(req); if (rc < 0) goto out_release_it; @@ -1393,7 +1393,7 @@ int ll_lov_getstripe_ea_info(struct inode *inode, const char *filename, op_data->op_valid = OBD_MD_FLEASIZE | OBD_MD_FLDIREA; rc = md_getattr_name(sbi->ll_md_exp, op_data, &req); - ll_finish_md_op_data(op_data); + kfree(op_data); if (rc < 0) { CDEBUG(D_INFO, "md_getattr_name failed on %s: rc %d\n", filename, rc); @@ -2056,7 +2056,7 @@ static int ll_swap_layouts(struct file *file1, struct file *file2, rc = obd_iocontrol(LL_IOC_LOV_SWAP_LAYOUTS, ll_i2mdexp(llss->inode1), sizeof(*op_data), op_data, NULL); - ll_finish_md_op_data(op_data); + kfree(op_data); putgl: if (gid != 0) { @@ -2131,7 +2131,7 @@ static int ll_hsm_state_set(struct inode *inode, struct hsm_state_set *hss) rc = obd_iocontrol(LL_IOC_HSM_STATE_SET, ll_i2mdexp(inode), sizeof(*op_data), op_data, NULL); - ll_finish_md_op_data(op_data); + kfree(op_data); return rc; } @@ -2350,7 +2350,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg) if (copy_to_user((void *)arg, hus, sizeof(*hus))) rc = -EFAULT; - ll_finish_md_op_data(op_data); + kfree(op_data); kfree(hus); return rc; } @@ -2389,7 +2389,7 @@ ll_file_ioctl(struct file *file, unsigned int cmd, unsigned long arg) if (copy_to_user((char *)arg, hca, sizeof(*hca))) rc = -EFAULT; - ll_finish_md_op_data(op_data); + kfree(op_data); kfree(hca); return rc; } @@ -2761,7 +2761,7 @@ ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock) rc = rc2; } - ll_finish_md_op_data(op_data); + kfree(op_data); return rc; } @@ -2896,7 +2896,7 @@ static int __ll_inode_revalidate(struct dentry *dentry, __u64 ibits) based lookup */ &oit, 0, &req, ll_md_blocking_ast, 0); - ll_finish_md_op_data(op_data); + kfree(op_data); oit.it_create_mode &= ~M_CHECK_STALE; if (rc < 0) { rc = ll_inode_revalidate_fini(inode, rc); @@ -2938,7 +2938,7 @@ static int __ll_inode_revalidate(struct dentry *dentry, __u64 ibits) op_data->op_valid = valid; rc = md_getattr(sbi->ll_md_exp, op_data, &req); - ll_finish_md_op_data(op_data); + kfree(op_data); if (rc) { rc = ll_inode_revalidate_fini(inode, rc); return rc; @@ -3533,7 +3533,7 @@ again: ptlrpc_req_finished(it.d.lustre.it_data); it.d.lustre.it_data = NULL; - ll_finish_md_op_data(op_data); + kfree(op_data); mode = it.d.lustre.it_lock_mode; it.d.lustre.it_lock_mode = 0; -- 2.1.0 From shivanib134 at gmail.com Tue Nov 10 04:55:40 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Tue, 10 Nov 2015 10:25:40 +0530 Subject: [lustre-devel] [PATCH v2 3/8] Staging: lustre: namei: Replace calls with kfree In-Reply-To: References: Message-ID: <21f6b3b5ee44344e4405c5d3b26d13180e545dd4.1447129813.git.shivanib134@gmail.com> Replace the calls of the function ll_finish_md_op_data() with the standard function kfree(). Signed-off-by: Shivani Bhardwaj --- Changes in v2: Fix commit message and merge a patch drivers/staging/lustre/lustre/llite/namei.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 2ca2200..f058ebe2 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -531,7 +531,7 @@ static struct dentry *ll_lookup_it(struct inode *parent, struct dentry *dentry, rc = md_intent_lock(ll_i2mdexp(parent), op_data, NULL, 0, it, lookup_flags, &req, ll_md_blocking_ast, 0); - ll_finish_md_op_data(op_data); + kfree(op_data); if (rc < 0) { retval = ERR_PTR(rc); goto out; @@ -786,7 +786,7 @@ static int ll_new_node(struct inode *dir, struct dentry *dentry, from_kuid(&init_user_ns, current_fsuid()), from_kgid(&init_user_ns, current_fsgid()), cfs_curproc_cap_pack(), rdev, &request); - ll_finish_md_op_data(op_data); + kfree(op_data); if (err) goto err_exit; @@ -961,7 +961,7 @@ static int ll_unlink(struct inode *dir, struct dentry *dentry) ll_get_child_fid(dentry, &op_data->op_fid3); op_data->op_fid2 = op_data->op_fid3; rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request); - ll_finish_md_op_data(op_data); + kfree(op_data); if (rc) goto out; @@ -1011,7 +1011,7 @@ static int ll_rmdir(struct inode *dir, struct dentry *dentry) ll_get_child_fid(dentry, &op_data->op_fid3); op_data->op_fid2 = op_data->op_fid3; rc = md_unlink(ll_i2sbi(dir)->ll_md_exp, op_data, &request); - ll_finish_md_op_data(op_data); + kfree(op_data); if (rc == 0) { ll_update_times(request, dir); ll_stats_ops_tally(ll_i2sbi(dir), LPROC_LL_RMDIR, 1); @@ -1060,7 +1060,7 @@ static int ll_link(struct dentry *old_dentry, struct inode *dir, return PTR_ERR(op_data); err = md_link(sbi->ll_md_exp, op_data, &request); - ll_finish_md_op_data(op_data); + kfree(op_data); if (err) goto out; @@ -1096,7 +1096,7 @@ static int ll_rename(struct inode *old_dir, struct dentry *old_dentry, old_dentry->d_name.len, new_dentry->d_name.name, new_dentry->d_name.len, &request); - ll_finish_md_op_data(op_data); + kfree(op_data); if (!err) { ll_update_times(request, old_dir); ll_update_times(request, new_dir); -- 2.1.0 From shivanib134 at gmail.com Tue Nov 10 04:56:36 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Tue, 10 Nov 2015 10:26:36 +0530 Subject: [lustre-devel] [PATCH v2 4/8] Staging: lustre: xattr_cache: Change function calls to kfree In-Reply-To: References: Message-ID: <1999e1d863939bed3d168841eabb5b8d16ea36b8.1447129813.git.shivanib134@gmail.com> Change the calls of the function ll_finish_md_op_data() to the standard function kfree(). Signed-off-by: Shivani Bhardwaj --- Changes in v2: Fix commit message and merge a patch drivers/staging/lustre/lustre/llite/xattr_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/llite/xattr_cache.c b/drivers/staging/lustre/lustre/llite/xattr_cache.c index e1e599c..b7f3efc 100644 --- a/drivers/staging/lustre/lustre/llite/xattr_cache.c +++ b/drivers/staging/lustre/lustre/llite/xattr_cache.c @@ -306,7 +306,7 @@ static int ll_xattr_find_get_lock(struct inode *inode, op_data->op_valid = OBD_MD_FLXATTR | OBD_MD_FLXATTRLS; rc = md_enqueue(exp, &einfo, oit, op_data, &lockh, NULL, 0, NULL, 0); - ll_finish_md_op_data(op_data); + kfree(op_data); if (rc < 0) { CDEBUG(D_CACHE, -- 2.1.0 From shivanib134 at gmail.com Tue Nov 10 04:57:25 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Tue, 10 Nov 2015 10:27:25 +0530 Subject: [lustre-devel] [PATCH v2 5/8] Staging: lustre: symlink: Substitute standard function In-Reply-To: References: Message-ID: Substitute the standard function kfree() for the function ll_finish_md_op_data(). Signed-off-by: Shivani Bhardwaj --- Changes in v2: Fix commit message and merge a patch drivers/staging/lustre/lustre/llite/symlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/llite/symlink.c b/drivers/staging/lustre/lustre/llite/symlink.c index 69b2036..6b0d1cc 100644 --- a/drivers/staging/lustre/lustre/llite/symlink.c +++ b/drivers/staging/lustre/lustre/llite/symlink.c @@ -73,7 +73,7 @@ static int ll_readlink_internal(struct inode *inode, op_data->op_valid = OBD_MD_LINKNAME; rc = md_getattr(sbi->ll_md_exp, op_data, request); - ll_finish_md_op_data(op_data); + kfree(op_data); if (rc) { if (rc != -ENOENT) CERROR("inode %lu: rc = %d\n", inode->i_ino, rc); -- 2.1.0 From shivanib134 at gmail.com Tue Nov 10 04:58:05 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Tue, 10 Nov 2015 10:28:05 +0530 Subject: [lustre-devel] [PATCH v2 6/8] Staging: lustre: llite_nfs: Replace function calls with kfree In-Reply-To: References: Message-ID: <848f14d901de90a54298e65fb017dbe9cd841081.1447129813.git.shivanib134@gmail.com> Replace the calls of the function ll_finish_md_op_data() with the standard function kfree(). Signed-off-by: Shivani Bhardwaj --- Changes in v2: Fix commit message and merge a patch drivers/staging/lustre/lustre/llite/llite_nfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c b/drivers/staging/lustre/lustre/llite/llite_nfs.c index e578a11..a3a89a7 100644 --- a/drivers/staging/lustre/lustre/llite/llite_nfs.c +++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c @@ -306,7 +306,7 @@ static struct dentry *ll_get_parent(struct dentry *dchild) return (void *)op_data; rc = md_getattr_name(sbi->ll_md_exp, op_data, &req); - ll_finish_md_op_data(op_data); + kfree(op_data); if (rc) { CERROR("failure %d inode %lu get parent\n", rc, dir->i_ino); return ERR_PTR(rc); -- 2.1.0 From shivanib134 at gmail.com Tue Nov 10 04:58:44 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Tue, 10 Nov 2015 10:28:44 +0530 Subject: [lustre-devel] [PATCH v2 7/8] Staging: lustre: llite_close: Substitute function calls In-Reply-To: References: Message-ID: <391868d05a85377c8fb905578b9b01398c06adcb.1447129813.git.shivanib134@gmail.com> Substitute standard function kfree() in place of the function ll_finish_md_op_data(). Signed-off-by: Shivani Bhardwaj --- Changes in v2: Fix commit message and merge a patch drivers/staging/lustre/lustre/llite/llite_close.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_close.c b/drivers/staging/lustre/lustre/llite/llite_close.c index 3f348a3..c4f22ec 100644 --- a/drivers/staging/lustre/lustre/llite/llite_close.c +++ b/drivers/staging/lustre/lustre/llite/llite_close.c @@ -301,7 +301,7 @@ static void ll_done_writing(struct inode *inode) CERROR("inode %lu mdc done_writing failed: rc = %d\n", inode->i_ino, rc); out: - ll_finish_md_op_data(op_data); + kfree(op_data); if (och) { md_clear_open_replay_data(ll_i2sbi(inode)->ll_md_exp, och); kfree(och); -- 2.1.0 From shivanib134 at gmail.com Tue Nov 10 04:59:51 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Tue, 10 Nov 2015 10:29:51 +0530 Subject: [lustre-devel] [PATCH v2 8/8] Staging: lustre: llite: Remove ll_finish_md_op_data wrapper In-Reply-To: References: Message-ID: <6b7b11c3a0fec2e7c24d4dac18b351b9c4a7a069.1447129813.git.shivanib134@gmail.com> Remove the wrapper function ll_finish_md_op_data() and replace all its calls with the standard function kfree() that it wraps. Also, prototype of the function is removed as it is no longer of any use. Signed-off-by: Shivani Bhardwaj --- Changes in v2: Fix commit message and merge a patch drivers/staging/lustre/lustre/llite/llite_internal.h | 1 - drivers/staging/lustre/lustre/llite/llite_lib.c | 13 ++++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index 157c3284..d12d483 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -792,7 +792,6 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data, struct inode *i1, struct inode *i2, const char *name, int namelen, int mode, __u32 opc, void *data); -void ll_finish_md_op_data(struct md_op_data *op_data); int ll_get_obd_name(struct inode *inode, unsigned int cmd, unsigned long arg); char *ll_get_fsname(struct super_block *sb, char *buf, int buflen); void ll_open_cleanup(struct super_block *sb, struct ptlrpc_request *open_req); diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 4a8c759..143be87 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -1355,7 +1355,7 @@ out: if (!rc) rc = rc1; } - ll_finish_md_op_data(op_data); + kfree(op_data); if (!S_ISDIR(inode->i_mode)) { mutex_lock(&inode->i_mutex); @@ -1732,7 +1732,7 @@ int ll_iocontrol(struct inode *inode, struct file *file, op_data->op_valid = OBD_MD_FLFLAGS; rc = md_getattr(sbi->ll_md_exp, op_data, &req); - ll_finish_md_op_data(op_data); + kfree(op_data); if (rc) { CERROR("failure %d inode %lu\n", rc, inode->i_ino); return -abs(rc); @@ -1763,7 +1763,7 @@ int ll_iocontrol(struct inode *inode, struct file *file, op_data->op_attr.ia_valid |= ATTR_ATTR_FLAG; rc = md_setattr(sbi->ll_md_exp, op_data, NULL, 0, NULL, 0, &req, NULL); - ll_finish_md_op_data(op_data); + kfree(op_data); ptlrpc_req_finished(req); if (rc) return rc; @@ -1934,7 +1934,7 @@ void ll_open_cleanup(struct super_block *sb, struct ptlrpc_request *open_req) op_data->op_mod_time = get_seconds(); md_close(exp, op_data, NULL, &close_req); ptlrpc_req_finished(close_req); - ll_finish_md_op_data(op_data); + kfree(op_data); } int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req, @@ -2170,11 +2170,6 @@ struct md_op_data *ll_prep_md_op_data(struct md_op_data *op_data, return op_data; } -void ll_finish_md_op_data(struct md_op_data *op_data) -{ - kfree(op_data); -} - int ll_show_options(struct seq_file *seq, struct dentry *dentry) { struct ll_sb_info *sbi; -- 2.1.0 From shraddha.6596 at gmail.com Tue Nov 10 13:33:41 2015 From: shraddha.6596 at gmail.com (Shraddha Barke) Date: Tue, 10 Nov 2015 19:03:41 +0530 (IST) Subject: [lustre-devel] [PATCH] Staging: lustre: lustre_mds: Remove unused md_should_create In-Reply-To: <3ded8eac5c2d43cba0306ac4b052c9e3@EXCHCS32.ornl.gov> References: <1446889464-21260-1-git-send-email-shraddha.6596@gmail.com> <3ded8eac5c2d43cba0306ac4b052c9e3@EXCHCS32.ornl.gov> Message-ID: On Tue, 10 Nov 2015, Simmons, James A. wrote: >> From: lustre-devel [mailto:lustre-devel-bounces at lists.lustre.org] On Behalf Of Shraddha Barke >> Sent: Saturday, November 07, 2015 4:44 AM >> To: Greg Kroah-Hartman; lustre-devel at lists.lustre.org >> Subject: [lustre-devel] [PATCH] Staging: lustre: lustre_mds: Remove unused md_should_create >> >> md_should_create has been defined in header file but not used. >> Thus remove it. >> >> Signed-off-by: Shraddha Barke >> --- >> drivers/staging/lustre/lustre/include/lustre_mds.h | 6 ------> > >1 file changed, 6 deletions(-) > > Lustre_mds.h is one of those dysfunctional headers used by client and server code. With the porting > of some patches and a little rearranging this file could go away. I'm working out a plan for the pushing > of the patches and should have it ready in a few days. Basically a lot of work went into cleaning up > the CLIO client code since the performance was really bad from all the abstraction. You can read > about it at https://jira.hpdd.intel.com/browse/LU-5880. That work needs very badly merged to the > upstream client. Yes, I'll work on this and send patches. Kind Regards, Shraddha > > From shivanib134 at gmail.com Wed Nov 11 08:59:07 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Wed, 11 Nov 2015 14:29:07 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: cl_io: Remove cl_lock_descr_fid wrapper Message-ID: <1447232347-35621-1-git-send-email-shivanib134@gmail.com> Remove unnecessary wrapper function cl_lock_descr_fid() and replace all its calls with the function it wrapped. Signed-off-by: Shivani Bhardwaj --- drivers/staging/lustre/lustre/obdclass/cl_io.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c index e67cea7..37c449b 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_io.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c @@ -236,16 +236,11 @@ int cl_io_rw_init(const struct lu_env *env, struct cl_io *io, } EXPORT_SYMBOL(cl_io_rw_init); -static inline const struct lu_fid * -cl_lock_descr_fid(const struct cl_lock_descr *descr) -{ - return lu_object_fid(&descr->cld_obj->co_lu); -} - static int cl_lock_descr_sort(const struct cl_lock_descr *d0, const struct cl_lock_descr *d1) { - return lu_fid_cmp(cl_lock_descr_fid(d0), cl_lock_descr_fid(d1)) ?: + return lu_fid_cmp(lu_object_fid(&d0->cld_obj->co_lu), + lu_object_fid(&d1->cld_obj->co_lu)) ?: __diff_normalize(d0->cld_start, d1->cld_start); } @@ -254,7 +249,8 @@ static int cl_lock_descr_cmp(const struct cl_lock_descr *d0, { int ret; - ret = lu_fid_cmp(cl_lock_descr_fid(d0), cl_lock_descr_fid(d1)); + ret = lu_fid_cmp(lu_object_fid(&d0->cld_obj->co_lu), + lu_object_fid(&d1->cld_obj->co_lu)); if (ret) return ret; if (d0->cld_end < d1->cld_start) -- 2.1.0 From shivanib134 at gmail.com Wed Nov 11 10:13:28 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Wed, 11 Nov 2015 15:43:28 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: Remove cl_2queue_add wrapper Message-ID: <1447236808-45674-1-git-send-email-shivanib134@gmail.com> Remove the wrapper function cl_2queue_add() and replace all its calls in different files with the function it wrapped. Also, comments are added wherever necessary to make the working of function clear. Prototype of the function is also removed from the header file as it is no longer needed. Signed-off-by: Shivani Bhardwaj --- drivers/staging/lustre/lustre/include/cl_object.h | 1 - drivers/staging/lustre/lustre/llite/rw26.c | 5 ++++- drivers/staging/lustre/lustre/llite/vvp_io.c | 2 +- drivers/staging/lustre/lustre/obdclass/cl_io.c | 14 ++++---------- drivers/staging/lustre/lustre/obdecho/echo_client.c | 6 ++++-- 5 files changed, 13 insertions(+), 15 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/cl_object.h b/drivers/staging/lustre/lustre/include/cl_object.h index 73564f8..e81c591 100644 --- a/drivers/staging/lustre/lustre/include/cl_object.h +++ b/drivers/staging/lustre/lustre/include/cl_object.h @@ -3127,7 +3127,6 @@ void cl_page_list_disown (const struct lu_env *env, struct cl_io *io, struct cl_page_list *plist); void cl_2queue_init (struct cl_2queue *queue); -void cl_2queue_add (struct cl_2queue *queue, struct cl_page *page); void cl_2queue_disown (const struct lu_env *env, struct cl_io *io, struct cl_2queue *queue); void cl_2queue_discard (const struct lu_env *env, diff --git a/drivers/staging/lustre/lustre/llite/rw26.c b/drivers/staging/lustre/lustre/llite/rw26.c index 3da4c01..39fa13b 100644 --- a/drivers/staging/lustre/lustre/llite/rw26.c +++ b/drivers/staging/lustre/lustre/llite/rw26.c @@ -298,7 +298,10 @@ ssize_t ll_direct_rw_pages(const struct lu_env *env, struct cl_io *io, } if (likely(do_io)) { - cl_2queue_add(queue, clp); + /* + * Add a page to the incoming page list of 2-queue. + */ + cl_page_list_add(&queue->c2_qin, clp); /* * Set page clip to tell transfer formation engine diff --git a/drivers/staging/lustre/lustre/llite/vvp_io.c b/drivers/staging/lustre/lustre/llite/vvp_io.c index 37773c1..b7bdc35 100644 --- a/drivers/staging/lustre/lustre/llite/vvp_io.c +++ b/drivers/staging/lustre/lustre/llite/vvp_io.c @@ -849,7 +849,7 @@ static int vvp_io_read_page(const struct lu_env *env, * Add page into the queue even when it is marked uptodate above. * this will unlock it automatically as part of cl_page_list_disown(). */ - cl_2queue_add(queue, page); + cl_page_list_add(&queue->c2_qin, page); if (sbi->ll_ra_info.ra_max_pages_per_file && sbi->ll_ra_info.ra_max_pages) ll_readahead(env, io, ras, diff --git a/drivers/staging/lustre/lustre/obdclass/cl_io.c b/drivers/staging/lustre/lustre/obdclass/cl_io.c index 37c449b..e56dce5 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_io.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_io.c @@ -1212,15 +1212,6 @@ void cl_2queue_init(struct cl_2queue *queue) EXPORT_SYMBOL(cl_2queue_init); /** - * Add a page to the incoming page list of 2-queue. - */ -void cl_2queue_add(struct cl_2queue *queue, struct cl_page *page) -{ - cl_page_list_add(&queue->c2_qin, page); -} -EXPORT_SYMBOL(cl_2queue_add); - -/** * Disown pages in both lists of a 2-queue. */ void cl_2queue_disown(const struct lu_env *env, @@ -1258,7 +1249,10 @@ EXPORT_SYMBOL(cl_2queue_fini); void cl_2queue_init_page(struct cl_2queue *queue, struct cl_page *page) { cl_2queue_init(queue); - cl_2queue_add(queue, page); + /* + * Add a page to the incoming page list of 2-queue. + */ + cl_page_list_add(&queue->c2_qin, page); } EXPORT_SYMBOL(cl_2queue_init_page); diff --git a/drivers/staging/lustre/lustre/obdecho/echo_client.c b/drivers/staging/lustre/lustre/obdecho/echo_client.c index 35a2f59..d82a087 100644 --- a/drivers/staging/lustre/lustre/obdecho/echo_client.c +++ b/drivers/staging/lustre/lustre/obdecho/echo_client.c @@ -1228,8 +1228,10 @@ static int cl_echo_object_brw(struct echo_object *eco, int rw, u64 offset, cl_page_put(env, clp); break; } - - cl_2queue_add(queue, clp); + /* + * Add a page to the incoming page list of 2-queue. + */ + cl_page_list_add(&queue->c2_qin, clp); /* drop the reference count for cl_page_find, so that the page * will be freed in cl_2queue_fini. */ -- 2.1.0 From shivanib134 at gmail.com Wed Nov 11 10:21:46 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Wed, 11 Nov 2015 15:51:46 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper Message-ID: <1447237306-46901-1-git-send-email-shivanib134@gmail.com> Remove the wrapper function cl_lock_lockdep_init() and replace its only call with the function it wrapped. Signed-off-by: Shivani Bhardwaj --- drivers/staging/lustre/lustre/obdclass/cl_lock.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lustre/obdclass/cl_lock.c b/drivers/staging/lustre/lustre/obdclass/cl_lock.c index 1836dc0..813d0ab 100644 --- a/drivers/staging/lustre/lustre/obdclass/cl_lock.c +++ b/drivers/staging/lustre/lustre/obdclass/cl_lock.c @@ -147,11 +147,6 @@ static void cl_lock_trace0(int level, const struct lu_env *env, #ifdef CONFIG_LOCKDEP static struct lock_class_key cl_lock_key; -static void cl_lock_lockdep_init(struct cl_lock *lock) -{ - lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); -} - static void cl_lock_lockdep_acquire(const struct lu_env *env, struct cl_lock *lock, __u32 enqflags) { @@ -381,7 +376,7 @@ static struct cl_lock *cl_lock_alloc(const struct lu_env *env, CS_LOCKSTATE_INC(obj, CLS_NEW); CS_LOCK_INC(obj, total); CS_LOCK_INC(obj, create); - cl_lock_lockdep_init(lock); + lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); list_for_each_entry(obj, &head->loh_layers, co_lu.lo_linkage) { int err; -- 2.1.0 From lkp at intel.com Wed Nov 11 10:54:41 2015 From: lkp at intel.com (kbuild test robot) Date: Wed, 11 Nov 2015 18:54:41 +0800 Subject: [lustre-devel] [PATCH] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper In-Reply-To: <1447237306-46901-1-git-send-email-shivanib134@gmail.com> Message-ID: <201511111859.mIw4mICa%fengguang.wu@intel.com> Hi Shivani, [auto build test ERROR on staging/staging-testing] [also build test ERROR on v4.3 next-20151111] url: https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre-cl_lock-Remove-cl_lock_lockdep_init-wrapper/20151111-182452 config: m68k-allyesconfig (attached as .config) reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=m68k All errors (new ones prefixed by >>): In file included from include/linux/spinlock_types.h:18:0, from include/linux/spinlock.h:81, from include/linux/mmzone.h:7, from include/linux/gfp.h:5, from include/linux/slab.h:14, from drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:40, from drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:39, from drivers/staging/lustre/lustre/obdclass/cl_lock.c:43: drivers/staging/lustre/lustre/obdclass/cl_lock.c: In function 'cl_lock_alloc': >> drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: error: 'cl_lock_key' undeclared (first use in this function) lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); ^ include/linux/lockdep.h:401:15: note: in definition of macro 'lockdep_set_class_and_name' do { (void)(key); (void)(name); } while (0) ^ drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: note: each undeclared identifier is reported only once for each function it appears in lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); ^ include/linux/lockdep.h:401:15: note: in definition of macro 'lockdep_set_class_and_name' do { (void)(key); (void)(name); } while (0) ^ drivers/staging/lustre/lustre/obdclass/cl_lock.c: At top level: drivers/staging/lustre/lustre/obdclass/cl_lock.c:166:13: warning: 'cl_lock_lockdep_init' defined but not used [-Wunused-function] static void cl_lock_lockdep_init(struct cl_lock *lock) ^ vim +/cl_lock_key +379 drivers/staging/lustre/lustre/obdclass/cl_lock.c 373 lockdep_set_class(&lock->cll_guard, &cl_lock_guard_class); 374 init_waitqueue_head(&lock->cll_wq); 375 head = obj->co_lu.lo_header; 376 CS_LOCKSTATE_INC(obj, CLS_NEW); 377 CS_LOCK_INC(obj, total); 378 CS_LOCK_INC(obj, create); > 379 lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); 380 list_for_each_entry(obj, &head->loh_layers, 381 co_lu.lo_linkage) { 382 int err; --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation -------------- next part -------------- A non-text attachment was scrubbed... Name: .config.gz Type: application/octet-stream Size: 35206 bytes Desc: not available URL: From shivanib134 at gmail.com Wed Nov 11 17:21:36 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Wed, 11 Nov 2015 22:51:36 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper In-Reply-To: <201511111859.mIw4mICa%fengguang.wu@intel.com> References: <1447237306-46901-1-git-send-email-shivanib134@gmail.com> <201511111859.mIw4mICa%fengguang.wu@intel.com> Message-ID: On Wed, Nov 11, 2015 at 4:24 PM, kbuild test robot wrote: > Hi Shivani, > > [auto build test ERROR on staging/staging-testing] > [also build test ERROR on v4.3 next-20151111] > > url: https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre-cl_lock-Remove-cl_lock_lockdep_init-wrapper/20151111-182452 > config: m68k-allyesconfig (attached as .config) > reproduce: > wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross > chmod +x ~/bin/make.cross > # save the attached .config to linux build tree > make.cross ARCH=m68k > > All errors (new ones prefixed by >>): > > In file included from include/linux/spinlock_types.h:18:0, > from include/linux/spinlock.h:81, > from include/linux/mmzone.h:7, > from include/linux/gfp.h:5, > from include/linux/slab.h:14, > from drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:40, > from drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:39, > from drivers/staging/lustre/lustre/obdclass/cl_lock.c:43: > drivers/staging/lustre/lustre/obdclass/cl_lock.c: In function 'cl_lock_alloc': >>> drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: error: 'cl_lock_key' undeclared (first use in this function) > lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); > ^ > include/linux/lockdep.h:401:15: note: in definition of macro 'lockdep_set_class_and_name' > do { (void)(key); (void)(name); } while (0) > ^ > drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: note: each undeclared identifier is reported only once for each function it appears in > lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); > ^ > include/linux/lockdep.h:401:15: note: in definition of macro 'lockdep_set_class_and_name' > do { (void)(key); (void)(name); } while (0) > ^ > drivers/staging/lustre/lustre/obdclass/cl_lock.c: At top level: > drivers/staging/lustre/lustre/obdclass/cl_lock.c:166:13: warning: 'cl_lock_lockdep_init' defined but not used [-Wunused-function] > static void cl_lock_lockdep_init(struct cl_lock *lock) > ^ > > vim +/cl_lock_key +379 drivers/staging/lustre/lustre/obdclass/cl_lock.c > > 373 lockdep_set_class(&lock->cll_guard, &cl_lock_guard_class); > 374 init_waitqueue_head(&lock->cll_wq); > 375 head = obj->co_lu.lo_header; > 376 CS_LOCKSTATE_INC(obj, CLS_NEW); > 377 CS_LOCK_INC(obj, total); > 378 CS_LOCK_INC(obj, create); > > 379 lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); > 380 list_for_each_entry(obj, &head->loh_layers, > 381 co_lu.lo_linkage) { > 382 int err; > > --- > 0-DAY kernel test infrastructure Open Source Technology Center > https://lists.01.org/pipermail/kbuild-all Intel Corporation Hi all, I'm not getting any of these errors at compilation. I've checked thrice. Could you please tell what am I doing wrong so that I can avoid introducing errors in future patches? Thank you Shivani From gregkh at linuxfoundation.org Wed Nov 11 17:31:00 2015 From: gregkh at linuxfoundation.org (Greg KH) Date: Wed, 11 Nov 2015 09:31:00 -0800 Subject: [lustre-devel] [PATCH] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper In-Reply-To: References: <1447237306-46901-1-git-send-email-shivanib134@gmail.com> <201511111859.mIw4mICa%fengguang.wu@intel.com> Message-ID: <20151111173100.GA20846@kroah.com> On Wed, Nov 11, 2015 at 10:51:36PM +0530, Shivani Bhardwaj wrote: > On Wed, Nov 11, 2015 at 4:24 PM, kbuild test robot wrote: > > Hi Shivani, > > > > [auto build test ERROR on staging/staging-testing] > > [also build test ERROR on v4.3 next-20151111] > > > > url: https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre-cl_lock-Remove-cl_lock_lockdep_init-wrapper/20151111-182452 > > config: m68k-allyesconfig (attached as .config) > > reproduce: > > wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross > > chmod +x ~/bin/make.cross > > # save the attached .config to linux build tree > > make.cross ARCH=m68k > > > > All errors (new ones prefixed by >>): > > > > In file included from include/linux/spinlock_types.h:18:0, > > from include/linux/spinlock.h:81, > > from include/linux/mmzone.h:7, > > from include/linux/gfp.h:5, > > from include/linux/slab.h:14, > > from drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:40, > > from drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:39, > > from drivers/staging/lustre/lustre/obdclass/cl_lock.c:43: > > drivers/staging/lustre/lustre/obdclass/cl_lock.c: In function 'cl_lock_alloc': > >>> drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: error: 'cl_lock_key' undeclared (first use in this function) > > lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); > > ^ > > include/linux/lockdep.h:401:15: note: in definition of macro 'lockdep_set_class_and_name' > > do { (void)(key); (void)(name); } while (0) > > ^ > > drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: note: each undeclared identifier is reported only once for each function it appears in > > lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); > > ^ > > include/linux/lockdep.h:401:15: note: in definition of macro 'lockdep_set_class_and_name' > > do { (void)(key); (void)(name); } while (0) > > ^ > > drivers/staging/lustre/lustre/obdclass/cl_lock.c: At top level: > > drivers/staging/lustre/lustre/obdclass/cl_lock.c:166:13: warning: 'cl_lock_lockdep_init' defined but not used [-Wunused-function] > > static void cl_lock_lockdep_init(struct cl_lock *lock) > > ^ > > > > vim +/cl_lock_key +379 drivers/staging/lustre/lustre/obdclass/cl_lock.c > > > > 373 lockdep_set_class(&lock->cll_guard, &cl_lock_guard_class); > > 374 init_waitqueue_head(&lock->cll_wq); > > 375 head = obj->co_lu.lo_header; > > 376 CS_LOCKSTATE_INC(obj, CLS_NEW); > > 377 CS_LOCK_INC(obj, total); > > 378 CS_LOCK_INC(obj, create); > > > 379 lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); > > 380 list_for_each_entry(obj, &head->loh_layers, > > 381 co_lu.lo_linkage) { > > 382 int err; > > > > --- > > 0-DAY kernel test infrastructure Open Source Technology Center > > https://lists.01.org/pipermail/kbuild-all Intel Corporation > > Hi all, > > I'm not getting any of these errors at compilation. I've checked > thrice. Could you please tell what am I doing wrong so that I can > avoid introducing errors in future patches? Use the .config provided, odds are you have lockdep enabled. From shivanib134 at gmail.com Wed Nov 11 17:33:34 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Wed, 11 Nov 2015 23:03:34 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper In-Reply-To: <20151111173100.GA20846@kroah.com> References: <1447237306-46901-1-git-send-email-shivanib134@gmail.com> <201511111859.mIw4mICa%fengguang.wu@intel.com> <20151111173100.GA20846@kroah.com> Message-ID: On Wed, Nov 11, 2015 at 11:01 PM, Greg KH wrote: > On Wed, Nov 11, 2015 at 10:51:36PM +0530, Shivani Bhardwaj wrote: >> On Wed, Nov 11, 2015 at 4:24 PM, kbuild test robot wrote: >> > Hi Shivani, >> > >> > [auto build test ERROR on staging/staging-testing] >> > [also build test ERROR on v4.3 next-20151111] >> > >> > url: https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre-cl_lock-Remove-cl_lock_lockdep_init-wrapper/20151111-182452 >> > config: m68k-allyesconfig (attached as .config) >> > reproduce: >> > wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross >> > chmod +x ~/bin/make.cross >> > # save the attached .config to linux build tree >> > make.cross ARCH=m68k >> > >> > All errors (new ones prefixed by >>): >> > >> > In file included from include/linux/spinlock_types.h:18:0, >> > from include/linux/spinlock.h:81, >> > from include/linux/mmzone.h:7, >> > from include/linux/gfp.h:5, >> > from include/linux/slab.h:14, >> > from drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:40, >> > from drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:39, >> > from drivers/staging/lustre/lustre/obdclass/cl_lock.c:43: >> > drivers/staging/lustre/lustre/obdclass/cl_lock.c: In function 'cl_lock_alloc': >> >>> drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: error: 'cl_lock_key' undeclared (first use in this function) >> > lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); >> > ^ >> > include/linux/lockdep.h:401:15: note: in definition of macro 'lockdep_set_class_and_name' >> > do { (void)(key); (void)(name); } while (0) >> > ^ >> > drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: note: each undeclared identifier is reported only once for each function it appears in >> > lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); >> > ^ >> > include/linux/lockdep.h:401:15: note: in definition of macro 'lockdep_set_class_and_name' >> > do { (void)(key); (void)(name); } while (0) >> > ^ >> > drivers/staging/lustre/lustre/obdclass/cl_lock.c: At top level: >> > drivers/staging/lustre/lustre/obdclass/cl_lock.c:166:13: warning: 'cl_lock_lockdep_init' defined but not used [-Wunused-function] >> > static void cl_lock_lockdep_init(struct cl_lock *lock) >> > ^ >> > >> > vim +/cl_lock_key +379 drivers/staging/lustre/lustre/obdclass/cl_lock.c >> > >> > 373 lockdep_set_class(&lock->cll_guard, &cl_lock_guard_class); >> > 374 init_waitqueue_head(&lock->cll_wq); >> > 375 head = obj->co_lu.lo_header; >> > 376 CS_LOCKSTATE_INC(obj, CLS_NEW); >> > 377 CS_LOCK_INC(obj, total); >> > 378 CS_LOCK_INC(obj, create); >> > > 379 lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); >> > 380 list_for_each_entry(obj, &head->loh_layers, >> > 381 co_lu.lo_linkage) { >> > 382 int err; >> > >> > --- >> > 0-DAY kernel test infrastructure Open Source Technology Center >> > https://lists.01.org/pipermail/kbuild-all Intel Corporation >> >> Hi all, >> >> I'm not getting any of these errors at compilation. I've checked >> thrice. Could you please tell what am I doing wrong so that I can >> avoid introducing errors in future patches? > > Use the .config provided, odds are you have lockdep enabled. Thanks Greg. I tried that. Still no errors. Any other suggestion? From amir.shehata.whamcloud at gmail.com Thu Nov 12 20:50:22 2015 From: amir.shehata.whamcloud at gmail.com (Amir Shehata) Date: Thu, 12 Nov 2015 12:50:22 -0800 Subject: [lustre-devel] Multi-rail networking for Lustre In-Reply-To: <5620CE13.8020706@sgi.com> References: <5620CE13.8020706@sgi.com> Message-ID: To build up on this email trail, the Scope and Requirements document is now available here: http://wiki.lustre.org/Multi-Rail_LNet Exact link: http://wiki.lustre.org/images/7/73/Multi-Rail%2BScope%2Band%2BRequirements%2BDocument.pdf thanks amir On 16 October 2015 at 03:14, Olaf Weber wrote: > As some of you know, I held a presentation at the LAD'15 developers > meeting describing a proposal for implementing multi-rail networking > for Lustre. Some discussion on this list has referenced that talk. > The slides I used can be found here (1MB PDF): > > > http://wiki.lustre.org/images/7/79/LAD15_Lustre_Interface_Bonding_Final.pdf > > Since I grew up when a slide deck was a pile of transparencies, and > the rule was that you'd used too much text if people could get more > than the bare gist of your talk from the slides, the rest of this mail > is a slide-by-slide paraphrase of the talk. (There is no recording: > unless the other attendees weigh in this is the best you'll get.) A > few points are starred to indicate that they are after-the-talk > additions. > > > Slide 1: Lustre Interface Bonding > > Title - boring. > > > Slide 2: Interface Bonding > > Under various names multi-rail has been a longstanding wishlist > item. The various names do imply technical differences in how people > think about the problem and the solutions they propose. Despite the > title of the presentation, this proposal is best characterized by > "multi-rail", which is the term we've been using internally at SGI. > > Fujitsu contributed an implementation at the level of the infiniband > LND. It wasn't landed, and some of the reviewers felt that an LNet- > level solution should be investigated instead. This code was a big > influence on how I ended up approaching the problem. > > The current proposal is a collaboration between SGI and Intel. There > is in fact a contract and resources have been committed. Whether the > implementation will match this proposal is still an open question: > these are the early days, and your feedback is welcome and can be > taken into account. > > The end goal is general availability. > > > Slide 3: Why Multi-Rail? > > At SGI we care because our big systems can have tens of terabytes of > memory, and therefore need a fat connection to the rest of a Lustre > cluster. > > An additional complication is that big systems have an internal > "network" (NUMAlink in SGI's case) and it can matter a lot for > performance whether memory is close or remote to an interface. So what > we want is to have multiple interfaces spread throughout a system, and > then be able to use whichever will be most efficient for a particular > I/O operation. > > > Slide 4: Design Constraints > > These are a couple of constraints (or requirements if you prefer) that > the design tries to satisfy. > > Mixed-version clusters: it should not be a requirement to update an > entire cluster because of a few multi-rail capable nodes. Moreover, in > mixed- vendor situations, it may not be possible to upgrade an entire > cluster in one fell swoop. > > Simple configuration: creating and distributing configuration files, > and then keeping them in sync across a cluster, becomes tricky once > clusters get bigger. So I look for ways to have the systems configure > themselves. > > Adaptable: autoconfiguration is nice, but there are always cases where > it doesn't get things quite right. There have to be ways to fine-tune > a system or cluster, or even to completely override the > autoconfiguration. > > LNet-level implementation: there are three levels at which you can > reasonably implement multi-rail: LND, LNet, and PortalRPC. An > LND-level solution has as its main disadvantage that you cannot > balance I/O load between LNDs. A PortalRPC-level solution would > certainly follow a commonly design tenet in networking: "the upper > layers will take care of that". The upper layers just want a reliable > network, thankyouverymuch. LNet seems like the right spot for > something like this. It allows the implementation to be reasonably > self-contained within the LNet subsystem. > > > Slide 5: Example Lustre Cluster > > A simple cluster, used to guide the discussion. Missing in the picture > is the connecting fabric. Note that the UV client is much bigger than > the other nodes. > > > Slide 6: Mono-rail Single Fabric > > The kind of fabric we have today. The UV is starved for I/O. > > > Slide 7: LNets in a Single Fabric > > You can make additional interfaces in the UV useful by defining > multiple LNets in the fabric, and then carefully setting up aliases on > the nodes with only a single interface. This can be done today, but > setting this up correctly is a bit tricky, and involves cluster-wide > configuration. It is not something you'd like to have to retrofit top > an existing cluster. > > > Slide 8: Multi-rail Single Fabric > > An example of a fabric topology that we want to work well. Some nodes > have multiple interfaces, and when they do they can all be used to > talk to the other nodes. > > > Slide 9: Multi-rail Dual Fabric > > Similar to previous slide, but now with more LNets. Here too the goal > is active-active use of the LNets and all interfaces. > > > Slide 10: Mixed-Version Clusters > > This section of the presentation expands on the first item of Slide 4. > > > Slide 11: A Single Multi-Rail Node > > Assume we install multi-rail capable Lustre only on the UV. Would that > work? It turns out that it should actually work, though there are some > limits to the functionality. In particular, the MGS/MDS/OSS nodes will > not be aware that they know the UV by a number of NIDs, and it may be > best to avoid this by ensuring that the UV always uses the same > interface to talk to a particular node. This gives us the same > functionality as the multiple LNet example of Slide 7, but with a much > less complicated configuration. > > > Slide 12: Peer Version Discovery > > A multi-rail capable node would like to know if any peer node is also > multi-rail capable. The LNet protocol itself isn't properly versioned, > but the LNet ping protocol (not to be confused with the ptlrpc > pinger!) does transport a feature flags field. There are enough bits > available in that field that we can just steal one and use it to > indicate multi-rail capability in a ping reply. > > Note that a ping request does not carry any information beyond the > source NID of the requesting node. In particular, it cannot carry > version information to the node being pinged. > > > Slide 13: Peer Version Discovery > > A simple version discovery protocol can be built on LNet ping. > > 1) LNet keeps track of all known peers > 2) On first communication, do an LNet ping > 3) The node now knows the peer version > > And we get a list of the peer's interfaces for free. > > > Slide 14: Easy Configuration > > This section of the presentation expands on the second item of Slide 4. > > > Slide 15: Peer Interface Discovery > > The list of interfaces of a peer is all we need to know for the simple > cases. With that we know the peer under all its aliases, and can > determine whether any of the other local interfaces (for example those > on different LNets) can talk to the same peer. > > Now the peer also needs to know the node's interfaces. It would be > nice if there was a reliable way to get the peer to issue an LNet ping > to the node. For the most basic situation this works, but once I > looked at more complex situations it became clear that this cannot be > done reliably. So instead I propose to just have the node push a list > of its interfaces to the peer. > > > Slide 16: Peer Interface Discovery > > The push of the list is much like an LNet ping, except it does an > LNetPut() instead of an LNetGet(). > > This should be safe on several grounds. An LNet router doesn't do deep > inspection of Put/Get requests, so even a downrev router will be able > to forward them. If such a Put somehow ends up at a downrev peer, the > peer will silently drop the message. (The slide says a protocol error > will be returned, which is wrong.) > > > Slide 17: Configuring Interfaces on a Node > > How does a node know its own interfaces? This can be done in a way > similar to the current methods: kernel module parameters and/or > DLC. These use the same in-kernel parser, so the syntax is similar in > either case. > > networks=o2ib(ib0,ib1) > > This is an example where two interfaces are used in the same LNet. > > networks=o2ib(ib0[2],ib1[6])[2,6] > > The same example annotated with CPT information. This refers back to > Slide 3: on a big NUMA system it matters to be able to place the > helper threads for an interface close to that interface. > > * Of course that information is also available in the kernel, and with > a few extensions to the CPT mechanism, the kernel could itself find > the node to which an interface is connected, then find the/a CPT > that contains CPUs on that node. > > > Slide 18: Configuring Interfaces on a Node > > LNet uses credits to determine whether a node can send something > across an interface or to a peer. These credits are assigned > per-interface, for both local and peer credits. So more interfaces > means more credits overall. The defaults for credit-related tunables > can stay the same. On LNet routers, which do have multiple interfaces, > these tunables are already interpreted per interface. > > > Slide 19: Dynamic Configuration > > There is some scope for supporting hot-plugging interfaces. When > adding an interface, enable then push. When removing an interface, > push then disable. > > Note that removing the interface with the NID by which a node is known > to the MGS (MDS/...) might not be a good idea. If additional > interfaces are present then existing connections can remain active, > but establishing new ones becomes a problem. > > * This is a weakness of this proposal. > > > Slide 20: Adaptable > > This section of the presentation expands on the third item of Slide 4. > > > Slide 21: Interface Selection > > Selecting a local interface to send from, and a peer interface to send > to can use a number of rules. > > - Direct connection preferred: by default, don't go through an LNet > router unless there is no other path. Note that today an LNet router > will refuse to forward traffic if it believes there is a direct > connection between the node and the peer. > > - LNet network type: since using TCP only is the default, it also > makes sense to have a default rule that if a non-TCP network has been > configured, then that network should be used first. (As with all such > rules, it must be possible to override this default.) > > - NUMA criteria: pick a local interface that (i) can reach the peer, > (ii) is close to the memory used for the I/O, and (iii) close to the > CPU driving the I/O. > > - Local credits: pick a local interface depending on the availability > of credits. Credits are a useful indicator for how busy an interface > is. Systematically choosing the interface with the most available > credits should get you something resembling a round-robin > strategy. And this can even be used to balance across heterogeneous > interfaces/fabrics. > > - Peer credits: pick a peer interface depending on the availability of > peer credits. Then pick a local interface that connects to this peer > interface. > > - Other criteria, namely... > > > Slice 22: Routing Enhancements > > The fabric connecting nodes in a cluster can have a complicated > topology. So can have cases where a node has two interfaces N1,N2, and > a peer has two interfaces P1,P2, all on the same LNet, yet N1-P1 and > N2-P2 are preferred paths, while N1-P2 and N2-P1 should be avoided. > > So there should be ways to define preferred point-to-point connections > within an LNet. This solves the N1-P1 problem mentioned above. > > There also need to be ways to define a preference for using one LNet > over another, possibly for a subset of NIDs. This is the mechanism by > which the "anything but TCP" default can be overruled. > > The existing syntax for LNet routing can easily(?) be extended to > cover these cases. > > > Slide 23: Extra Considerations > > As you may have noticed, I'm looking for ways to be NUMA friendly. But > one thing I want to avoid is having Lustre nodes know too much about > the topology of their peers. How much is too much? I draw the line at > them knowing anything at all. > > At the PortalRPC level each RPC is a request/response pair. (This in > contrast to the LNet level put/ack and get/reply pairs that make up > the request and the response.) > > The PortalRPC layer is told the originating interface of a request. It > then sends the response to that same interface. The node sending the > request is usually a client -- especially when a large data transfer is > involved -- and this is a simple way to ensure that whatever NUMA-aware > policies it used to select the originating interface are also honored > when the response arrives. > > > Slide 24: Extra Considerations > > If for some reason the peer cannot send a message to the originating > interface, then any other interface will do. This is an event worth > logging, as it indicates a malfunction somewhere, and after that just > keeping the cluster going should be the prime concern. > > Trying all local-remote interface pairs might not be a good idea: > there can be too many combinations and the cumulative timeouts become > a problem. > > To avoid timeouts at the PortalRPC level, LNet may already need to > start resending a message long before the "offical" below-LND-level > timeout for message arrival has expired. > > The added network resiliency is limited. As noted for Slide 19, if the > interface that fails is has the NID by which a node is primarily > known, establishing new connections to that node becomes impossible. > > > Slide 25: Extra Considerations > > Failing nodes can be used to construct some very creative > scenarios. For example if a peer reboots with downrev software LNet on > a node will not be able to tell by itself. But in this case the > PortalRPC layer can signal to LNet that it needs to re-check the peer. > > NID reuse by different nodes is also a scenario that introduces a lot > complications. (Arguably it does do this already today.) > > If needed, it might be possible to sneak a 32 bit identifying cookie > into the NID each node reports on the loopback network. Whether this > would actually be useful (and for that matter how such cookies would > be assigned) is not clear. > > > Slide 26: LNet-level Implementation > > This section of the presentation expands on the fourth item of Slide 4. > > > Slide 27-29: Implementation Notes > > A staccato of notes on how to implement bits and pieces of the above. > There's too much text in the slides already, so I'm not paraphrasing. > > > Slide 30: Implementation Notes > > This slide gives a plausible way to cut the work into smaller pieces > that can be implemented as self-contained bits. > > 1) Split lnet_ni > 2) Local interface selection > *) Routing enhancements for local interface selection > 3) Split lnet_peer > 4) Ping on connect > 5) Implement push > 6) Peer interface selection > 7) Resending on failure > 8) Routing enhancements > > There's of course no guarantee that this division will survive the > actual coding. But if it does, then note that after step 2 is > implemented, the configuration of Slide 11 (single multi-rail node) > should already be working. > > > Slide 31: Feedback & Discussion > > Looking forward to further feedback & discussion here. > > > Slide 32: > > End title - also boring. > > > Olaf > > -- > Olaf Weber SGI Phone: +31(0)30-6696796 > Veldzigt 2b Fax: +31(0)30-6696799 > Sr Software Engineer 3454 PW de Meern Vnet: 955-6796 > Storage Software The Netherlands Email: olaf at sgi.com > _______________________________________________ > lustre-devel mailing list > lustre-devel at lists.lustre.org > http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sfr at canb.auug.org.au Thu Nov 12 22:17:12 2015 From: sfr at canb.auug.org.au (Stephen Rothwell) Date: Fri, 13 Nov 2015 09:17:12 +1100 Subject: [lustre-devel] next-20151101 - depmod issues with Lustre modules In-Reply-To: References: <8398.1446478793@turing-police.cc.vt.edu> Message-ID: <20151113091712.2018501c@canb.auug.org.au> Hi Linus, On Sat, 7 Nov 2015 14:30:44 -0800 Linus Torvalds wrote: > > I do wonder if linux-next could perhaps do some modprobe testing too? I have added an x86_64 allmodconfig modules_install to my end-of-day-before-release builds. Is that useful/sufficient? It seems to work fine at the moment. -- Cheers, Stephen Rothwell sfr at canb.auug.org.au From andreas.dilger at intel.com Fri Nov 13 00:59:01 2015 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Fri, 13 Nov 2015 00:59:01 +0000 Subject: [lustre-devel] [PATCH] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper In-Reply-To: References: <1447237306-46901-1-git-send-email-shivanib134@gmail.com> <201511111859.mIw4mICa%fengguang.wu@intel.com> Message-ID: On 2015/11/11, 10:21, "lustre-devel on behalf of Shivani Bhardwaj" wrote: >On Wed, Nov 11, 2015 at 4:24 PM, kbuild test robot wrote: >> Hi Shivani, >> >> [auto build test ERROR on staging/staging-testing] >> [also build test ERROR on v4.3 next-20151111] >> >> url: >>https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre- >>cl_lock-Remove-cl_lock_lockdep_init-wrapper/20151111-182452 >> config: m68k-allyesconfig (attached as .config) >> reproduce: >> wget >>https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin >>/make.cross -O ~/bin/make.cross >> chmod +x ~/bin/make.cross >> # save the attached .config to linux build tree >> make.cross ARCH=m68k >> >> All errors (new ones prefixed by >>): >> >> In file included from include/linux/spinlock_types.h:18:0, >> from include/linux/spinlock.h:81, >> from include/linux/mmzone.h:7, >> from include/linux/gfp.h:5, >> from include/linux/slab.h:14, >> from >>drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:40, >> from >>drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:39, >> from >>drivers/staging/lustre/lustre/obdclass/cl_lock.c:43: >> drivers/staging/lustre/lustre/obdclass/cl_lock.c: In function >>'cl_lock_alloc': >>>> drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: error: >>>>'cl_lock_key' undeclared (first use in this function) >> lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); >> ^ >> include/linux/lockdep.h:401:15: note: in definition of macro >>'lockdep_set_class_and_name' >> do { (void)(key); (void)(name); } while (0) >> ^ >> drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: note: each >>undeclared identifier is reported only once for each function it appears >>in >> lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); >> ^ >> include/linux/lockdep.h:401:15: note: in definition of macro >>'lockdep_set_class_and_name' >> do { (void)(key); (void)(name); } while (0) >> ^ >> drivers/staging/lustre/lustre/obdclass/cl_lock.c: At top level: >> drivers/staging/lustre/lustre/obdclass/cl_lock.c:166:13: warning: >>'cl_lock_lockdep_init' defined but not used [-Wunused-function] >> static void cl_lock_lockdep_init(struct cl_lock *lock) >> ^ >> >> vim +/cl_lock_key +379 drivers/staging/lustre/lustre/obdclass/cl_lock.c >> >> 373 lockdep_set_class(&lock->cll_guard, >>&cl_lock_guard_class); >> 374 init_waitqueue_head(&lock->cll_wq); >> 375 head = obj->co_lu.lo_header; >> 376 CS_LOCKSTATE_INC(obj, CLS_NEW); >> 377 CS_LOCK_INC(obj, total); >> 378 CS_LOCK_INC(obj, create); >> > 379 lockdep_set_class_and_name(lock, &cl_lock_key, >>"EXT"); >> 380 list_for_each_entry(obj, &head->loh_layers, >> 381 co_lu.lo_linkage) { >> 382 int err; >> >> --- >> 0-DAY kernel test infrastructure Open Source Technology >>Center >> https://lists.01.org/pipermail/kbuild-all Intel >>Corporation > >Hi all, > >I'm not getting any of these errors at compilation. I've checked >thrice. Could you please tell what am I doing wrong so that I can >avoid introducing errors in future patches? You need to have CONFIG_LOCKDEP_SUPPORT=y in your kernel .config file. Cheers, Andreas -- Andreas Dilger Lustre Principal Engineer Intel High Performance Data Division From shivanib134 at gmail.com Fri Nov 13 05:14:20 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Fri, 13 Nov 2015 10:44:20 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper In-Reply-To: References: <1447237306-46901-1-git-send-email-shivanib134@gmail.com> <201511111859.mIw4mICa%fengguang.wu@intel.com> Message-ID: On Fri, Nov 13, 2015 at 6:29 AM, Dilger, Andreas wrote: > On 2015/11/11, 10:21, "lustre-devel on behalf of Shivani Bhardwaj" > > wrote: > > >On Wed, Nov 11, 2015 at 4:24 PM, kbuild test robot wrote: > >> Hi Shivani, > >> > >> [auto build test ERROR on staging/staging-testing] > >> [also build test ERROR on v4.3 next-20151111] > >> > >> url: > >> > https://github.com/0day-ci/linux/commits/Shivani-Bhardwaj/staging-lustre- > >>cl_lock-Remove-cl_lock_lockdep_init-wrapper/20151111-182452 > >> config: m68k-allyesconfig (attached as .config) > >> reproduce: > >> wget > >> > https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin > >>/make.cross -O ~/bin/make.cross > >> chmod +x ~/bin/make.cross > >> # save the attached .config to linux build tree > >> make.cross ARCH=m68k > >> > >> All errors (new ones prefixed by >>): > >> > >> In file included from include/linux/spinlock_types.h:18:0, > >> from include/linux/spinlock.h:81, > >> from include/linux/mmzone.h:7, > >> from include/linux/gfp.h:5, > >> from include/linux/slab.h:14, > >> from > >>drivers/staging/lustre/lustre/obdclass/../include/obd_support.h:40, > >> from > >>drivers/staging/lustre/lustre/obdclass/../include/obd_class.h:39, > >> from > >>drivers/staging/lustre/lustre/obdclass/cl_lock.c:43: > >> drivers/staging/lustre/lustre/obdclass/cl_lock.c: In function > >>'cl_lock_alloc': > >>>> drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: error: > >>>>'cl_lock_key' undeclared (first use in this function) > >> lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); > >> ^ > >> include/linux/lockdep.h:401:15: note: in definition of macro > >>'lockdep_set_class_and_name' > >> do { (void)(key); (void)(name); } while (0) > >> ^ > >> drivers/staging/lustre/lustre/obdclass/cl_lock.c:379:37: note: each > >>undeclared identifier is reported only once for each function it appears > >>in > >> lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); > >> ^ > >> include/linux/lockdep.h:401:15: note: in definition of macro > >>'lockdep_set_class_and_name' > >> do { (void)(key); (void)(name); } while (0) > >> ^ > >> drivers/staging/lustre/lustre/obdclass/cl_lock.c: At top level: > >> drivers/staging/lustre/lustre/obdclass/cl_lock.c:166:13: warning: > >>'cl_lock_lockdep_init' defined but not used [-Wunused-function] > >> static void cl_lock_lockdep_init(struct cl_lock *lock) > >> ^ > >> > >> vim +/cl_lock_key +379 drivers/staging/lustre/lustre/obdclass/cl_lock.c > >> > >> 373 lockdep_set_class(&lock->cll_guard, > >>&cl_lock_guard_class); > >> 374 init_waitqueue_head(&lock->cll_wq); > >> 375 head = obj->co_lu.lo_header; > >> 376 CS_LOCKSTATE_INC(obj, CLS_NEW); > >> 377 CS_LOCK_INC(obj, total); > >> 378 CS_LOCK_INC(obj, create); > >> > 379 lockdep_set_class_and_name(lock, &cl_lock_key, > >>"EXT"); > >> 380 list_for_each_entry(obj, &head->loh_layers, > >> 381 co_lu.lo_linkage) { > >> 382 int err; > >> > >> --- > >> 0-DAY kernel test infrastructure Open Source Technology > >>Center > >> https://lists.01.org/pipermail/kbuild-all Intel > >>Corporation > > > >Hi all, > > > >I'm not getting any of these errors at compilation. I've checked > >thrice. Could you please tell what am I doing wrong so that I can > >avoid introducing errors in future patches? > > You need to have CONFIG_LOCKDEP_SUPPORT=y in your kernel .config file. > > Thanks Andreas It is already set to 'y'. I still do not get any errors. Can there be any other cause? > Cheers, Andreas > -- > Andreas Dilger > > Lustre Principal Engineer > Intel High Performance Data Division > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sudipm.mukherjee at gmail.com Fri Nov 13 13:03:31 2015 From: sudipm.mukherjee at gmail.com (Sudip Mukherjee) Date: Fri, 13 Nov 2015 18:33:31 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper In-Reply-To: References: <1447237306-46901-1-git-send-email-shivanib134@gmail.com> <201511111859.mIw4mICa%fengguang.wu@intel.com> <20151111173100.GA20846@kroah.com> Message-ID: <20151113130331.GB18741@sudip-pc> On Wed, Nov 11, 2015 at 11:03:34PM +0530, Shivani Bhardwaj wrote: > On Wed, Nov 11, 2015 at 11:01 PM, Greg KH wrote: > > On Wed, Nov 11, 2015 at 10:51:36PM +0530, Shivani Bhardwaj wrote: > >> On Wed, Nov 11, 2015 at 4:24 PM, kbuild test robot wrote: > >> > >> I'm not getting any of these errors at compilation. I've checked > >> thrice. Could you please tell what am I doing wrong so that I can > >> avoid introducing errors in future patches? > > > > Use the .config provided, odds are you have lockdep enabled. > > Thanks Greg. > I tried that. Still no errors. Any other suggestion? while removing the wrapper you missed that cl_lock_lockdep_init() is: static void cl_lock_lockdep_init(struct cl_lock *lock) { lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); } if CONFIG_LOCKDEP is defined. and if CONFIG_LOCKDEP is not defined then: static void cl_lock_lockdep_init(struct cl_lock *lock) {} your patch is using lockdep_set_class_and_name() in both cases. regards sudip From shivanib134 at gmail.com Fri Nov 13 13:06:22 2015 From: shivanib134 at gmail.com (Shivani Bhardwaj) Date: Fri, 13 Nov 2015 18:36:22 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: cl_lock: Remove cl_lock_lockdep_init wrapper In-Reply-To: <20151113130331.GB18741@sudip-pc> References: <1447237306-46901-1-git-send-email-shivanib134@gmail.com> <201511111859.mIw4mICa%fengguang.wu@intel.com> <20151111173100.GA20846@kroah.com> <20151113130331.GB18741@sudip-pc> Message-ID: On Fri, Nov 13, 2015 at 6:33 PM, Sudip Mukherjee wrote: > > On Wed, Nov 11, 2015 at 11:03:34PM +0530, Shivani Bhardwaj wrote: > > On Wed, Nov 11, 2015 at 11:01 PM, Greg KH wrote: > > > On Wed, Nov 11, 2015 at 10:51:36PM +0530, Shivani Bhardwaj wrote: > > >> On Wed, Nov 11, 2015 at 4:24 PM, kbuild test robot wrote: > > > >> > > >> I'm not getting any of these errors at compilation. I've checked > > >> thrice. Could you please tell what am I doing wrong so that I can > > >> avoid introducing errors in future patches? > > > > > > Use the .config provided, odds are you have lockdep enabled. > > > > Thanks Greg. > > I tried that. Still no errors. Any other suggestion? > > while removing the wrapper you missed that cl_lock_lockdep_init() is: > > static void cl_lock_lockdep_init(struct cl_lock *lock) > { > lockdep_set_class_and_name(lock, &cl_lock_key, "EXT"); > } > > if CONFIG_LOCKDEP is defined. > and if CONFIG_LOCKDEP is not defined then: > > static void cl_lock_lockdep_init(struct cl_lock *lock) > {} > > your patch is using lockdep_set_class_and_name() in both cases. > Yes! This is the problem. Thank you Sudip. > regards > sudip From Julia.Lawall at lip6.fr Sat Nov 14 12:30:34 2015 From: Julia.Lawall at lip6.fr (Julia Lawall) Date: Sat, 14 Nov 2015 13:30:34 +0100 Subject: [lustre-devel] [PATCH] lustre: constify inode_operations structures Message-ID: <1447504234-25165-1-git-send-email-Julia.Lawall@lip6.fr> The inode_operations structures are never modified, so declare them as const, like all the other inode_operations structures. Done with the help of Coccinelle. Signed-off-by: Julia Lawall --- drivers/staging/lustre/lustre/llite/file.c | 2 +- drivers/staging/lustre/lustre/llite/llite_internal.h | 4 ++-- drivers/staging/lustre/lustre/llite/symlink.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/file.c b/drivers/staging/lustre/lustre/llite/file.c index 02f2759..31cd6b3 100644 --- a/drivers/staging/lustre/lustre/llite/file.c +++ b/drivers/staging/lustre/lustre/llite/file.c @@ -3139,7 +3139,7 @@ struct file_operations ll_file_operations_noflock = { .lock = ll_file_noflock }; -struct inode_operations ll_file_inode_operations = { +const struct inode_operations ll_file_inode_operations = { .setattr = ll_setattr, .getattr = ll_getattr, .permission = ll_inode_permission, diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h index 9096d31..6102b29 100644 --- a/drivers/staging/lustre/lustre/llite/llite_internal.h +++ b/drivers/staging/lustre/lustre/llite/llite_internal.h @@ -705,7 +705,7 @@ extern const struct address_space_operations ll_aops; extern struct file_operations ll_file_operations; extern struct file_operations ll_file_operations_flock; extern struct file_operations ll_file_operations_noflock; -extern struct inode_operations ll_file_inode_operations; +extern const struct inode_operations ll_file_inode_operations; int ll_have_md_lock(struct inode *inode, __u64 *bits, ldlm_mode_t l_req_mode); ldlm_mode_t ll_take_md_lock(struct inode *inode, __u64 bits, @@ -805,7 +805,7 @@ struct inode *search_inode_for_lustre(struct super_block *sb, const struct lu_fid *fid); /* llite/symlink.c */ -extern struct inode_operations ll_fast_symlink_inode_operations; +extern const struct inode_operations ll_fast_symlink_inode_operations; /* llite/llite_close.c */ struct ll_close_queue { diff --git a/drivers/staging/lustre/lustre/llite/symlink.c b/drivers/staging/lustre/lustre/llite/symlink.c index 69b2036..32c4cf4 100644 --- a/drivers/staging/lustre/lustre/llite/symlink.c +++ b/drivers/staging/lustre/lustre/llite/symlink.c @@ -146,7 +146,7 @@ static void ll_put_link(struct inode *unused, void *cookie) ptlrpc_req_finished(cookie); } -struct inode_operations ll_fast_symlink_inode_operations = { +const struct inode_operations ll_fast_symlink_inode_operations = { .readlink = generic_readlink, .setattr = ll_setattr, .follow_link = ll_follow_link, From oleg.drokin at intel.com Mon Nov 16 22:43:53 2015 From: oleg.drokin at intel.com (Drokin, Oleg) Date: Mon, 16 Nov 2015 22:43:53 +0000 Subject: [lustre-devel] new tag 2.7.63 Message-ID: Hello! I just tagged new tag 2.7.63 in master branch of Lustre community repo. Bye, Oleg From simmonsja at ornl.gov Tue Nov 17 00:06:45 2015 From: simmonsja at ornl.gov (Simmons, James A.) Date: Tue, 17 Nov 2015 00:06:45 +0000 Subject: [lustre-devel] First draft on how to setup lustre client for testing. Message-ID: <8b5ac88cc5bc4127a558fb0e3e83fda9@EXCHCS32.ornl.gov> Here is a basic tutorial for people looking to test the upstream Lustre client. For the latest Lustre client code you needs to checkout the staging-next branch of the staging tree. The below commands will download the kernel tree containing the lustre source code of interest. This branch of the staging tree is what should be used to create Lustre patches for submission. git clone git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git git checkout origin/staging-next -b staging-next Once the tree is checked out you need to configure the Lustre client using the standard make config or menuconfig depending on your preference. You will find the Lustre client option in the Staging drivers section since it is still a work in progress. make config Device Drivers -> Staging drivers Enable the option "Lustre file system support" Once you enable the Lustre client new options will appear. Lustre file system client support (8192) Lustre obd max ioctl buffer bytes (default 8KB) (NEW) [ ] Enable Lustre DEBUG checks (NEW) Lustre virtual block device (NEW) -M- Lustre networking subsystem (1048576) Lustre lnet max transfer payload (default 2MB) (NEW) < > Lustre networking self testing (NEW) LNET infiniband support (NEW) The Lustre networking subsystem or LNet is the lowest layer of the Lustre filesystem. It was designed with the idea to allow network traffic to flow without concern for the under lying hardware. In a typical Lustre file system setup you have clients, routers, and a server backend. ------------ ---------- ---------- | client | --> | router | --> | server | ------------ ---------- ---------- For routers all that is needed is just the LNet layer. Currently the upstream client in not able to build stand alone LNet but that will change in the near future. One of the options you can change is the LNet transfer payload size. This allows you control the size of the largest packet that can be transmitted. Normally 1 MB is the default size. By default LNet will build with support for TCP/IP sockets. Additionally you can enable support for infiniband hardware usage with LNet if you have the hardware. The other option if interest to the user is Lustre networking self testing. When starting LNet default options will be used to tune your setup. Those options often are not best a specific setup. This is were the LNet self testing comes in. Using a special userland utility that communicates with LNet selftest you can analysis the performance you are getting out the LNet layer and adjust the tunables to meet your needs. Please be aware routers are not a requirement. The most simple setup you can have is a straight client to server connection. The rest of the options deal with Lustre itself. You can control the size of the data that is allowed over an ioctl. Just leave it at 8K. If you run into problems testing the client you can enable the DEBUG checks. Lastly is the virtual block device that allows lustre to mount as a loop back device. Once you have built your Lustre client now you will need tools to actually use it. You will need to checkout the Intel lustre repository to obtain the source for these tools. The following command will obtain the needed source code. git clone git://git.hpdd.intel.com/fs/lustre-release After you download the code you will need to apply the following patch so the tools can use sysfs as well as procfs. Currently the tools only support procfs by default. Grab the patch from http://review.whamcloud.com/#/c/14675 and just do a git apply of the patch from the top of the source tree. Once you have patched your tree run the following commands. cd lustre-release sh ./autogen.sh ./configure --disable-server For RHEL based systems run make rpms The completed rpms will be in the top directory of the source tree. Of the rpms only lustre-client-2.X.Y-***.rpm and lustre-client-tests-2.X.Y-***.rpm are of interest. The lustre-client-2.X.Y-***.rpm contains all the userland tools and libraries needed to manage a lustre file system. The lustre-client-tests-***.rpm contains a test suite that can be used to validate the file system on many levels. To use this you need to setup a complete file system and configure the test suite for your particular setup. If you are interested in creating a setup please contact the lustre-devel at lustre.org mailing list and some one will gladly help you out. For Debian/Ubuntu systems run make debs The finished debian will be in the lustre-release/debs directory. The packages of interest are: lustre-dev_2.X.Y-1_**.deb lustre-utils_2.X.Y-1_***.deb lustre-tests_2.X.Y-1_***.deb Just like in the case of rpms the lustre-tests-*.deb is for indepth lustre file system testing which requires a complex setup. Please contact lustre-devel at lustre.org if you are interested in such testing. For both cases for debs and rpms you will need to install them with no dependencies since the lustre utility tree is undergoing a transition to be used with the upstream client which means the packages have dependencies not needed. Once very thing is installed in your nodes and rebooted how you bring things up depends if it is a router or client. If you bring up a client and have a backend server setup you can easily mount your lustre filesystem with a command similar to: mount -t lustre -o "msg_server_address"@tcp:/myfilesystem /filesystem/path This will automatically setup everything for you. For the case of routers you just need to bring up the LNet layer. Also if you are only interested in LNet level testing this also applies for any nodes. For the routers the commands to bring up LNet are as follows: modprobe lnet lctl net up You should see "LNET configured". At this point LNet is up and running. You can further validate that LNet is up by issuing the command 'lctl list_nids'. This will list your local LNet setup. Normally something like the following appears: 10.0.0.20 at tcp. To test if you can reach a remote node just run for example: lctl ping 10.0.0.3 at tcp With a LNet set up you can either try out LNet selftest to simulate traffic between any nodes, not just routers. Documentation for this utility can be read at: http://wiki.old.lustre.org/manual/LustreManual20_HTML/LNETSelfTest.html This should get you started. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mahfouz.saif.elyazal at gmail.com Tue Nov 17 20:06:02 2015 From: mahfouz.saif.elyazal at gmail.com (Aya Mahfouz) Date: Tue, 17 Nov 2015 22:06:02 +0200 Subject: [lustre-devel] [PATCH 0/2] Remove the last use and definition of IS_PO2 Message-ID: Concerned with the removal of IS_PO2 by replacing its use with is_power_of_2 and then removing the definition. Aya Mahfouz (2): staging: lustre: hash.c: Replace IS_PO2 by is_power_of_2 staging: lustre: libcfs.h: remove IS_PO2 and __is_po2 drivers/staging/lustre/include/linux/libcfs/libcfs.h | 7 ------- drivers/staging/lustre/lustre/libcfs/hash.c | 3 ++- 2 files changed, 2 insertions(+), 8 deletions(-) -- 2.4.3 -- Kind Regards, Aya Saif El-yazal Mahfouz From mahfouz.saif.elyazal at gmail.com Tue Nov 17 20:06:40 2015 From: mahfouz.saif.elyazal at gmail.com (Aya Mahfouz) Date: Tue, 17 Nov 2015 22:06:40 +0200 Subject: [lustre-devel] [PATCH 1/2] staging: lustre: hash.c: Replace IS_PO2 by is_power_of_2 In-Reply-To: References: Message-ID: <9633b23fe9bf0cb2948d462376209573df73d5e2.1447790571.git.mahfouz.saif.elyazal@gmail.com> Replaces IS_PO2 by is_power_of_2. It is more accurate to use is_power_of_2 since it returns 1 for numbers that are powers of 2 only whereas IS_PO2 returns 1 for 0 and numbers that are powers of 2. Reviewed-by: Andreas Dilger Signed-off-by: Aya Mahfouz --- drivers/staging/lustre/lustre/libcfs/hash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c b/drivers/staging/lustre/lustre/libcfs/hash.c index d285117..4d50510 100644 --- a/drivers/staging/lustre/lustre/libcfs/hash.c +++ b/drivers/staging/lustre/lustre/libcfs/hash.c @@ -107,6 +107,7 @@ * table. Also, user can break the iteration by return 1 in callback. */ #include +#include #include "../../include/linux/libcfs/libcfs.h" @@ -1777,7 +1778,7 @@ cfs_hash_rehash_cancel_locked(struct cfs_hash *hs) for (i = 2; cfs_hash_is_rehashing(hs); i++) { cfs_hash_unlock(hs, 1); /* raise console warning while waiting too long */ - CDEBUG(IS_PO2(i >> 3) ? D_WARNING : D_INFO, + CDEBUG(is_power_of_2(i >> 3) ? D_WARNING : D_INFO, "hash %s is still rehashing, rescheded %d\n", hs->hs_name, i - 1); cond_resched(); -- 2.4.3 -- Kind Regards, Aya Saif El-yazal Mahfouz From mahfouz.saif.elyazal at gmail.com Tue Nov 17 20:07:07 2015 From: mahfouz.saif.elyazal at gmail.com (Aya Mahfouz) Date: Tue, 17 Nov 2015 22:07:07 +0200 Subject: [lustre-devel] [PATCH 2/2] staging: lustre: libcfs.h: remove IS_PO2 and __is_po2 In-Reply-To: References: Message-ID: <4773e080b8fdaded64596ee8b30e65cf9df7879b.1447790571.git.mahfouz.saif.elyazal@gmail.com> Removes IS_PO2 and __is_po2 since the uses of IS_PO2 have been replaced by is_power_of_2 Signed-off-by: Aya Mahfouz --- drivers/staging/lustre/include/linux/libcfs/libcfs.h | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index 4d74e8a..7f76b20 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -42,13 +42,6 @@ #include "curproc.h" -static inline int __is_po2(unsigned long long val) -{ - return !(val & (val - 1)); -} - -#define IS_PO2(val) __is_po2((unsigned long long)(val)) - #define LOWEST_BIT_SET(x) ((x) & ~((x) - 1)) /* -- 2.4.3 -- Kind Regards, Aya Saif El-yazal Mahfouz From xose.vazquez at gmail.com Fri Nov 20 11:43:16 2015 From: xose.vazquez at gmail.com (Xose Vazquez Perez) Date: Fri, 20 Nov 2015 12:43:16 +0100 Subject: [lustre-devel] Future of Lustre in staging Message-ID: <564F0754.10500@gmail.com> Hi, >From https://lwn.net/Articles/662979/ --cut-- Christoph complained a bit about the staging tree. He said that it breaks allmodconfig builds, but that problem was evidently fixed a while ago. He also dislikes the Lustre filesystem, which has been in staging for some time now; Greg agreed and said that he would like to delete it. It was generally agreed that the work being done on Lustre is not substantial enough to justify its continued presence. Christoph also said that the use of the staging tree for code that is about to be deleted could be improved; there are, he said, people doing white-space fixes on doomed code. --end-- Could anyone clarify it? -thanks- From jsimmons at infradead.org Fri Nov 20 23:35:36 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:36 -0500 Subject: [lustre-devel] [PATCH 00/40] Sync upstream lustre client LNet core Message-ID: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> This is the majority of the fixes that have gone into the LNet layer. Outside a few remaining patches this brings LNet close to what is running in production world wide. This patch series needs the remove IOC_LIBCFS_PING_TEST ioctl patch landed first. Amir Shehata (19): staging: lustre: Dynamic LNet Configuration (DLC) staging: lustre: Dynamic LNet Configuration (DLC) dynamic routing staging: lustre: DLC Feature dynamic net config staging: lustre: Dynamic LNet Configuration (DLC) IOCTL changes staging: lustre: Dynamic LNet Configuration (DLC) show command staging: lustre: fix crash due to NULL networks string staging: lustre: DLC user/kernel space glue code staging: lustre: fix kernel crash when network failed to start staging: lustre: improve LNet clean up code and API staging: lustre: return appropriate errno when adding route staging: lustre: startup lnet acceptor thread dynamically staging: lustre: reject invalid net configuration for lnet staging: lustre: return -EEXIST if NI is not unique staging: lustre: handle lnet_check_routes() errors staging: lustre: improvement to router checker staging: lustre: prevent assert on LNet module unload staging: lustre: remove messages from lazy portal on NI shutdown staging: lustre: remove unnecessary NULL check in IOC_LIBCFS_GET_NET staging: lustre: Allocate the correct number of rtr buffers Bruno Faccini (1): staging: lustre: avoid race during lnet acceptor thread termination Chris Horn (2): staging: lustre: reflect down routes in /proc/sys/lnet/routes staging: lustre: Use lnet_is_route_alive for router aliveness Doug Oucharek (1): staging: lustre: Remove LASSERTS from router checker Frank Zago (1): staging: lustre: do not memset after LIBCFS_ALLOC James Simmons (4): staging: lustre: drop *_t from end of struct lnet_text_buf staging: lustre: eliminate obsolete Cray SeaStar support staging: lustre: Fixes to make lnetctl function as expected. staging: lustre: test for sk_sleep presence in compact-2.6.h John L. Hammond (3): staging: lustre: remove uses of IS_ERR_VALUE() staging: lustre: remove LUSTRE_{,SRV_}LNET_PID staging: lustre: assume a kernel build Liang Zhen (3): staging: lustre: fix failure handle of create reply staging: lustre: return +ve for blocked lnet message staging: lustre: copy out libcfs ioctl inline buffer Sebastien Buisson (1): staging: lustre: fix 'NULL pointer dereference' errors for LNet frank zago (5): staging: lustre: make local functions static for LNet ni staging: lustre: add sparse annotation __user wherever needed for lnet staging: lustre: make some lnet functions static staging: lustre: missed a few cases of using NULL instead of 0 staging: lustre: remove unnecessary EXPORT_SYMBOL from lnet layer .../staging/lustre/include/linux/libcfs/libcfs.h | 2 - .../lustre/include/linux/libcfs/libcfs_ioctl.h | 89 ++- .../lustre/include/linux/libcfs/linux/libcfs.h | 3 - .../staging/lustre/include/linux/lnet/lib-dlc.h | 118 ++ .../staging/lustre/include/linux/lnet/lib-lnet.h | 60 +- .../staging/lustre/include/linux/lnet/lib-types.h | 38 +- drivers/staging/lustre/include/linux/lnet/lnetst.h | 96 +- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 4 +- .../staging/lustre/lnet/klnds/socklnd/socklnd.c | 7 +- drivers/staging/lustre/lnet/lnet/acceptor.c | 30 +- drivers/staging/lustre/lnet/lnet/api-ni.c | 1295 +++++++++++++------ drivers/staging/lustre/lnet/lnet/config.c | 113 +- drivers/staging/lustre/lnet/lnet/lib-eq.c | 3 - drivers/staging/lustre/lnet/lnet/lib-md.c | 3 - drivers/staging/lustre/lnet/lnet/lib-me.c | 3 - drivers/staging/lustre/lnet/lnet/lib-move.c | 195 ++- drivers/staging/lustre/lnet/lnet/lib-msg.c | 20 +- drivers/staging/lustre/lnet/lnet/lib-ptl.c | 54 +- drivers/staging/lustre/lnet/lnet/lib-socket.c | 3 - drivers/staging/lustre/lnet/lnet/module.c | 70 +- drivers/staging/lustre/lnet/lnet/peer.c | 197 +++- drivers/staging/lustre/lnet/lnet/router.c | 426 +++++-- drivers/staging/lustre/lnet/lnet/router_proc.c | 4 +- drivers/staging/lustre/lnet/selftest/conctl.c | 62 +- drivers/staging/lustre/lnet/selftest/conrpc.c | 4 +- drivers/staging/lustre/lnet/selftest/conrpc.h | 5 +- drivers/staging/lustre/lnet/selftest/console.c | 97 +- drivers/staging/lustre/lnet/selftest/console.h | 55 +- drivers/staging/lustre/lnet/selftest/framework.c | 10 - drivers/staging/lustre/lnet/selftest/module.c | 4 +- drivers/staging/lustre/lnet/selftest/rpc.c | 4 +- .../lustre/lustre/libcfs/linux/linux-module.c | 74 +- drivers/staging/lustre/lustre/libcfs/module.c | 104 +- drivers/staging/lustre/lustre/libcfs/tracefile.c | 6 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +- drivers/staging/lustre/lustre/llite/statahead.c | 8 +- drivers/staging/lustre/lustre/mdc/mdc_request.c | 18 +- drivers/staging/lustre/lustre/mgc/mgc_request.c | 9 +- .../lustre/lustre/obdclass/linux/linux-module.c | 17 +- drivers/staging/lustre/lustre/obdclass/llog.c | 13 +- .../staging/lustre/lustre/obdclass/obd_config.c | 4 +- drivers/staging/lustre/lustre/ptlrpc/events.c | 4 +- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 10 +- drivers/staging/lustre/lustre/ptlrpc/service.c | 29 +- 44 files changed, 2297 insertions(+), 1075 deletions(-) create mode 100644 drivers/staging/lustre/include/linux/lnet/lib-dlc.h From jsimmons at infradead.org Fri Nov 20 23:35:37 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:37 -0500 Subject: [lustre-devel] [PATCH 01/40] staging: lustre: drop *_t from end of struct lnet_text_buf In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-2-git-send-email-jsimmons@infradead.org> When lnet_text_buf data structure was transform from typedef to struct the *_t which is typical of typedef was not drop. This patch removes the *_t to be consistent. Signed-off-by: James Simmons --- drivers/staging/lustre/lnet/lnet/config.c | 57 ++++++++++++++--------------- 1 files changed, 27 insertions(+), 30 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c index 5390ee9..867c96e 100644 --- a/drivers/staging/lustre/lnet/lnet/config.c +++ b/drivers/staging/lustre/lnet/lnet/config.c @@ -37,7 +37,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include "../../include/linux/lnet/lib-lnet.h" -struct lnet_text_buf_t { /* tmp struct for parsing routes */ +struct lnet_text_buf { /* tmp struct for parsing routes */ struct list_head ltb_list; /* stash on lists */ int ltb_size; /* allocated size */ char ltb_text[0]; /* text buffer */ @@ -365,14 +365,14 @@ lnet_parse_networks(struct list_head *nilist, char *networks) return -EINVAL; } -static struct lnet_text_buf_t * +static struct lnet_text_buf * lnet_new_text_buf(int str_len) { - struct lnet_text_buf_t *ltb; + struct lnet_text_buf *ltb; int nob; /* NB allocate space for the terminating 0 */ - nob = offsetof(struct lnet_text_buf_t, ltb_text[str_len + 1]); + nob = offsetof(struct lnet_text_buf, ltb_text[str_len + 1]); if (nob > LNET_SINGLE_TEXTBUF_NOB) { /* _way_ conservative for "route net gateway..." */ CERROR("text buffer too big\n"); @@ -395,7 +395,7 @@ lnet_new_text_buf(int str_len) } static void -lnet_free_text_buf(struct lnet_text_buf_t *ltb) +lnet_free_text_buf(struct lnet_text_buf *ltb) { lnet_tbnob -= ltb->ltb_size; LIBCFS_FREE(ltb, ltb->ltb_size); @@ -404,10 +404,10 @@ lnet_free_text_buf(struct lnet_text_buf_t *ltb) static void lnet_free_text_bufs(struct list_head *tbs) { - struct lnet_text_buf_t *ltb; + struct lnet_text_buf *ltb; while (!list_empty(tbs)) { - ltb = list_entry(tbs->next, struct lnet_text_buf_t, ltb_list); + ltb = list_entry(tbs->next, struct lnet_text_buf, ltb_list); list_del(<b->ltb_list); lnet_free_text_buf(ltb); @@ -421,7 +421,7 @@ lnet_str2tbs_sep(struct list_head *tbs, char *str) char *sep; int nob; int i; - struct lnet_text_buf_t *ltb; + struct lnet_text_buf *ltb; INIT_LIST_HEAD(&pending); @@ -479,7 +479,7 @@ lnet_expand1tb(struct list_head *list, { int len1 = (int)(sep1 - str); int len2 = strlen(sep2 + 1); - struct lnet_text_buf_t *ltb; + struct lnet_text_buf *ltb; LASSERT(*sep1 == '['); LASSERT(*sep2 == ']'); @@ -636,7 +636,7 @@ lnet_parse_route(char *str, int *im_a_router) struct list_head *tmp2; __u32 net; lnet_nid_t nid; - struct lnet_text_buf_t *ltb; + struct lnet_text_buf *ltb; int rc; char *sep; char *token = str; @@ -692,8 +692,7 @@ lnet_parse_route(char *str, int *im_a_router) list_add_tail(tmp1, tmp2); while (tmp1 != tmp2) { - ltb = list_entry(tmp1, struct lnet_text_buf_t, - ltb_list); + ltb = list_entry(tmp1, struct lnet_text_buf, ltb_list); rc = lnet_str2tbs_expand(tmp1->next, ltb->ltb_text); if (rc < 0) @@ -733,13 +732,12 @@ lnet_parse_route(char *str, int *im_a_router) LASSERT(!list_empty(&gateways)); list_for_each(tmp1, &nets) { - ltb = list_entry(tmp1, struct lnet_text_buf_t, ltb_list); + ltb = list_entry(tmp1, struct lnet_text_buf, ltb_list); net = libcfs_str2net(ltb->ltb_text); LASSERT(net != LNET_NIDNET(LNET_NID_ANY)); list_for_each(tmp2, &gateways) { - ltb = list_entry(tmp2, struct lnet_text_buf_t, - ltb_list); + ltb = list_entry(tmp2, struct lnet_text_buf, ltb_list); nid = libcfs_str2nid(ltb->ltb_text); LASSERT(nid != LNET_NID_ANY); @@ -772,10 +770,10 @@ lnet_parse_route(char *str, int *im_a_router) static int lnet_parse_route_tbs(struct list_head *tbs, int *im_a_router) { - struct lnet_text_buf_t *ltb; + struct lnet_text_buf *ltb; while (!list_empty(tbs)) { - ltb = list_entry(tbs->next, struct lnet_text_buf_t, ltb_list); + ltb = list_entry(tbs->next, struct lnet_text_buf, ltb_list); if (lnet_parse_route(ltb->ltb_text, im_a_router) < 0) { lnet_free_text_bufs(tbs); @@ -909,8 +907,8 @@ lnet_splitnets(char *source, struct list_head *nets) int offset = 0; int offset2; int len; - struct lnet_text_buf_t *tb; - struct lnet_text_buf_t *tb2; + struct lnet_text_buf *tb; + struct lnet_text_buf *tb2; struct list_head *t; char *sep; char *bracket; @@ -919,7 +917,7 @@ lnet_splitnets(char *source, struct list_head *nets) LASSERT(!list_empty(nets)); LASSERT(nets->next == nets->prev); /* single entry */ - tb = list_entry(nets->next, struct lnet_text_buf_t, ltb_list); + tb = list_entry(nets->next, struct lnet_text_buf, ltb_list); for (;;) { sep = strchr(tb->ltb_text, ','); @@ -955,7 +953,7 @@ lnet_splitnets(char *source, struct list_head *nets) } list_for_each(t, nets) { - tb2 = list_entry(t, struct lnet_text_buf_t, ltb_list); + tb2 = list_entry(t, struct lnet_text_buf, ltb_list); if (tb2 == tb) continue; @@ -996,8 +994,8 @@ lnet_match_networks(char **networksp, char *ip2nets, __u32 *ipaddrs, int nip) struct list_head current_nets; struct list_head *t; struct list_head *t2; - struct lnet_text_buf_t *tb; - struct lnet_text_buf_t *tb2; + struct lnet_text_buf *tb; + struct lnet_text_buf *tb2; __u32 net1; __u32 net2; int len; @@ -1020,9 +1018,8 @@ lnet_match_networks(char **networksp, char *ip2nets, __u32 *ipaddrs, int nip) rc = 0; while (!list_empty(&raw_entries)) { - tb = list_entry(raw_entries.next, struct lnet_text_buf_t, - ltb_list); - + tb = list_entry(raw_entries.next, struct lnet_text_buf, + ltb_list); strncpy(source, tb->ltb_text, sizeof(source)); source[sizeof(source)-1] = '\0'; @@ -1047,13 +1044,13 @@ lnet_match_networks(char **networksp, char *ip2nets, __u32 *ipaddrs, int nip) dup = 0; list_for_each(t, ¤t_nets) { - tb = list_entry(t, struct lnet_text_buf_t, ltb_list); + tb = list_entry(t, struct lnet_text_buf, ltb_list); net1 = lnet_netspec2net(tb->ltb_text); LASSERT(net1 != LNET_NIDNET(LNET_NID_ANY)); list_for_each(t2, &matched_nets) { - tb2 = list_entry(t2, struct lnet_text_buf_t, - ltb_list); + tb2 = list_entry(t2, struct lnet_text_buf, + ltb_list); net2 = lnet_netspec2net(tb2->ltb_text); LASSERT(net2 != LNET_NIDNET(LNET_NID_ANY)); @@ -1073,7 +1070,7 @@ lnet_match_networks(char **networksp, char *ip2nets, __u32 *ipaddrs, int nip) } list_for_each_safe(t, t2, ¤t_nets) { - tb = list_entry(t, struct lnet_text_buf_t, ltb_list); + tb = list_entry(t, struct lnet_text_buf, ltb_list); list_del(&tb->ltb_list); list_add_tail(&tb->ltb_list, &matched_nets); -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:41 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:41 -0500 Subject: [lustre-devel] [PATCH 05/40] staging: lustre: eliminate obsolete Cray SeaStar support In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-6-git-send-email-jsimmons@infradead.org> Remove the bulk of code for the no longer supported SeaStar interconnect found on older Cray systems. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-1422 Reviewed-on: http://review.whamcloud.com/7469 Reviewed-by: Liang Zhen Reviewed-by: Doug Oucharek Reviewed-by: Chuck Fossen Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/router.c | 12 ++---------- 1 files changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 4ea651c..fa61ec9 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -631,7 +631,6 @@ lnet_parse_rc_info(lnet_rc_data_t *rcd) return; /* can't carry NI status info */ list_for_each_entry(rtr, &gw->lp_routes, lr_gwlist) { - int ptl_status = LNET_NI_STATUS_INVALID; int down = 0; int up = 0; int i; @@ -651,10 +650,7 @@ lnet_parse_rc_info(lnet_rc_data_t *rcd) continue; if (stat->ns_status == LNET_NI_STATUS_DOWN) { - if (LNET_NETTYP(LNET_NIDNET(nid)) != PTLLND) - down++; - else if (ptl_status != LNET_NI_STATUS_UP) - ptl_status = LNET_NI_STATUS_DOWN; + down++; continue; } @@ -663,10 +659,6 @@ lnet_parse_rc_info(lnet_rc_data_t *rcd) up = 1; break; } - /* ptl NIs are considered down only when - * they're all down */ - if (LNET_NETTYP(LNET_NIDNET(nid)) == PTLLND) - ptl_status = LNET_NI_STATUS_UP; continue; } @@ -680,7 +672,7 @@ lnet_parse_rc_info(lnet_rc_data_t *rcd) rtr->lr_downis = 0; continue; } - rtr->lr_downis = down + (ptl_status == LNET_NI_STATUS_DOWN); + rtr->lr_downis = down; } } -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:48 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:48 -0500 Subject: [lustre-devel] [PATCH 12/40] staging: lustre: Dynamic LNet Configuration (DLC) IOCTL changes In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-13-git-send-email-jsimmons@infradead.org> From: Amir Shehata This is the fourth patch of a set of patches that enables DLC. This patch changes the IOCTL infrastructure in preparation of adding extra IOCTL communication between user and kernel space. The changes include: - adding a common header to be passed to ioctl infra functions instead of passing an exact structure. This header is meant to be included in all structures to be passed through that interface. The IOCTL handler casts this header to a particular type that it expects - All sanity testing on the past in structure is performed in the generic ioctl infrastructure code. - All ioctl handlers changed to take the header instead of a particular structure type Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2456 Change-Id: I144706a14293637cd5f381d2c020faa0e9c21f6b Reviewed-on: http://review.whamcloud.com/8021 Reviewed-by: Doug Oucharek Reviewed-by: James Simmons Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- .../lustre/include/linux/libcfs/libcfs_ioctl.h | 29 +++++---- drivers/staging/lustre/lnet/lnet/module.c | 4 +- drivers/staging/lustre/lnet/selftest/conctl.c | 9 ++- drivers/staging/lustre/lnet/selftest/console.c | 2 +- drivers/staging/lustre/lnet/selftest/console.h | 1 - .../lustre/lustre/libcfs/linux/linux-module.c | 60 +++++++++---------- drivers/staging/lustre/lustre/libcfs/module.c | 50 ++++++++++++---- 7 files changed, 91 insertions(+), 64 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h index 485ab26..e14788c 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h @@ -43,9 +43,13 @@ #define LIBCFS_IOCTL_VERSION 0x0001000a -struct libcfs_ioctl_data { +struct libcfs_ioctl_hdr { __u32 ioc_len; __u32 ioc_version; +}; + +struct libcfs_ioctl_data { + struct libcfs_ioctl_hdr ioc_hdr; __u64 ioc_nid; __u64 ioc_u64[1]; @@ -70,11 +74,6 @@ struct libcfs_ioctl_data { #define ioc_priority ioc_u32[0] -struct libcfs_ioctl_hdr { - __u32 ioc_len; - __u32 ioc_version; -}; - struct libcfs_debug_ioctl_data { struct libcfs_ioctl_hdr hdr; unsigned int subs; @@ -84,13 +83,13 @@ struct libcfs_debug_ioctl_data { #define LIBCFS_IOC_INIT(data) \ do { \ memset(&data, 0, sizeof(data)); \ - data.ioc_version = LIBCFS_IOCTL_VERSION; \ - data.ioc_len = sizeof(data); \ + data.ioc_hdr.ioc_version = LIBCFS_IOCTL_VERSION; \ + data.ioc_hdr.ioc_len = sizeof(data); \ } while (0) struct libcfs_ioctl_handler { struct list_head item; - int (*handle_ioctl)(unsigned int cmd, struct libcfs_ioctl_data *data); + int (*handle_ioctl)(unsigned int cmd, struct libcfs_ioctl_hdr *hdr); }; #define DECLARE_IOCTL_HANDLER(ident, func) \ @@ -149,9 +148,9 @@ static inline int libcfs_ioctl_packlen(struct libcfs_ioctl_data *data) return len; } -static inline int libcfs_ioctl_is_invalid(struct libcfs_ioctl_data *data) +static inline bool libcfs_ioctl_is_invalid(struct libcfs_ioctl_data *data) { - if (data->ioc_len > (1<<30)) { + if (data->ioc_hdr.ioc_len > (1 << 30)) { CERROR("LIBCFS ioctl: ioc_len larger than 1<<30\n"); return 1; } @@ -187,7 +186,7 @@ static inline int libcfs_ioctl_is_invalid(struct libcfs_ioctl_data *data) CERROR("LIBCFS ioctl: plen2 nonzero but no pbuf2 pointer\n"); return 1; } - if ((__u32)libcfs_ioctl_packlen(data) != data->ioc_len) { + if ((__u32)libcfs_ioctl_packlen(data) != data->ioc_hdr.ioc_len) { CERROR("LIBCFS ioctl: packlen != ioc_len\n"); return 1; } @@ -207,7 +206,11 @@ static inline int libcfs_ioctl_is_invalid(struct libcfs_ioctl_data *data) int libcfs_register_ioctl(struct libcfs_ioctl_handler *hand); int libcfs_deregister_ioctl(struct libcfs_ioctl_handler *hand); -int libcfs_ioctl_getdata(char *buf, char *end, void *arg); +int libcfs_ioctl_getdata(struct libcfs_ioctl_hdr *buf, __u32 buf_len, + const void __user *arg); +int libcfs_ioctl_getdata_len(const struct libcfs_ioctl_hdr __user *arg, + __u32 *buf_len); int libcfs_ioctl_popdata(void *arg, void *buf, int size); +int libcfs_ioctl_data_adjust(struct libcfs_ioctl_data *data); #endif /* __LIBCFS_IOCTL_H__ */ diff --git a/drivers/staging/lustre/lnet/lnet/module.c b/drivers/staging/lustre/lnet/lnet/module.c index ac2fdf0..0afdad0 100644 --- a/drivers/staging/lustre/lnet/lnet/module.c +++ b/drivers/staging/lustre/lnet/lnet/module.c @@ -84,7 +84,7 @@ lnet_unconfigure(void) } static int -lnet_ioctl(unsigned int cmd, struct libcfs_ioctl_data *data) +lnet_ioctl(unsigned int cmd, struct libcfs_ioctl_hdr *hdr) { int rc; @@ -101,7 +101,7 @@ lnet_ioctl(unsigned int cmd, struct libcfs_ioctl_data *data) * I'm called into it */ rc = LNetNIInit(LNET_PID_ANY); if (rc >= 0) { - rc = LNetCtl(cmd, data); + rc = LNetCtl(cmd, hdr); LNetNIFini(); } return rc; diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c index 2ca7d0e..3dc8ea7 100644 --- a/drivers/staging/lustre/lnet/selftest/conctl.c +++ b/drivers/staging/lustre/lnet/selftest/conctl.c @@ -814,15 +814,20 @@ out: } int -lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_data *data) +lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_hdr *hdr) { char *buf; - int opc = data->ioc_u32[0]; + struct libcfs_ioctl_data *data; + int opc; int rc; if (cmd != IOC_LIBCFS_LNETST) return -EINVAL; + data = container_of(hdr, struct libcfs_ioctl_data, ioc_hdr); + + opc = data->ioc_u32[0]; + if (data->ioc_plen1 > PAGE_CACHE_SIZE) return -EINVAL; diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c index 5619fc4..898912b 100644 --- a/drivers/staging/lustre/lnet/selftest/console.c +++ b/drivers/staging/lustre/lnet/selftest/console.c @@ -1977,7 +1977,7 @@ static void lstcon_init_acceptor_service(void) lstcon_acceptor_service.sv_wi_total = SFW_FRWK_WI_MAX; } -extern int lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_data *data); +extern int lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_hdr *hdr); static DECLARE_IOCTL_HANDLER(lstcon_ioctl_handler, lstcon_ioctl_entry); diff --git a/drivers/staging/lustre/lnet/selftest/console.h b/drivers/staging/lustre/lnet/selftest/console.h index 3f3286c..7af3540 100644 --- a/drivers/staging/lustre/lnet/selftest/console.h +++ b/drivers/staging/lustre/lnet/selftest/console.h @@ -184,7 +184,6 @@ lstcon_id2hash (lnet_process_id_t id, struct list_head *hash) } int lstcon_console_init(void); -int lstcon_ioctl_entry(unsigned int cmd, struct libcfs_ioctl_data *data); int lstcon_console_fini(void); int lstcon_session_match(lst_sid_t sid); int lstcon_session_new(char *name, int key, unsigned version, diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c index 70a99cf..ef1c247 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c @@ -40,51 +40,47 @@ #define LNET_MINOR 240 -int libcfs_ioctl_getdata(char *buf, char *end, void *arg) +int libcfs_ioctl_data_adjust(struct libcfs_ioctl_data *data) { - struct libcfs_ioctl_hdr *hdr; - struct libcfs_ioctl_data *data; - int orig_len; - - hdr = (struct libcfs_ioctl_hdr *)buf; - data = (struct libcfs_ioctl_data *)buf; - - if (copy_from_user(buf, arg, sizeof(*hdr))) - return -EFAULT; - - if (hdr->ioc_version != LIBCFS_IOCTL_VERSION) { - CERROR("PORTALS: version mismatch kernel vs application\n"); + if (libcfs_ioctl_is_invalid(data)) { + CERROR("LNET: ioctl not correctly formatted\n"); return -EINVAL; } - if (hdr->ioc_len >= end - buf) { - CERROR("PORTALS: user buffer exceeds kernel buffer\n"); - return -EINVAL; - } + if (data->ioc_inllen1 != 0) + data->ioc_inlbuf1 = &data->ioc_bulk[0]; - if (hdr->ioc_len < sizeof(struct libcfs_ioctl_data)) { - CERROR("PORTALS: user buffer too small for ioctl\n"); - return -EINVAL; - } + if (data->ioc_inllen2 != 0) + data->ioc_inlbuf2 = &data->ioc_bulk[0] + + cfs_size_round(data->ioc_inllen1); + + return 0; +} + +int libcfs_ioctl_getdata_len(const struct libcfs_ioctl_hdr __user *arg, + __u32 *len) +{ + struct libcfs_ioctl_hdr hdr; - orig_len = hdr->ioc_len; - if (copy_from_user(buf, arg, hdr->ioc_len)) + if (copy_from_user(&hdr, arg, sizeof(hdr))) return -EFAULT; - if (orig_len != data->ioc_len) - return -EINVAL; - if (libcfs_ioctl_is_invalid(data)) { - CERROR("PORTALS: ioctl not correctly formatted\n"); + if (hdr.ioc_version != LIBCFS_IOCTL_VERSION) { + CERROR("LNET: version mismatch expected %#x, got %#x\n", + LIBCFS_IOCTL_VERSION, hdr.ioc_version); return -EINVAL; } - if (data->ioc_inllen1) - data->ioc_inlbuf1 = &data->ioc_bulk[0]; + *len = hdr.ioc_len; - if (data->ioc_inllen2) - data->ioc_inlbuf2 = &data->ioc_bulk[0] + - cfs_size_round(data->ioc_inllen1); + return 0; +} +int libcfs_ioctl_getdata(struct libcfs_ioctl_hdr *buf, __u32 buf_len, + const void __user *arg) +{ + if (copy_from_user(buf, arg, buf_len)) + return -EFAULT; return 0; } diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c index 75247e9..5348699 100644 --- a/drivers/staging/lustre/lustre/libcfs/module.c +++ b/drivers/staging/lustre/lustre/libcfs/module.c @@ -54,6 +54,8 @@ # define DEBUG_SUBSYSTEM S_LNET +#define LIBCFS_MAX_IOCTL_BUF_LEN 2048 + #include "../../include/linux/libcfs/libcfs.h" #include @@ -241,11 +243,21 @@ int libcfs_deregister_ioctl(struct libcfs_ioctl_handler *hand) } EXPORT_SYMBOL(libcfs_deregister_ioctl); -static int libcfs_ioctl_int(struct cfs_psdev_file *pfile, unsigned long cmd, - void *arg, struct libcfs_ioctl_data *data) +static int libcfs_ioctl_handle(struct cfs_psdev_file *pfile, unsigned long cmd, + void *arg, struct libcfs_ioctl_hdr *hdr) { + struct libcfs_ioctl_data *data = NULL; int err = -EINVAL; + if ((cmd <= IOC_LIBCFS_LNETST) || + (cmd >= IOC_LIBCFS_REGISTER_MYNID)) { + data = container_of(hdr, struct libcfs_ioctl_data, ioc_hdr); + err = libcfs_ioctl_data_adjust(data); + if (err != 0) { + return err; + } + } + switch (cmd) { case IOC_LIBCFS_CLEAR_DEBUG: libcfs_debug_clear_buffer(); @@ -280,11 +292,11 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile, unsigned long cmd, err = -EINVAL; down_read(&ioctl_list_sem); list_for_each_entry(hand, &ioctl_list, item) { - err = hand->handle_ioctl(cmd, data); + err = hand->handle_ioctl(cmd, hdr); if (err != -EINVAL) { if (err == 0) err = libcfs_ioctl_popdata(arg, - data, sizeof(*data)); + hdr, hdr->ioc_len); break; } } @@ -298,26 +310,38 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile, unsigned long cmd, static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *arg) { - char *buf; - struct libcfs_ioctl_data *data; + struct libcfs_ioctl_hdr *hdr; int err = 0; + __u32 buf_len; + + err = libcfs_ioctl_getdata_len(arg, &buf_len); + if (err != 0) + return err; + + /* + * do a check here to restrict the size of the memory + * to allocate to guard against DoS attacks. + */ + if (buf_len > LIBCFS_MAX_IOCTL_BUF_LEN) { + CERROR("LNET: user buffer exceeds kernel buffer\n"); + return -EINVAL; + } - LIBCFS_ALLOC_GFP(buf, 1024, GFP_KERNEL); - if (buf == NULL) + LIBCFS_ALLOC_GFP(hdr, buf_len, GFP_KERNEL); + if (!hdr) return -ENOMEM; /* 'cmd' and permissions get checked in our arch-specific caller */ - if (libcfs_ioctl_getdata(buf, buf + 800, arg)) { - CERROR("PORTALS ioctl: data error\n"); + if (libcfs_ioctl_getdata(hdr, buf_len, arg)) { + CERROR("LNET ioctl: data error\n"); err = -EINVAL; goto out; } - data = (struct libcfs_ioctl_data *)buf; - err = libcfs_ioctl_int(pfile, cmd, arg, data); + err = libcfs_ioctl_handle(pfile, cmd, arg, hdr); out: - LIBCFS_FREE(buf, 1024); + LIBCFS_FREE(hdr, buf_len); return err; } -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:55 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:55 -0500 Subject: [lustre-devel] [PATCH 19/40] staging: lustre: copy out libcfs ioctl inline buffer In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-20-git-send-email-jsimmons@infradead.org> From: Liang Zhen - libcfs_ioctl_popdata should copy out inline buffers. - code cleanup for libcfs ioctl handler - error number fix for obd_ioctl_getdata - add new function libcfs_ioctl_unpack for upcoming patches Signed-off-by: Liang Zhen Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5435 Reviewed-on: http://review.whamcloud.com/11313 Reviewed-by: Bobi Jam Reviewed-by: Johann Lombardi Reviewed-by: Oleg Drokin --- .../lustre/include/linux/libcfs/libcfs_ioctl.h | 24 +++- drivers/staging/lustre/lnet/lnet/api-ni.c | 2 + .../lustre/lustre/libcfs/linux/linux-module.c | 45 +++++--- drivers/staging/lustre/lustre/libcfs/module.c | 119 ++++++++------------ .../lustre/lustre/obdclass/linux/linux-module.c | 17 +-- 5 files changed, 97 insertions(+), 110 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h index f24330d..3468933 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h @@ -49,6 +49,9 @@ struct libcfs_ioctl_hdr { __u32 ioc_version; }; +/** max size to copy from userspace */ +#define LIBCFS_IOC_DATA_MAX (128 * 1024) + struct libcfs_ioctl_data { struct libcfs_ioctl_hdr ioc_hdr; @@ -240,11 +243,22 @@ static inline bool libcfs_ioctl_is_invalid(struct libcfs_ioctl_data *data) int libcfs_register_ioctl(struct libcfs_ioctl_handler *hand); int libcfs_deregister_ioctl(struct libcfs_ioctl_handler *hand); -int libcfs_ioctl_getdata(struct libcfs_ioctl_hdr *buf, __u32 buf_len, - const void __user *arg); -int libcfs_ioctl_getdata_len(const struct libcfs_ioctl_hdr __user *arg, - __u32 *buf_len); -int libcfs_ioctl_popdata(void *arg, void *buf, int size); +int libcfs_ioctl_getdata(struct libcfs_ioctl_hdr **hdr_pp, + struct libcfs_ioctl_hdr __user *uparam); + +static inline int libcfs_ioctl_popdata(struct libcfs_ioctl_hdr *hdr, + struct libcfs_ioctl_hdr __user *uparam) +{ + if (copy_to_user(uparam, hdr, hdr->ioc_len)) + return -EFAULT; + return 0; +} + +static inline void libcfs_ioctl_freedata(struct libcfs_ioctl_hdr *hdr) +{ + LIBCFS_FREE(hdr, hdr->ioc_len); +} + int libcfs_ioctl_data_adjust(struct libcfs_ioctl_data *data); #endif /* __LIBCFS_IOCTL_H__ */ diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 949fa2f..4c4e6d3 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1838,6 +1838,8 @@ LNetCtl(unsigned int cmd, void *arg) int rc; unsigned long secs_passed; + CLASSERT(sizeof(struct lnet_ioctl_net_config) + + sizeof(struct lnet_ioctl_config_data) < LIBCFS_IOC_DATA_MAX); LASSERT(the_lnet.ln_init); switch (cmd) { diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c index 1c31e2e..50a5464 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c @@ -43,7 +43,7 @@ int libcfs_ioctl_data_adjust(struct libcfs_ioctl_data *data) { if (libcfs_ioctl_is_invalid(data)) { - CERROR("LNET: ioctl not correctly formatted\n"); + CERROR("libcfs ioctl: parameter not correctly formatted\n"); return -EINVAL; } @@ -57,39 +57,46 @@ int libcfs_ioctl_data_adjust(struct libcfs_ioctl_data *data) return 0; } -int libcfs_ioctl_getdata_len(const struct libcfs_ioctl_hdr __user *arg, - __u32 *len) +int libcfs_ioctl_getdata(struct libcfs_ioctl_hdr **hdr_pp, + struct libcfs_ioctl_hdr __user *uhdr) { struct libcfs_ioctl_hdr hdr; + int err = 0; - if (copy_from_user(&hdr, arg, sizeof(hdr))) + if (copy_from_user(&hdr, uhdr, sizeof(hdr))) return -EFAULT; if (hdr.ioc_version != LIBCFS_IOCTL_VERSION && hdr.ioc_version != LIBCFS_IOCTL_VERSION2) { - CERROR("LNET: version mismatch expected %#x, got %#x\n", + CERROR("libcfs ioctl: version mismatch expected %#x, got %#x\n", LIBCFS_IOCTL_VERSION, hdr.ioc_version); return -EINVAL; } - *len = hdr.ioc_len; + if (hdr.ioc_len < sizeof(struct libcfs_ioctl_data)) { + CERROR("libcfs ioctl: user buffer too small for ioctl\n"); + return -EINVAL; + } - return 0; -} + if (hdr.ioc_len > LIBCFS_IOC_DATA_MAX) { + CERROR("libcfs ioctl: user buffer is too large %d/%d\n", + hdr.ioc_len, LIBCFS_IOC_DATA_MAX); + return -EINVAL; + } -int libcfs_ioctl_getdata(struct libcfs_ioctl_hdr *buf, __u32 buf_len, - const void __user *arg) -{ - if (copy_from_user(buf, arg, buf_len)) - return -EFAULT; - return 0; -} + LIBCFS_ALLOC(*hdr_pp, hdr.ioc_len); + if (!*hdr_pp) + return -ENOMEM; + + if (copy_from_user(*hdr_pp, uhdr, hdr.ioc_len)) { + err = -EFAULT; + goto failed; + } -int libcfs_ioctl_popdata(void *arg, void *data, int size) -{ - if (copy_to_user((char *)arg, data, size)) - return -EFAULT; return 0; +failed: + libcfs_ioctl_freedata(*hdr_pp); + return err; } static int diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c index 992ff3c..1be814d 100644 --- a/drivers/staging/lustre/lustre/libcfs/module.c +++ b/drivers/staging/lustre/lustre/libcfs/module.c @@ -54,9 +54,6 @@ # define DEBUG_SUBSYSTEM S_LNET -#define LNET_MAX_IOCTL_BUF_LEN (sizeof(struct lnet_ioctl_net_config) + \ - sizeof(struct lnet_ioctl_config_data)) - #include "../../include/linux/libcfs/libcfs.h" #include @@ -245,52 +242,63 @@ int libcfs_deregister_ioctl(struct libcfs_ioctl_handler *hand) } EXPORT_SYMBOL(libcfs_deregister_ioctl); -static int libcfs_ioctl_handle(struct cfs_psdev_file *pfile, unsigned long cmd, - void *arg, struct libcfs_ioctl_hdr *hdr) +static int libcfs_ioctl(struct cfs_psdev_file *pfile, + unsigned long cmd, void __user *uparam) { struct libcfs_ioctl_data *data = NULL; - int err = -EINVAL; + struct libcfs_ioctl_hdr *hdr; + int err; + + /* 'cmd' and permissions get checked in our arch-specific caller */ + err = libcfs_ioctl_getdata(&hdr, uparam); + if (err != 0) { + CDEBUG_LIMIT(D_ERROR, + "libcfs ioctl: data header error %d\n", err); + return err; + } - /* - * The libcfs_ioctl_data_adjust() function performs adjustment - * operations on the libcfs_ioctl_data structure to make - * it usable by the code. This doesn't need to be called - * for new data structures added. - */ if (hdr->ioc_version == LIBCFS_IOCTL_VERSION) { + /* + * The libcfs_ioctl_data_adjust() function performs adjustment + * operations on the libcfs_ioctl_data structure to make + * it usable by the code. This doesn't need to be called + * for new data structures added. + */ data = container_of(hdr, struct libcfs_ioctl_data, ioc_hdr); err = libcfs_ioctl_data_adjust(data); - if (err != 0) { - return err; - } + if (err != 0) + goto out; } + CDEBUG(D_IOCTL, "libcfs ioctl cmd %lu\n", cmd); switch (cmd) { case IOC_LIBCFS_CLEAR_DEBUG: libcfs_debug_clear_buffer(); - return 0; + break; /* * case IOC_LIBCFS_PANIC: * Handled in arch/cfs_module.c */ case IOC_LIBCFS_MARK_DEBUG: - if (data->ioc_inlbuf1 == NULL || - data->ioc_inlbuf1[data->ioc_inllen1 - 1] != '\0') - return -EINVAL; + if (!data || !data->ioc_inlbuf1 || + data->ioc_inlbuf1[data->ioc_inllen1 - 1] != '\0') { + err = -EINVAL; + goto out; + } libcfs_debug_mark_buffer(data->ioc_inlbuf1); - return 0; + break; + case IOC_LIBCFS_MEMHOG: - if (pfile->private_data == NULL) { + if (!data || !pfile->private_data) { err = -EINVAL; - } else { - kportal_memhog_free(pfile->private_data); - /* XXX The ioc_flags is not GFP flags now, need to be fixed */ - err = kportal_memhog_alloc(pfile->private_data, - data->ioc_count, - data->ioc_flags); - if (err != 0) - kportal_memhog_free(pfile->private_data); + goto out; } + + kportal_memhog_free(pfile->private_data); + err = kportal_memhog_alloc(pfile->private_data, + data->ioc_count, data->ioc_flags); + if (err != 0) + kportal_memhog_free(pfile->private_data); break; default: { @@ -300,55 +308,18 @@ static int libcfs_ioctl_handle(struct cfs_psdev_file *pfile, unsigned long cmd, down_read(&ioctl_list_sem); list_for_each_entry(hand, &ioctl_list, item) { err = hand->handle_ioctl(cmd, hdr); - if (err != -EINVAL) { - if (err == 0) - err = libcfs_ioctl_popdata(arg, - hdr, hdr->ioc_len); - break; - } + if (err == -EINVAL) + continue; + + if (!err) + err = libcfs_ioctl_popdata(hdr, uparam); + break; } up_read(&ioctl_list_sem); - break; + break; } } - } - - return err; -} - -static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *arg) -{ - struct libcfs_ioctl_hdr *hdr; - int err = 0; - __u32 buf_len; - - err = libcfs_ioctl_getdata_len(arg, &buf_len); - if (err != 0) - return err; - - /* - * do a check here to restrict the size of the memory - * to allocate to guard against DoS attacks. - */ - if (buf_len > LNET_MAX_IOCTL_BUF_LEN) { - CERROR("LNET: user buffer exceeds kernel buffer\n"); - return -EINVAL; - } - - LIBCFS_ALLOC_GFP(hdr, buf_len, GFP_KERNEL); - if (!hdr) - return -ENOMEM; - - /* 'cmd' and permissions get checked in our arch-specific caller */ - if (libcfs_ioctl_getdata(hdr, buf_len, arg)) { - CERROR("LNET ioctl: data error\n"); - err = -EINVAL; - goto out; - } - - err = libcfs_ioctl_handle(pfile, cmd, arg, hdr); - out: - LIBCFS_FREE(hdr, buf_len); + libcfs_ioctl_freedata(hdr); return err; } diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c index a055cbb..4e9b0c4 100644 --- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c @@ -74,14 +74,14 @@ #include "../../include/lustre/lustre_build_version.h" /* buffer MUST be at least the size of obd_ioctl_hdr */ -int obd_ioctl_getdata(char **buf, int *len, void *arg) +int obd_ioctl_getdata(char **buf, int *len, void __user *arg) { struct obd_ioctl_hdr hdr; struct obd_ioctl_data *data; int err; int offset = 0; - if (copy_from_user(&hdr, (void *)arg, sizeof(hdr))) + if (copy_from_user(&hdr, arg, sizeof(hdr))) return -EFAULT; if (hdr.ioc_version != OBD_IOCTL_VERSION) { @@ -114,14 +114,10 @@ int obd_ioctl_getdata(char **buf, int *len, void *arg) *len = hdr.ioc_len; data = (struct obd_ioctl_data *)*buf; - if (copy_from_user(*buf, (void *)arg, hdr.ioc_len)) { + if (copy_from_user(*buf, arg, hdr.ioc_len)) { err = -EFAULT; goto free_buf; } - if (hdr.ioc_len != data->ioc_len) { - err = -EINVAL; - goto free_buf; - } if (obd_ioctl_is_invalid(data)) { CERROR("ioctl not correctly formatted\n"); @@ -144,9 +140,8 @@ int obd_ioctl_getdata(char **buf, int *len, void *arg) offset += cfs_size_round(data->ioc_inllen3); } - if (data->ioc_inllen4) { + if (data->ioc_inllen4) data->ioc_inlbuf4 = &data->ioc_bulk[0] + offset; - } return 0; @@ -160,9 +155,7 @@ int obd_ioctl_popdata(void *arg, void *data, int len) { int err; - err = copy_to_user(arg, data, len); - if (err) - err = -EFAULT; + err = copy_to_user(arg, data, len) ? -EFAULT : 0; return err; } EXPORT_SYMBOL(obd_ioctl_popdata); -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:45 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:45 -0500 Subject: [lustre-devel] [PATCH 09/40] staging: lustre: Dynamic LNet Configuration (DLC) In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-10-git-send-email-jsimmons@infradead.org> From: Amir Shehata This is the first patch of a set of patches that enables DLC. This patch adds some cleanup in the config.c as well as some preparatory changes in peer.c to enable dynamic network configuration Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2456 Change-Id: I8c8bbf3b55acf4d76f22a8be587b553a70d31889 Reviewed-on: http://review.whamcloud.com/9830 Reviewed-by: Liang Zhen Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- .../staging/lustre/include/linux/lnet/lib-lnet.h | 2 +- .../staging/lustre/include/linux/lnet/lib-types.h | 5 +- drivers/staging/lustre/lnet/lnet/api-ni.c | 8 +- drivers/staging/lustre/lnet/lnet/config.c | 29 ++++- drivers/staging/lustre/lnet/lnet/peer.c | 134 ++++++++++++++------ 5 files changed, 124 insertions(+), 54 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 09c6bfe..1e0b236 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -685,7 +685,7 @@ int lnet_parse_networks(struct list_head *nilist, char *networks); int lnet_nid2peer_locked(lnet_peer_t **lpp, lnet_nid_t nid, int cpt); lnet_peer_t *lnet_find_peer_locked(struct lnet_peer_table *ptable, lnet_nid_t nid); -void lnet_peer_tables_cleanup(void); +void lnet_peer_tables_cleanup(lnet_ni_t *ni); void lnet_peer_tables_destroy(void); int lnet_peer_tables_create(void); void lnet_debug_peer(lnet_nid_t nid); diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index d792c4a..39381d9 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -343,6 +343,8 @@ typedef struct lnet_peer { struct lnet_peer_table { int pt_version; /* /proc validity stamp */ int pt_number; /* # peers extant */ + /* # zombies to go to deathrow (and not there yet) */ + int pt_zombies; struct list_head pt_deathrow; /* zombie peers */ struct list_head *pt_hash; /* NID->peer hash */ }; @@ -600,9 +602,6 @@ typedef struct { /* registered LNDs */ struct list_head ln_lnds; - /* space for network names */ - char *ln_network_tokens; - int ln_network_tokens_nob; /* test protocol compatibility flags */ int ln_testprotocompat; diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 284150f..f3c9937 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -882,7 +882,7 @@ lnet_shutdown_lndnis(void) /* Clear the peer table and wait for all peers to go (they hold refs on * their NIs) */ - lnet_peer_tables_cleanup(); + lnet_peer_tables_cleanup(NULL); lnet_net_lock(LNET_LOCK_EX); /* Now wait for the NI's I just nuked to show up on ln_zombie_nis @@ -939,12 +939,6 @@ lnet_shutdown_lndnis(void) the_lnet.ln_shutdown = 0; lnet_net_unlock(LNET_LOCK_EX); - - if (the_lnet.ln_network_tokens != NULL) { - LIBCFS_FREE(the_lnet.ln_network_tokens, - the_lnet.ln_network_tokens_nob); - the_lnet.ln_network_tokens = NULL; - } } static int diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c index 867c96e..7bb140b 100644 --- a/drivers/staging/lustre/lnet/lnet/config.c +++ b/drivers/staging/lustre/lnet/lnet/config.c @@ -96,6 +96,8 @@ lnet_net_unique(__u32 net, struct list_head *nilist) void lnet_ni_free(struct lnet_ni *ni) { + int i; + if (ni->ni_refs != NULL) cfs_percpt_free(ni->ni_refs); @@ -105,6 +107,10 @@ lnet_ni_free(struct lnet_ni *ni) if (ni->ni_cpts != NULL) cfs_expr_list_values_free(ni->ni_cpts, ni->ni_ncpts); + for (i = 0; i < LNET_MAX_INTERFACES && ni->ni_interfaces[i]; i++) { + LIBCFS_FREE(ni->ni_interfaces[i], + strlen(ni->ni_interfaces[i]) + 1); + } LIBCFS_FREE(ni, sizeof(*ni)); } @@ -199,8 +205,6 @@ lnet_parse_networks(struct list_head *nilist, char *networks) return -ENOMEM; } - the_lnet.ln_network_tokens = tokens; - the_lnet.ln_network_tokens_nob = tokensize; memcpy(tokens, networks, tokensize); str = tmp = tokens; @@ -319,7 +323,23 @@ lnet_parse_networks(struct list_head *nilist, char *networks) goto failed; } - ni->ni_interfaces[niface++] = iface; + /* + * Allocate a separate piece of memory and copy + * into it the string, so we don't have + * a depencency on the tokens string. This way we + * can free the tokens at the end of the function. + * The newly allocated ni_interfaces[] can be + * freed when freeing the NI + */ + LIBCFS_ALLOC(ni->ni_interfaces[niface], + strlen(iface) + 1); + if (!ni->ni_interfaces[niface]) { + CERROR("Can't allocate net interface name\n"); + goto failed; + } + strncpy(ni->ni_interfaces[niface], iface, + strlen(iface)); + niface++; iface = comma; } while (iface != NULL); @@ -344,6 +364,8 @@ lnet_parse_networks(struct list_head *nilist, char *networks) } LASSERT(!list_empty(nilist)); + + LIBCFS_FREE(tokens, tokensize); return 0; failed_syntax: @@ -360,7 +382,6 @@ lnet_parse_networks(struct list_head *nilist, char *networks) cfs_expr_list_free(el); LIBCFS_FREE(tokens, tokensize); - the_lnet.ln_network_tokens = NULL; return -EINVAL; } diff --git a/drivers/staging/lustre/lnet/lnet/peer.c b/drivers/staging/lustre/lnet/lnet/peer.c index 1fceed3..bb5a0bb 100644 --- a/drivers/staging/lustre/lnet/lnet/peer.c +++ b/drivers/staging/lustre/lnet/lnet/peer.c @@ -103,62 +103,116 @@ lnet_peer_tables_destroy(void) the_lnet.ln_peer_tables = NULL; } +static void +lnet_peer_table_cleanup_locked(lnet_ni_t *ni, struct lnet_peer_table *ptable) +{ + int i; + lnet_peer_t *lp; + lnet_peer_t *tmp; + + for (i = 0; i < LNET_PEER_HASH_SIZE; i++) { + list_for_each_entry_safe(lp, tmp, &ptable->pt_hash[i], + lp_hashlist) { + if (ni && ni != lp->lp_ni) + continue; + list_del_init(&lp->lp_hashlist); + /* Lose hash table's ref */ + ptable->pt_zombies++; + lnet_peer_decref_locked(lp); + } + } +} + +static void +lnet_peer_table_deathrow_wait_locked(struct lnet_peer_table *ptable, + int cpt_locked) +{ + int i; + + for (i = 3; ptable->pt_zombies != 0; i++) { + lnet_net_unlock(cpt_locked); + + if (IS_PO2(i)) { + CDEBUG(D_WARNING, + "Waiting for %d zombies on peer table\n", + ptable->pt_zombies); + } + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(cfs_time_seconds(1) >> 1); + lnet_net_lock(cpt_locked); + } +} + +static void +lnet_peer_table_del_rtrs_locked(lnet_ni_t *ni, struct lnet_peer_table *ptable, + int cpt_locked) +{ + lnet_peer_t *lp; + lnet_peer_t *tmp; + lnet_nid_t lp_nid; + int i; + + for (i = 0; i < LNET_PEER_HASH_SIZE; i++) { + list_for_each_entry_safe(lp, tmp, &ptable->pt_hash[i], + lp_hashlist) { + if (ni != lp->lp_ni) + continue; + + if (lp->lp_rtr_refcount == 0) + continue; + + lp_nid = lp->lp_nid; + + lnet_net_unlock(cpt_locked); + lnet_del_route(LNET_NIDNET(LNET_NID_ANY), lp_nid); + lnet_net_lock(cpt_locked); + } + } +} + void -lnet_peer_tables_cleanup(void) +lnet_peer_tables_cleanup(lnet_ni_t *ni) { struct lnet_peer_table *ptable; + struct list_head deathrow; + lnet_peer_t *lp; int i; - int j; - LASSERT(the_lnet.ln_shutdown); /* i.e. no new peers */ + INIT_LIST_HEAD(&deathrow); + LASSERT(the_lnet.ln_shutdown || ni); + /* + * If just deleting the peers for a NI, get rid of any routes these + * peers are gateways for. + */ cfs_percpt_for_each(ptable, i, the_lnet.ln_peer_tables) { lnet_net_lock(i); - - for (j = 0; j < LNET_PEER_HASH_SIZE; j++) { - struct list_head *peers = &ptable->pt_hash[j]; - - while (!list_empty(peers)) { - lnet_peer_t *lp = list_entry(peers->next, - lnet_peer_t, - lp_hashlist); - list_del_init(&lp->lp_hashlist); - /* lose hash table's ref */ - lnet_peer_decref_locked(lp); - } - } - + lnet_peer_table_del_rtrs_locked(ni, ptable, i); lnet_net_unlock(i); } + /* + * Start the process of moving the applicable peers to + * deathrow. + */ cfs_percpt_for_each(ptable, i, the_lnet.ln_peer_tables) { - LIST_HEAD(deathrow); - lnet_peer_t *lp; - lnet_net_lock(i); + lnet_peer_table_cleanup_locked(ni, ptable); + lnet_net_unlock(i); + } - for (j = 3; ptable->pt_number != 0; j++) { - lnet_net_unlock(i); - - if ((j & (j - 1)) == 0) { - CDEBUG(D_WARNING, - "Waiting for %d peers on peer table\n", - ptable->pt_number); - } - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(cfs_time_seconds(1) / 2); - lnet_net_lock(i); - } + /* Cleanup all entries on deathrow. */ + cfs_percpt_for_each(ptable, i, the_lnet.ln_peer_tables) { + lnet_net_lock(i); + lnet_peer_table_deathrow_wait_locked(ptable, i); list_splice_init(&ptable->pt_deathrow, &deathrow); - lnet_net_unlock(i); + } - while (!list_empty(&deathrow)) { - lp = list_entry(deathrow.next, - lnet_peer_t, lp_hashlist); - list_del(&lp->lp_hashlist); - LIBCFS_FREE(lp, sizeof(*lp)); - } + while (!list_empty(&deathrow)) { + lp = list_entry(deathrow.next, lnet_peer_t, lp_hashlist); + list_del(&lp->lp_hashlist); + LIBCFS_FREE(lp, sizeof(*lp)); } } @@ -181,6 +235,8 @@ lnet_destroy_peer_locked(lnet_peer_t *lp) lp->lp_ni = NULL; list_add(&lp->lp_hashlist, &ptable->pt_deathrow); + LASSERT(ptable->pt_zombies > 0); + ptable->pt_zombies--; } lnet_peer_t * -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:38 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:38 -0500 Subject: [lustre-devel] [PATCH 02/40] staging: lustre: fix 'NULL pointer dereference' errors for LNet In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-3-git-send-email-jsimmons@infradead.org> From: Sebastien Buisson Fix 'NULL pointer dereference' defects found by Coverity version 6.5.3: Dereference after null check (FORWARD_NULL) For instance, Passing null pointer to a function which dereferences it. Dereference before null check (REVERSE_INULL) Null-checking variable suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Dereference null return value (NULL_RETURNS) The following fixes for the LNet layer are broken out of patch http://review.whamcloud.com/4720. Signed-off-by: Sebastien Buisson Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2217 Reviewed-on: http://review.whamcloud.com/4720 Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-move.c | 2 + drivers/staging/lustre/lnet/selftest/conctl.c | 51 ++++++++++---------- 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index de0f85f..0f4154c 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -2829,7 +2829,7 @@ int kiblnd_startup(lnet_ni_t *ni) return 0; failed: - if (net->ibn_dev == NULL && ibdev != NULL) + if (net && net->ibn_dev == NULL && ibdev != NULL) kiblnd_destroy_dev(ibdev); net_failed: diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index 5631f60..7a68382 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -162,6 +162,7 @@ lnet_iov_nob(unsigned int niov, struct kvec *iov) { unsigned int nob = 0; + LASSERT(niov == 0 || iov); while (niov-- > 0) nob += (iov++)->iov_len; @@ -280,6 +281,7 @@ lnet_kiov_nob(unsigned int niov, lnet_kiov_t *kiov) { unsigned int nob = 0; + LASSERT(niov == 0 || kiov); while (niov-- > 0) nob += (kiov++)->kiov_len; diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c index 556c837..2ca7d0e 100644 --- a/drivers/staging/lustre/lnet/selftest/conctl.c +++ b/drivers/staging/lustre/lnet/selftest/conctl.c @@ -679,45 +679,46 @@ static int lst_stat_query_ioctl(lstio_stat_args_t *args) { int rc; - char *name; + char *name = NULL; /* TODO: not finished */ if (args->lstio_sta_key != console_session.ses_key) return -EACCES; - if (args->lstio_sta_resultp == NULL || - (args->lstio_sta_namep == NULL && - args->lstio_sta_idsp == NULL) || - args->lstio_sta_nmlen <= 0 || - args->lstio_sta_nmlen > LST_NAME_SIZE) - return -EINVAL; - - if (args->lstio_sta_idsp != NULL && - args->lstio_sta_count <= 0) + if (!args->lstio_sta_resultp) return -EINVAL; - LIBCFS_ALLOC(name, args->lstio_sta_nmlen + 1); - if (name == NULL) - return -ENOMEM; - - if (copy_from_user(name, args->lstio_sta_namep, - args->lstio_sta_nmlen)) { - LIBCFS_FREE(name, args->lstio_sta_nmlen + 1); - return -EFAULT; - } + if (args->lstio_sta_idsp) { + if (args->lstio_sta_count <= 0) + return -EINVAL; - if (args->lstio_sta_idsp == NULL) { - rc = lstcon_group_stat(name, args->lstio_sta_timeout, - args->lstio_sta_resultp); - } else { rc = lstcon_nodes_stat(args->lstio_sta_count, args->lstio_sta_idsp, args->lstio_sta_timeout, args->lstio_sta_resultp); - } + } else if (args->lstio_sta_namep) { + if (args->lstio_sta_nmlen <= 0 || + args->lstio_sta_nmlen > LST_NAME_SIZE) + return -EINVAL; + + LIBCFS_ALLOC(name, args->lstio_sta_nmlen + 1); + if (!name) + return -ENOMEM; - LIBCFS_FREE(name, args->lstio_sta_nmlen + 1); + rc = copy_from_user(name, args->lstio_sta_namep, + args->lstio_sta_nmlen); + if (!rc) + rc = lstcon_group_stat(name, args->lstio_sta_timeout, + args->lstio_sta_resultp); + else + rc = -EFAULT; + } else { + rc = -EINVAL; + } + + if (name) + LIBCFS_FREE(name, args->lstio_sta_nmlen + 1); return rc; } -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:52 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:52 -0500 Subject: [lustre-devel] [PATCH 16/40] staging: lustre: make local functions static for LNet ni In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-17-git-send-email-jsimmons@infradead.org> From: frank zago This reduces the code size by about 400 bytes. Signed-off-by: frank zago Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396 Reviewed-on: http://review.whamcloud.com/11306 Reviewed-by: James Simmons Reviewed-by: Patrick Farrell Reviewed-by: Amir Shehata Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- .../staging/lustre/include/linux/lnet/lib-lnet.h | 3 --- drivers/staging/lustre/lnet/lnet/api-ni.c | 10 +++++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 63919dd..874af17 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -690,9 +690,6 @@ void lnet_router_checker_stop(void); void lnet_router_ni_update_locked(lnet_peer_t *gw, __u32 net); void lnet_swap_pinginfo(lnet_ping_info_t *info); -int lnet_ping(lnet_process_id_t id, int timeout_ms, - lnet_process_id_t *ids, int n_ids); - int lnet_parse_ip2nets(char **networksp, char *ip2nets); int lnet_parse_routes(char *route_str, int *im_a_router); int lnet_parse_networks(struct list_head *nilist, char *networks); diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 125d018..3b2bfd5 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -62,6 +62,10 @@ static int rnet_htable_size = LNET_REMOTE_NETS_HASH_DEFAULT; module_param(rnet_htable_size, int, 0444); MODULE_PARM_DESC(rnet_htable_size, "size of remote network hash table"); +static void lnet_ping_target_fini(void); +static int lnet_ping(lnet_process_id_t id, int timeout_ms, + lnet_process_id_t *ids, int n_ids); + static char * lnet_get_routes(void) { @@ -520,7 +524,7 @@ lnet_res_lh_initialize(struct lnet_res_container *rec, lnet_libhandle_t *lh) list_add(&lh->lh_hash_chain, &rec->rec_lh_hash[hash]); } -int lnet_unprepare(void); +static int lnet_unprepare(void); static int lnet_prepare(lnet_pid_t requested_pid) @@ -606,7 +610,7 @@ lnet_prepare(lnet_pid_t requested_pid) return rc; } -int +static int lnet_unprepare(void) { /* NB no LNET_LOCK since this is the last reference. All LND instances @@ -2080,7 +2084,7 @@ LNetSnprintHandle(char *str, int len, lnet_handle_any_t h) } EXPORT_SYMBOL(LNetSnprintHandle); -int +static int lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t *ids, int n_ids) { lnet_handle_eq_t eqh; -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:43 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:43 -0500 Subject: [lustre-devel] [PATCH 07/40] staging: lustre: return +ve for blocked lnet message In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-8-git-send-email-jsimmons@infradead.org> From: Liang Zhen returned value of lnet_post_send_locked and lnet_post_routed_recv_locked are changed to -ve by: http://review.whamcloud.com/#/c/9369/ this is wrong because callers rely on +ve to identify blocked message which is not a failure. To respect linux kernel coding style and not use positive error code, this patch adds two macros as non-error returned values of these functions: LNET_CREDIT_OK has credit for message LNET_CREDIT_WAIT no credit and message is blocked both these functions will return these two values instead of 0 and EAGAIN Signed-off-by: Liang Zhen Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5151 Reviewed-on: http://review.whamcloud.com/10625 Reviewed-by: Chris Horn Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/lib-move.c | 51 +++++++++++++++++---------- 1 files changed, 32 insertions(+), 19 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index 03fcddc..021a81d 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -42,6 +42,11 @@ #include "../../include/linux/lnet/lib-lnet.h" +/** lnet message has credit and can be submitted to lnd for send/receive */ +#define LNET_CREDIT_OK 0 +/** lnet message is waiting for credit */ +#define LNET_CREDIT_WAIT 1 + static int local_nid_dist_zero = 1; module_param(local_nid_dist_zero, int, 0444); MODULE_PARM_DESC(local_nid_dist_zero, "Reserved"); @@ -777,10 +782,10 @@ lnet_peer_alive_locked(lnet_peer_t *lp) * lnet_send() is going to lnet_net_unlock immediately after this, so * it sets do_send FALSE and I don't do the unlock/send/lock bit. * - * \retval 0 If \a msg sent or OK to send. - * \retval EAGAIN If \a msg blocked for credit. - * \retval EHOSTUNREACH If the next hop of the message appears dead. - * \retval ECANCELED If the MD of the message has been unlinked. + * \retval LNET_CREDIT_OK If \a msg sent or OK to send. + * \retval LNET_CREDIT_WAIT If \a msg blocked for credit. + * \retval -EHOSTUNREACH If the next hop of the message appears dead. + * \retval -ECANCELED If the MD of the message has been unlinked. */ static int lnet_post_send_locked(lnet_msg_t *msg, int do_send) @@ -808,7 +813,7 @@ lnet_post_send_locked(lnet_msg_t *msg, int do_send) lnet_finalize(ni, msg, -EHOSTUNREACH); lnet_net_lock(cpt); - return EHOSTUNREACH; + return -EHOSTUNREACH; } if (msg->msg_md != NULL && @@ -821,7 +826,7 @@ lnet_post_send_locked(lnet_msg_t *msg, int do_send) lnet_finalize(ni, msg, -ECANCELED); lnet_net_lock(cpt); - return ECANCELED; + return -ECANCELED; } if (!msg->msg_peertxcredit) { @@ -838,7 +843,7 @@ lnet_post_send_locked(lnet_msg_t *msg, int do_send) if (lp->lp_txcredits < 0) { msg->msg_tx_delayed = 1; list_add_tail(&msg->msg_list, &lp->lp_txq); - return EAGAIN; + return LNET_CREDIT_WAIT; } } @@ -855,7 +860,7 @@ lnet_post_send_locked(lnet_msg_t *msg, int do_send) if (tq->tq_credits < 0) { msg->msg_tx_delayed = 1; list_add_tail(&msg->msg_list, &tq->tq_delayed); - return EAGAIN; + return LNET_CREDIT_WAIT; } } @@ -864,7 +869,7 @@ lnet_post_send_locked(lnet_msg_t *msg, int do_send) lnet_ni_send(ni, msg); lnet_net_lock(cpt); } - return 0; + return LNET_CREDIT_OK; } static lnet_rtrbufpool_t * @@ -891,8 +896,10 @@ static int lnet_post_routed_recv_locked(lnet_msg_t *msg, int do_recv) { /* lnet_parse is going to lnet_net_unlock immediately after this, so it - * sets do_recv FALSE and I don't do the unlock/send/lock bit. I - * return EAGAIN if msg blocked and 0 if received or OK to receive */ + * sets do_recv FALSE and I don't do the unlock/send/lock bit. + * I return LNET_CREDIT_WAIT if msg blocked and LNET_CREDIT_OK if + * received or OK to receive + */ lnet_peer_t *lp = msg->msg_rxpeer; lnet_rtrbufpool_t *rbp; lnet_rtrbuf_t *rb; @@ -921,7 +928,7 @@ lnet_post_routed_recv_locked(lnet_msg_t *msg, int do_recv) LASSERT(msg->msg_rx_ready_delay); msg->msg_rx_delayed = 1; list_add_tail(&msg->msg_list, &lp->lp_rtrq); - return EAGAIN; + return LNET_CREDIT_WAIT; } } @@ -941,7 +948,7 @@ lnet_post_routed_recv_locked(lnet_msg_t *msg, int do_recv) LASSERT(msg->msg_rx_ready_delay); msg->msg_rx_delayed = 1; list_add_tail(&msg->msg_list, &rbp->rbp_msgs); - return EAGAIN; + return LNET_CREDIT_WAIT; } } @@ -960,7 +967,7 @@ lnet_post_routed_recv_locked(lnet_msg_t *msg, int do_recv) 0, msg->msg_len, msg->msg_len); lnet_net_lock(cpt); } - return 0; + return LNET_CREDIT_OK; } void @@ -1340,13 +1347,13 @@ lnet_send(lnet_nid_t src_nid, lnet_msg_t *msg, lnet_nid_t rtr_nid) rc = lnet_post_send_locked(msg, 0); lnet_net_unlock(cpt); - if (rc == EHOSTUNREACH || rc == ECANCELED) - return -rc; + if (rc < 0) + return rc; - if (rc == 0) + if (rc == LNET_CREDIT_OK) lnet_ni_send(src_ni, msg); - return 0; /* rc == 0 or EAGAIN */ + return 0; /* rc == LNET_CREDIT_OK or LNET_CREDIT_WAIT */ } static void @@ -1608,6 +1615,11 @@ lnet_parse_ack(lnet_ni_t *ni, lnet_msg_t *msg) return 0; } +/** + * \retval LNET_CREDIT_OK If \a msg is forwarded + * \retval LNET_CREDIT_WAIT If \a msg is blocked because w/o buffer + * \retval -ve error code + */ static int lnet_parse_forward_locked(lnet_ni_t *ni, lnet_msg_t *msg) { @@ -1897,7 +1909,8 @@ lnet_parse(lnet_ni_t *ni, lnet_hdr_t *hdr, lnet_nid_t from_nid, if (rc < 0) goto free_drop; - if (rc == 0) { + + if (rc == LNET_CREDIT_OK) { lnet_ni_recv(ni, msg->msg_private, msg, 0, 0, payload_length, payload_length); } -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:42 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:42 -0500 Subject: [lustre-devel] [PATCH 06/40] staging: lustre: remove uses of IS_ERR_VALUE() In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-7-git-send-email-jsimmons@infradead.org> From: John L. Hammond Remove most uses of IS_ERR_VALUE(). This macro was often given an int argument coming from PTR_ERR(). This invokes implementation defined behavior since the long value gotten by applying PTR_ERR() to a kernel pointer will usually not be representable as an int. Moreover it may be just plain wrong to do this since the expressions IS_ERR(p) and IS_ERR_VALUE((int) PTR_ERR(p)) are not equivalent for a general pointer p. Signed-off-by: John L. Hammond Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3498 Reviewed-on: http://review.whamcloud.com/6759 Reviewed-by: Andreas Dilger Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/acceptor.c | 9 ++++--- drivers/staging/lustre/lnet/lnet/router.c | 7 +++-- drivers/staging/lustre/lustre/libcfs/tracefile.c | 6 +++- drivers/staging/lustre/lustre/llite/statahead.c | 8 ++++-- drivers/staging/lustre/lustre/mdc/mdc_request.c | 18 +++++++++---- drivers/staging/lustre/lustre/mgc/mgc_request.c | 9 ++++--- drivers/staging/lustre/lustre/obdclass/llog.c | 13 ++++++---- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 10 ++++--- drivers/staging/lustre/lustre/ptlrpc/service.c | 29 +++++++++++++--------- 9 files changed, 66 insertions(+), 43 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c b/drivers/staging/lustre/lnet/lnet/acceptor.c index 92ca1dd..d05754d 100644 --- a/drivers/staging/lustre/lnet/lnet/acceptor.c +++ b/drivers/staging/lustre/lnet/lnet/acceptor.c @@ -436,6 +436,7 @@ accept2secure(const char *acc, long *sec) int lnet_acceptor_start(void) { + struct task_struct *task; int rc; long rc2; long secure; @@ -454,10 +455,10 @@ lnet_acceptor_start(void) if (lnet_count_acceptor_nis() == 0) /* not required */ return 0; - rc2 = PTR_ERR(kthread_run(lnet_acceptor, - (void *)(ulong_ptr_t)secure, - "acceptor_%03ld", secure)); - if (IS_ERR_VALUE(rc2)) { + task = kthread_run(lnet_acceptor, (void *)(ulong_ptr_t)secure, + "acceptor_%03ld", secure); + if (IS_ERR(task)) { + rc2 = PTR_ERR(task); CERROR("Can't start acceptor thread: %ld\n", rc2); return -ESRCH; diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index fa61ec9..47f80aa 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -993,6 +993,7 @@ lnet_ping_router_locked(lnet_peer_t *rtr) int lnet_router_checker_start(void) { + struct task_struct *task; int rc; int eqsz; @@ -1021,9 +1022,9 @@ lnet_router_checker_start(void) } the_lnet.ln_rc_state = LNET_RC_STATE_RUNNING; - rc = PTR_ERR(kthread_run(lnet_router_checker, - NULL, "router_checker")); - if (IS_ERR_VALUE(rc)) { + task = kthread_run(lnet_router_checker, NULL, "router_checker"); + if (IS_ERR(task)) { + rc = PTR_ERR(task); CERROR("Can't start router checker thread: %d\n", rc); /* block until event callback signals exit */ down(&the_lnet.ln_rc_signal); diff --git a/drivers/staging/lustre/lustre/libcfs/tracefile.c b/drivers/staging/lustre/lustre/libcfs/tracefile.c index 65c4f1a..bc5d0ee 100644 --- a/drivers/staging/lustre/lustre/libcfs/tracefile.c +++ b/drivers/staging/lustre/lustre/libcfs/tracefile.c @@ -1056,6 +1056,7 @@ end_loop: int cfs_trace_start_thread(void) { struct tracefiled_ctl *tctl = &trace_tctl; + struct task_struct *task; int rc = 0; mutex_lock(&cfs_trace_thread_mutex); @@ -1067,8 +1068,9 @@ int cfs_trace_start_thread(void) init_waitqueue_head(&tctl->tctl_waitq); atomic_set(&tctl->tctl_shutdown, 0); - if (IS_ERR(kthread_run(tracefiled, tctl, "ktracefiled"))) { - rc = -ECHILD; + task = kthread_run(tracefiled, tctl, "ktracefiled"); + if (IS_ERR(task)) { + rc = PTR_ERR(task); goto out; } diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c index 18f5f2b..e17daf8 100644 --- a/drivers/staging/lustre/lustre/llite/statahead.c +++ b/drivers/staging/lustre/lustre/llite/statahead.c @@ -1512,6 +1512,7 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp, struct ll_sa_entry *entry; struct ptlrpc_thread *thread; struct l_wait_info lwi = { 0 }; + struct task_struct *task; int rc = 0; struct ll_inode_info *plli; @@ -1670,10 +1671,11 @@ int do_statahead_enter(struct inode *dir, struct dentry **dentryp, lli->lli_sai = sai; plli = ll_i2info(d_inode(parent)); - rc = PTR_ERR(kthread_run(ll_statahead_thread, parent, - "ll_sa_%u", plli->lli_opendir_pid)); + task = kthread_run(ll_statahead_thread, parent, "ll_sa_%u", + plli->lli_opendir_pid); thread = &sai->sai_thread; - if (IS_ERR_VALUE(rc)) { + if (IS_ERR(task)) { + rc = PTR_ERR(task); CERROR("can't start ll_sa thread, rc: %d\n", rc); dput(parent); lli->lli_opendir_key = NULL; diff --git a/drivers/staging/lustre/lustre/mdc/mdc_request.c b/drivers/staging/lustre/lustre/mdc/mdc_request.c index 294c050..ef25ccd 100644 --- a/drivers/staging/lustre/lustre/mdc/mdc_request.c +++ b/drivers/staging/lustre/lustre/mdc/mdc_request.c @@ -1560,6 +1560,7 @@ static int mdc_ioc_changelog_send(struct obd_device *obd, struct ioc_changelog *icc) { struct changelog_show *cs; + struct task_struct *task; int rc; /* Freed in mdc_changelog_send_thread */ @@ -1577,15 +1578,20 @@ static int mdc_ioc_changelog_send(struct obd_device *obd, * New thread because we should return to user app before * writing into our pipe */ - rc = PTR_ERR(kthread_run(mdc_changelog_send_thread, cs, - "mdc_clg_send_thread")); - if (!IS_ERR_VALUE(rc)) { - CDEBUG(D_CHANGELOG, "start changelog thread\n"); - return 0; + task = kthread_run(mdc_changelog_send_thread, cs, + "mdc_clg_send_thread"); + if (IS_ERR(task)) { + rc = PTR_ERR(task); + CERROR("%s: can't start changelog thread: rc = %d\n", + obd->obd_name, rc); + kfree(cs); + } else { + rc = 0; + CDEBUG(D_CHANGELOG, "%s: started changelog thread\n", + obd->obd_name); } CERROR("Failed to start changelog thread: %d\n", rc); - kfree(cs); return rc; } diff --git a/drivers/staging/lustre/lustre/mgc/mgc_request.c b/drivers/staging/lustre/lustre/mgc/mgc_request.c index 2c48847..1395a1a 100644 --- a/drivers/staging/lustre/lustre/mgc/mgc_request.c +++ b/drivers/staging/lustre/lustre/mgc/mgc_request.c @@ -711,6 +711,7 @@ static int mgc_cleanup(struct obd_device *obd) static int mgc_setup(struct obd_device *obd, struct lustre_cfg *lcfg) { struct lprocfs_static_vars lvars = { NULL }; + struct task_struct *task; int rc; ptlrpcd_addref(); @@ -734,10 +735,10 @@ static int mgc_setup(struct obd_device *obd, struct lustre_cfg *lcfg) init_waitqueue_head(&rq_waitq); /* start requeue thread */ - rc = PTR_ERR(kthread_run(mgc_requeue_thread, NULL, - "ll_cfg_requeue")); - if (IS_ERR_VALUE(rc)) { - CERROR("%s: Cannot start requeue thread (%d),no more log updates!\n", + task = kthread_run(mgc_requeue_thread, NULL, "ll_cfg_requeue"); + if (IS_ERR(task)) { + rc = PTR_ERR(task); + CERROR("%s: cannot start requeue thread: rc = %d; no more log updates\n", obd->obd_name, rc); goto err_cleanup; } diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c index 7cb55ef..741c258 100644 --- a/drivers/staging/lustre/lustre/obdclass/llog.c +++ b/drivers/staging/lustre/lustre/obdclass/llog.c @@ -376,17 +376,19 @@ int llog_process_or_fork(const struct lu_env *env, lpi->lpi_catdata = catdata; if (fork) { + struct task_struct *task; + /* The new thread can't use parent env, * init the new one in llog_process_thread_daemonize. */ lpi->lpi_env = NULL; init_completion(&lpi->lpi_completion); - rc = PTR_ERR(kthread_run(llog_process_thread_daemonize, lpi, - "llog_process_thread")); - if (IS_ERR_VALUE(rc)) { + task = kthread_run(llog_process_thread_daemonize, lpi, + "llog_process_thread"); + if (IS_ERR(task)) { + rc = PTR_ERR(task); CERROR("%s: cannot start thread: rc = %d\n", loghandle->lgh_ctxt->loc_obd->obd_name, rc); - kfree(lpi); - return rc; + goto out_lpi; } wait_for_completion(&lpi->lpi_completion); } else { @@ -394,6 +396,7 @@ int llog_process_or_fork(const struct lu_env *env, llog_process_thread(lpi); } rc = lpi->lpi_rc; +out_lpi: kfree(lpi); return rc; } diff --git a/drivers/staging/lustre/lustre/ptlrpc/pinger.c b/drivers/staging/lustre/lustre/ptlrpc/pinger.c index 5c719f1..a94265a 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/pinger.c +++ b/drivers/staging/lustre/lustre/ptlrpc/pinger.c @@ -293,6 +293,7 @@ static struct ptlrpc_thread pinger_thread; int ptlrpc_start_pinger(void) { struct l_wait_info lwi = { 0 }; + struct task_struct *task; int rc; if (!thread_is_init(&pinger_thread) && @@ -303,10 +304,11 @@ int ptlrpc_start_pinger(void) strcpy(pinger_thread.t_name, "ll_ping"); - rc = PTR_ERR(kthread_run(ptlrpc_pinger_main, &pinger_thread, - "%s", pinger_thread.t_name)); - if (IS_ERR_VALUE(rc)) { - CERROR("cannot start thread: %d\n", rc); + task = kthread_run(ptlrpc_pinger_main, &pinger_thread, + pinger_thread.t_name); + if (IS_ERR(task)) { + rc = PTR_ERR(task); + CERROR("cannot start pinger thread: rc = %d\n", rc); return rc; } l_wait_event(pinger_thread.t_ctl_waitq, diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c b/drivers/staging/lustre/lustre/ptlrpc/service.c index f45898f..5d02055 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/service.c +++ b/drivers/staging/lustre/lustre/ptlrpc/service.c @@ -2255,24 +2255,27 @@ static int ptlrpc_start_hr_threads(void) for (j = 0; j < hrp->hrp_nthrs; j++) { struct ptlrpc_hr_thread *hrt = &hrp->hrp_thrs[j]; + struct task_struct *task; - rc = PTR_ERR(kthread_run(ptlrpc_hr_main, + task = kthread_run(ptlrpc_hr_main, &hrp->hrp_thrs[j], "ptlrpc_hr%02d_%03d", hrp->hrp_cpt, - hrt->hrt_id)); - if (IS_ERR_VALUE(rc)) + hrt->hrt_id); + if (IS_ERR(task)) { + rc = PTR_ERR(task); break; + } } wait_event(ptlrpc_hr.hr_waitq, atomic_read(&hrp->hrp_nstarted) == j); - if (!IS_ERR_VALUE(rc)) - continue; - CERROR("Reply handling thread %d:%d Failed on starting: rc = %d\n", - i, j, rc); - ptlrpc_stop_hr_threads(); - return rc; + if (rc < 0) { + CERROR("cannot start reply handler thread %d:%d: rc = %d\n", + i, j, rc); + ptlrpc_stop_hr_threads(); + return rc; + } } return 0; } @@ -2374,6 +2377,7 @@ int ptlrpc_start_thread(struct ptlrpc_service_part *svcpt, int wait) struct l_wait_info lwi = { 0 }; struct ptlrpc_thread *thread; struct ptlrpc_service *svc; + struct task_struct *task; int rc; LASSERT(svcpt != NULL); @@ -2442,9 +2446,10 @@ int ptlrpc_start_thread(struct ptlrpc_service_part *svcpt, int wait) } CDEBUG(D_RPCTRACE, "starting thread '%s'\n", thread->t_name); - rc = PTR_ERR(kthread_run(ptlrpc_main, thread, "%s", thread->t_name)); - if (IS_ERR_VALUE(rc)) { - CERROR("cannot start thread '%s': rc %d\n", + task = kthread_run(ptlrpc_main, thread, "%s", thread->t_name); + if (IS_ERR(task)) { + rc = PTR_ERR(task); + CERROR("cannot start thread '%s': rc = %d\n", thread->t_name, rc); spin_lock(&svcpt->scp_lock); --svcpt->scp_nthrs_starting; -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:03 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:03 -0500 Subject: [lustre-devel] [PATCH 27/40] staging: lustre: reject invalid net configuration for lnet In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-28-git-send-email-jsimmons@infradead.org> From: Amir Shehata Currently if there exists a route that goes over a remote net and then this net is added dynamically as a local net, then traffic stops because the code in lnet_send() determines that the destination nid can be reached from another local_ni, but the src_nid is still stuck on the earlier NI, because the src_nid is stored in the ptlrpc layer and is not updated when a local NI is configured. Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5874 Reviewed-on: http://review.whamcloud.com/12912 Reviewed-by: Isaac Huang Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/api-ni.c | 18 +++++++++++++++++- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 7d6e59f..9b00bc1 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1747,6 +1747,7 @@ lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets, lnet_handle_md_t md_handle; struct lnet_ni *ni; struct list_head net_head; + lnet_remotenet_t *rnet; int rc; INIT_LIST_HEAD(&net_head); @@ -1763,12 +1764,27 @@ lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets, goto failed0; } + ni = list_entry(net_head.next, struct lnet_ni, ni_list); + + lnet_net_lock(LNET_LOCK_EX); + rnet = lnet_find_net_locked(LNET_NIDNET(ni->ni_nid)); + lnet_net_unlock(LNET_LOCK_EX); + /* + * make sure that the net added doesn't invalidate the current + * configuration LNet is keeping + */ + if (rnet) { + CERROR("Adding net %s will invalidate routing configuration\n", + nets); + rc = -EUSERS; + goto failed0; + } + rc = lnet_ping_info_setup(&pinfo, &md_handle, 1 + lnet_get_ni_count(), false); if (rc != 0) goto failed0; - ni = list_entry(net_head.next, struct lnet_ni, ni_list); list_del_init(&ni->ni_list); rc = lnet_startup_lndni(ni, peer_timeout, peer_cr, -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:09 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:09 -0500 Subject: [lustre-devel] [PATCH 33/40] staging: lustre: remove messages from lazy portal on NI shutdown In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-34-git-send-email-jsimmons@infradead.org> From: Amir Shehata When shutting down an NI in a busy system, some messages received on this NI, might be on the lazy portal. They would have grabbed a ref count on the NI. Therefore NI will not be removed until messages are processed. In order to avoid this scenario, when an NI is shutdown go through all messages queued on the lazy portal and drop messages for the NI being shutdown Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6040 Reviewed-on: http://review.whamcloud.com/13836 Reviewed-by: Isaac Huang Reviewed-by: Liang Zhen Reviewed-by: Oleg Drokin --- .../staging/lustre/include/linux/lnet/lib-lnet.h | 1 + drivers/staging/lustre/lnet/lnet/api-ni.c | 6 ++ drivers/staging/lustre/lnet/lnet/lib-ptl.c | 54 +++++++++++++------- 3 files changed, 43 insertions(+), 18 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 00ef4d0..6dce2c9 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -480,6 +480,7 @@ int lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets, __s32 peer_timeout, __s32 peer_cr, __s32 peer_buf_cr, __s32 credits); int lnet_dyn_del_ni(__u32 net); +int lnet_clear_lazy_portal(struct lnet_ni *ni, int portal, char *reason); int lnet_islocalnid(lnet_nid_t nid); int lnet_islocalnet(__u32 net); diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index e78b079..34f8c1b 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1190,10 +1190,16 @@ lnet_shutdown_lndnis(void) static void lnet_shutdown_lndni(struct lnet_ni *ni) { + int i; + lnet_net_lock(LNET_LOCK_EX); lnet_ni_unlink_locked(ni); lnet_net_unlock(LNET_LOCK_EX); + /* clear messages for this NI on the lazy portal */ + for (i = 0; i < the_lnet.ln_nportals; i++) + lnet_clear_lazy_portal(ni, i, "Shutting down NI"); + /* Do peer table cleanup for this ni */ lnet_peer_tables_cleanup(ni); diff --git a/drivers/staging/lustre/lnet/lnet/lib-ptl.c b/drivers/staging/lustre/lnet/lnet/lib-ptl.c index b4f573a..93bc3dc 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-ptl.c +++ b/drivers/staging/lustre/lnet/lnet/lib-ptl.c @@ -886,17 +886,8 @@ LNetSetLazyPortal(int portal) } EXPORT_SYMBOL(LNetSetLazyPortal); -/** - * Turn off the lazy portal attribute. Delayed requests on the portal, - * if any, will be all dropped when this function returns. - * - * \param portal Index of the portal to disable the lazy attribute on. - * - * \retval 0 On success. - * \retval -EINVAL If \a portal is not a valid index. - */ int -LNetClearLazyPortal(int portal) +lnet_clear_lazy_portal(struct lnet_ni *ni, int portal, char *reason) { struct lnet_portal *ptl; LIST_HEAD(zombies); @@ -915,21 +906,48 @@ LNetClearLazyPortal(int portal) return 0; } - if (the_lnet.ln_shutdown) - CWARN("Active lazy portal %d on exit\n", portal); - else - CDEBUG(D_NET, "clearing portal %d lazy\n", portal); + if (ni) { + struct lnet_msg *msg, *tmp; - /* grab all the blocked messages atomically */ - list_splice_init(&ptl->ptl_msg_delayed, &zombies); + /* grab all messages which are on the NI passed in */ + list_for_each_entry_safe(msg, tmp, &ptl->ptl_msg_delayed, + msg_list) { + if (msg->msg_rxpeer->lp_ni == ni) + list_move(&msg->msg_list, &zombies); + } + } else { + if (the_lnet.ln_shutdown) + CWARN("Active lazy portal %d on exit\n", portal); + else + CDEBUG(D_NET, "clearing portal %d lazy\n", portal); + + /* grab all the blocked messages atomically */ + list_splice_init(&ptl->ptl_msg_delayed, &zombies); - lnet_ptl_unsetopt(ptl, LNET_PTL_LAZY); + lnet_ptl_unsetopt(ptl, LNET_PTL_LAZY); + } lnet_ptl_unlock(ptl); lnet_res_unlock(LNET_LOCK_EX); - lnet_drop_delayed_msg_list(&zombies, "Clearing lazy portal attr"); + lnet_drop_delayed_msg_list(&zombies, reason); return 0; } + +/** + * Turn off the lazy portal attribute. Delayed requests on the portal, + * if any, will be all dropped when this function returns. + * + * \param portal Index of the portal to disable the lazy attribute on. + * + * \retval 0 On success. + * \retval -EINVAL If \a portal is not a valid index. + */ +int +LNetClearLazyPortal(int portal) +{ + return lnet_clear_lazy_portal(NULL, portal, + "Clearing lazy portal attr"); +} EXPORT_SYMBOL(LNetClearLazyPortal); -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:10 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:10 -0500 Subject: [lustre-devel] [PATCH 34/40] staging: lustre: remove unnecessary EXPORT_SYMBOL from lnet layer In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-35-git-send-email-jsimmons@infradead.org> From: frank zago A lot of symbols don't need to be exported at all because they are only used in the module they belong to. Signed-off-by: frank zago Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5829 Reviewed-on: http://review.whamcloud.com/13320 Reviewed-by: James Simmons Reviewed-by: Isaac Huang Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/api-ni.c | 1 - drivers/staging/lustre/lnet/lnet/lib-move.c | 1 - drivers/staging/lustre/lnet/lnet/lib-socket.c | 3 --- drivers/staging/lustre/lnet/selftest/conctl.c | 2 -- 4 files changed, 0 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 34f8c1b..7f5e0e8 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -358,7 +358,6 @@ lnet_counters_reset(void) lnet_net_unlock(LNET_LOCK_EX); } -EXPORT_SYMBOL(lnet_counters_reset); static char * lnet_res_type2str(int type) diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index c2cc8c8..430cb9a 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -1715,7 +1715,6 @@ lnet_msgtyp2str(int type) return ""; } } -EXPORT_SYMBOL(lnet_msgtyp2str); void lnet_print_hdr(lnet_hdr_t *hdr) diff --git a/drivers/staging/lustre/lnet/lnet/lib-socket.c b/drivers/staging/lustre/lnet/lnet/lib-socket.c index 6f7ef4c..ccb425d 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-socket.c +++ b/drivers/staging/lustre/lnet/lnet/lib-socket.c @@ -513,7 +513,6 @@ lnet_sock_listen(struct socket **sockp, __u32 local_ip, int local_port, sock_release(*sockp); return rc; } -EXPORT_SYMBOL(lnet_sock_listen); int lnet_sock_accept(struct socket **newsockp, struct socket *sock) @@ -555,7 +554,6 @@ failed: sock_release(newsock); return rc; } -EXPORT_SYMBOL(lnet_sock_accept); int lnet_sock_connect(struct socket **sockp, int *fatal, __u32 local_ip, @@ -591,4 +589,3 @@ lnet_sock_connect(struct socket **sockp, int *fatal, __u32 local_ip, sock_release(*sockp); return rc; } -EXPORT_SYMBOL(lnet_sock_connect); diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c index 3dc8ea7..73e71cd 100644 --- a/drivers/staging/lustre/lnet/selftest/conctl.c +++ b/drivers/staging/lustre/lnet/selftest/conctl.c @@ -931,5 +931,3 @@ out: return rc; } - -EXPORT_SYMBOL(lstcon_ioctl_entry); -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:39 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:39 -0500 Subject: [lustre-devel] [PATCH 03/40] staging: lustre: reflect down routes in /proc/sys/lnet/routes In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-4-git-send-email-jsimmons@infradead.org> From: Chris Horn We consider routes "down" if the router is down or the router NI for the target network is down. This should be reflected in the output of /proc/sys/lnet/routes Signed-off-by: Chris Horn Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3679 Reviewed-on: http://review.whamcloud.com/7857 Reviewed-by: Cory Spitz Reviewed-by: Isaac Huang Reviewed-by: Oleg Drokin --- .../staging/lustre/include/linux/lnet/lib-lnet.h | 13 ++++++++ drivers/staging/lustre/lnet/lnet/lib-move.c | 32 ++++++++++---------- drivers/staging/lustre/lnet/lnet/router_proc.c | 2 +- 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index b61d504..09c6bfe 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -64,6 +64,19 @@ extern lnet_t the_lnet; /* THE network */ /** exclusive lock */ #define LNET_LOCK_EX CFS_PERCPT_LOCK_EX +static inline int lnet_is_route_alive(lnet_route_t *route) +{ + /* gateway is down */ + if (!route->lr_gateway->lp_alive) + return 0; + /* no NI status, assume it's alive */ + if ((route->lr_gateway->lp_ping_feats & + LNET_PING_FEAT_NI_STATUS) == 0) + return 1; + /* has NI status, check # down NIs */ + return route->lr_downis == 0; +} + static inline int lnet_is_wire_handle_none(lnet_handle_wire_t *wh) { return (wh->wh_interface_cookie == LNET_WIRE_HANDLE_COOKIE_NONE && diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index 7a68382..c56de44 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -1122,9 +1122,9 @@ static lnet_peer_t * lnet_find_route_locked(lnet_ni_t *ni, lnet_nid_t target, lnet_nid_t rtr_nid) { lnet_remotenet_t *rnet; - lnet_route_t *rtr; - lnet_route_t *rtr_best; - lnet_route_t *rtr_last; + lnet_route_t *route; + lnet_route_t *best_route; + lnet_route_t *last_route; struct lnet_peer *lp_best; struct lnet_peer *lp; int rc; @@ -1137,13 +1137,12 @@ lnet_find_route_locked(lnet_ni_t *ni, lnet_nid_t target, lnet_nid_t rtr_nid) return NULL; lp_best = NULL; - rtr_best = rtr_last = NULL; - list_for_each_entry(rtr, &rnet->lrn_routes, lr_list) { - lp = rtr->lr_gateway; + best_route = NULL; + last_route = NULL; + list_for_each_entry(route, &rnet->lrn_routes, lr_list) { + lp = route->lr_gateway; - if (!lp->lp_alive || /* gateway is down */ - ((lp->lp_ping_feats & LNET_PING_FEAT_NI_STATUS) != 0 && - rtr->lr_downis != 0)) /* NI to target is down */ + if (!lnet_is_route_alive(route)) continue; if (ni != NULL && lp->lp_ni != ni) @@ -1153,28 +1152,29 @@ lnet_find_route_locked(lnet_ni_t *ni, lnet_nid_t target, lnet_nid_t rtr_nid) return lp; if (lp_best == NULL) { - rtr_best = rtr_last = rtr; + best_route = route; + last_route = route; lp_best = lp; continue; } /* no protection on below fields, but it's harmless */ - if (rtr_last->lr_seq - rtr->lr_seq < 0) - rtr_last = rtr; + if (last_route->lr_seq - route->lr_seq < 0) + last_route = route; - rc = lnet_compare_routes(rtr, rtr_best); + rc = lnet_compare_routes(route, best_route); if (rc < 0) continue; - rtr_best = rtr; + best_route = route; lp_best = lp; } /* set sequence number on the best router to the latest sequence + 1 * so we can round-robin all routers, it's race and inaccurate but * harmless and functional */ - if (rtr_best != NULL) - rtr_best->lr_seq = rtr_last->lr_seq + 1; + if (best_route) + best_route->lr_seq = last_route->lr_seq + 1; return lp_best; } diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c b/drivers/staging/lustre/lnet/lnet/router_proc.c index 396c7c4..af7423f 100644 --- a/drivers/staging/lustre/lnet/lnet/router_proc.c +++ b/drivers/staging/lustre/lnet/lnet/router_proc.c @@ -240,7 +240,7 @@ static int proc_lnet_routes(struct ctl_table *table, int write, unsigned int hops = route->lr_hops; unsigned int priority = route->lr_priority; lnet_nid_t nid = route->lr_gateway->lp_nid; - int alive = route->lr_gateway->lp_alive; + int alive = lnet_is_route_alive(route); s += snprintf(s, tmpstr + tmpsiz - s, "%-8s %4u %8u %7s %s\n", -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:44 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:44 -0500 Subject: [lustre-devel] [PATCH 08/40] staging: lustre: do not memset after LIBCFS_ALLOC In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-9-git-send-email-jsimmons@infradead.org> From: Frank Zago LIBCFS_ALLOC already zero out the memory allocated, so there is no need to zero out the memory again. Signed-off-by: Frank Zago Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5304 Reviewed-on: http://review.whamcloud.com/11012 Reviewed-by: Patrick Farrell Reviewed-by: James Simmons Reviewed-by: Andreas Dilger Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- .../staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c index 0f4154c..f3cbc3b 100644 --- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c +++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd.c @@ -335,8 +335,6 @@ int kiblnd_create_peer(lnet_ni_t *ni, kib_peer_t **peerp, lnet_nid_t nid) return -ENOMEM; } - memset(peer, 0, sizeof(*peer)); /* zero flags etc */ - peer->ibp_ni = ni; peer->ibp_nid = nid; peer->ibp_error = 0; -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:07 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:07 -0500 Subject: [lustre-devel] [PATCH 31/40] staging: lustre: assume a kernel build In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-32-git-send-email-jsimmons@infradead.org> From: John L. Hammond In lnet/lnet/ and lnet/selftest/ assume a kernel build (assume that __KERNEL__ is defined). Remove some common code only needed for user space LNet. Only part of the work of this patch got merged. This is the final bits. Signed-off-by: John L. Hammond Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675 Reviewed-on: http://review.whamcloud.com/13121 Reviewed-by: James Simmons Reviewed-by: Amir Shehata Reviewed-by: Oleg Drokin --- .../staging/lustre/include/linux/lnet/lib-types.h | 4 -- drivers/staging/lustre/lnet/lnet/acceptor.c | 2 - drivers/staging/lustre/lnet/lnet/api-ni.c | 38 ++------------------ drivers/staging/lustre/lnet/lnet/lib-eq.c | 3 -- drivers/staging/lustre/lnet/lnet/lib-md.c | 3 -- drivers/staging/lustre/lnet/lnet/lib-me.c | 3 -- drivers/staging/lustre/lnet/lnet/lib-move.c | 5 --- drivers/staging/lustre/lnet/lnet/lib-msg.c | 20 +---------- drivers/staging/lustre/lnet/lnet/router.c | 9 ++--- 9 files changed, 7 insertions(+), 80 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index 574de55..dbfb069 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -561,8 +561,6 @@ typedef struct { /* dying LND instances */ struct list_head ln_nis_zombie; lnet_ni_t *ln_loni; /* the loopback NI */ - /* NI to wait for events in */ - lnet_ni_t *ln_eq_waitni; /* remote networks with routes to them */ struct list_head *ln_remote_nets_hash; @@ -592,8 +590,6 @@ typedef struct { struct mutex ln_api_mutex; struct mutex ln_lnd_mutex; - int ln_init; /* lnet_init() - called? */ /* Have I called LNetNIInit myself? */ int ln_niinit_self; /* LNetNIInit/LNetNIFini counter */ diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c b/drivers/staging/lustre/lnet/lnet/acceptor.c index 112b166..ffa2b19 100644 --- a/drivers/staging/lustre/lnet/lnet/acceptor.c +++ b/drivers/staging/lustre/lnet/lnet/acceptor.c @@ -204,8 +204,6 @@ lnet_connect(struct socket **sockp, lnet_nid_t peer_nid, } EXPORT_SYMBOL(lnet_connect); -/* Below is the code common for both kernel and MT user-space */ - static int lnet_accept(struct socket *sock, __u32 magic) { diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 09656a1..e78b079 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -290,7 +290,6 @@ lnet_register_lnd(lnd_t *lnd) { mutex_lock(&the_lnet.ln_lnd_mutex); - LASSERT(the_lnet.ln_init); LASSERT(libcfs_isknown_lnd(lnd->lnd_type)); LASSERT(lnet_find_lnd_by_type(lnd->lnd_type) == NULL); @@ -308,7 +307,6 @@ lnet_unregister_lnd(lnd_t *lnd) { mutex_lock(&the_lnet.ln_lnd_mutex); - LASSERT(the_lnet.ln_init); LASSERT(lnet_find_lnd_by_type(lnd->lnd_type) == lnd); LASSERT(lnd->lnd_refcount == 0); @@ -1164,12 +1162,6 @@ lnet_shutdown_lndnis(void) lnet_ni_unlink_locked(ni); } - /* Drop the cached eqwait NI. */ - if (the_lnet.ln_eq_waitni != NULL) { - lnet_ni_decref_locked(the_lnet.ln_eq_waitni, 0); - the_lnet.ln_eq_waitni = NULL; - } - /* Drop the cached loopback NI. */ if (the_lnet.ln_loni != NULL) { lnet_ni_decref_locked(the_lnet.ln_loni, 0); @@ -1358,7 +1350,6 @@ lnet_startup_lndnis(struct list_head *nilist) { struct lnet_ni *ni; int rc; - int lnd_type; int ni_count = 0; while (!list_empty(nilist)) { @@ -1372,14 +1363,6 @@ lnet_startup_lndnis(struct list_head *nilist) ni_count++; } - if (the_lnet.ln_eq_waitni && ni_count > 1) { - lnd_type = the_lnet.ln_eq_waitni->ni_lnd->lnd_type; - LCONSOLE_ERROR_MSG(0x109, "LND %s can only run single-network\n", - libcfs_lnd2str(lnd_type)); - rc = -EINVAL; - goto failed; - } - return ni_count; failed: lnet_shutdown_lndnis(); @@ -1390,10 +1373,9 @@ failed: /** * Initialize LNet library. * - * Only userspace program needs to call this function - it's automatically - * called in the kernel at module loading time. Caller has to call lnet_fini() - * after a call to lnet_init(), if and only if the latter returned 0. It must - * be called exactly once. + * Automatically called at module loading time. Caller has to call + * lnet_exit() after a call to lnet_init(), if and only if the + * latter returned 0. It must be called exactly once. * * \return 0 on success, and -ve on failures. */ @@ -1403,7 +1385,6 @@ lnet_init(void) int rc; lnet_assert_wire_constants(); - LASSERT(!the_lnet.ln_init); memset(&the_lnet, 0, sizeof(the_lnet)); @@ -1429,7 +1410,6 @@ lnet_init(void) } the_lnet.ln_refcount = 0; - the_lnet.ln_init = 1; LNetInvalidateHandle(&the_lnet.ln_rc_eqh); INIT_LIST_HEAD(&the_lnet.ln_lnds); INIT_LIST_HEAD(&the_lnet.ln_rcd_zombie); @@ -1456,31 +1436,24 @@ EXPORT_SYMBOL(lnet_init); /** * Finalize LNet library. * - * Only userspace program needs to call this function. It can be called - * at most once. - * * \pre lnet_init() called with success. * \pre All LNet users called LNetNIFini() for matching LNetNIInit() calls. */ void lnet_fini(void) { - LASSERT(the_lnet.ln_init); LASSERT(the_lnet.ln_refcount == 0); while (!list_empty(&the_lnet.ln_lnds)) lnet_unregister_lnd(list_entry(the_lnet.ln_lnds.next, lnd_t, lnd_list)); lnet_destroy_locks(); - - the_lnet.ln_init = 0; } EXPORT_SYMBOL(lnet_fini); /** * Set LNet PID and start LNet interfaces, routing, and forwarding. * - * Userspace program should call this after a successful call to lnet_init(). * Users must call this function at least once before any other functions. * For each successful call there must be a corresponding call to * LNetNIFini(). For subsequent calls to LNetNIInit(), \a requested_pid is @@ -1507,7 +1480,6 @@ LNetNIInit(lnet_pid_t requested_pid) mutex_lock(&the_lnet.ln_api_mutex); - LASSERT(the_lnet.ln_init); CDEBUG(D_OTHER, "refs %d\n", the_lnet.ln_refcount); if (the_lnet.ln_refcount > 0) { @@ -1624,7 +1596,6 @@ LNetNIFini(void) { mutex_lock(&the_lnet.ln_api_mutex); - LASSERT(the_lnet.ln_init); LASSERT(the_lnet.ln_refcount > 0); if (the_lnet.ln_refcount != 1) { @@ -1888,7 +1859,6 @@ LNetCtl(unsigned int cmd, void *arg) CLASSERT(sizeof(struct lnet_ioctl_net_config) + sizeof(struct lnet_ioctl_config_data) < LIBCFS_IOC_DATA_MAX); - LASSERT(the_lnet.ln_init); switch (cmd) { case IOC_LIBCFS_GET_NI: @@ -2140,8 +2110,6 @@ LNetGetId(unsigned int index, lnet_process_id_t *id) int cpt; int rc = -ENOENT; - LASSERT(the_lnet.ln_init); - /* LNetNI initilization failed? */ if (the_lnet.ln_refcount == 0) return rc; diff --git a/drivers/staging/lustre/lnet/lnet/lib-eq.c b/drivers/staging/lustre/lnet/lnet/lib-eq.c index 60889eb..5deefaf 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-eq.c +++ b/drivers/staging/lustre/lnet/lnet/lib-eq.c @@ -72,7 +72,6 @@ LNetEQAlloc(unsigned int count, lnet_eq_handler_t callback, { lnet_eq_t *eq; - LASSERT(the_lnet.ln_init); LASSERT(the_lnet.ln_refcount > 0); /* We need count to be a power of 2 so that when eq_{enq,deq}_seq @@ -159,7 +158,6 @@ LNetEQFree(lnet_handle_eq_t eqh) int size = 0; int i; - LASSERT(the_lnet.ln_init); LASSERT(the_lnet.ln_refcount > 0); lnet_res_lock(LNET_LOCK_EX); @@ -390,7 +388,6 @@ LNetEQPoll(lnet_handle_eq_t *eventqs, int neq, int timeout_ms, int rc; int i; - LASSERT(the_lnet.ln_init); LASSERT(the_lnet.ln_refcount > 0); if (neq < 1) diff --git a/drivers/staging/lustre/lnet/lnet/lib-md.c b/drivers/staging/lustre/lnet/lnet/lib-md.c index 758f5be..dc35f2d 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-md.c +++ b/drivers/staging/lustre/lnet/lnet/lib-md.c @@ -273,7 +273,6 @@ LNetMDAttach(lnet_handle_me_t meh, lnet_md_t umd, int cpt; int rc; - LASSERT(the_lnet.ln_init); LASSERT(the_lnet.ln_refcount > 0); if (lnet_md_validate(&umd) != 0) @@ -350,7 +349,6 @@ LNetMDBind(lnet_md_t umd, lnet_unlink_t unlink, lnet_handle_md_t *handle) int cpt; int rc; - LASSERT(the_lnet.ln_init); LASSERT(the_lnet.ln_refcount > 0); if (lnet_md_validate(&umd) != 0) @@ -425,7 +423,6 @@ LNetMDUnlink(lnet_handle_md_t mdh) lnet_libmd_t *md; int cpt; - LASSERT(the_lnet.ln_init); LASSERT(the_lnet.ln_refcount > 0); cpt = lnet_cpt_of_cookie(mdh.cookie); diff --git a/drivers/staging/lustre/lnet/lnet/lib-me.c b/drivers/staging/lustre/lnet/lnet/lib-me.c index 42fc99e..69a9314 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-me.c +++ b/drivers/staging/lustre/lnet/lnet/lib-me.c @@ -83,7 +83,6 @@ LNetMEAttach(unsigned int portal, struct lnet_me *me; struct list_head *head; - LASSERT(the_lnet.ln_init); LASSERT(the_lnet.ln_refcount > 0); if ((int)portal >= the_lnet.ln_nportals) @@ -156,7 +155,6 @@ LNetMEInsert(lnet_handle_me_t current_meh, struct lnet_portal *ptl; int cpt; - LASSERT(the_lnet.ln_init); LASSERT(the_lnet.ln_refcount > 0); if (pos == LNET_INS_LOCAL) @@ -233,7 +231,6 @@ LNetMEUnlink(lnet_handle_me_t meh) lnet_event_t ev; int cpt; - LASSERT(the_lnet.ln_init); LASSERT(the_lnet.ln_refcount > 0); cpt = lnet_cpt_of_cookie(meh.cookie); diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index b9388ed..c2cc8c8 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -59,8 +59,6 @@ lnet_fail_nid(lnet_nid_t nid, unsigned int threshold) struct list_head *next; struct list_head cull; - LASSERT(the_lnet.ln_init); - /* NB: use lnet_net_lock(0) to serialize operations on test peers */ if (threshold != 0) { /* Adding a new entry */ @@ -2137,7 +2135,6 @@ LNetPut(lnet_nid_t self, lnet_handle_md_t mdh, lnet_ack_req_t ack, int cpt; int rc; - LASSERT(the_lnet.ln_init); LASSERT(the_lnet.ln_refcount > 0); if (!list_empty(&the_lnet.ln_test_peers) && /* normally we don't */ @@ -2337,7 +2334,6 @@ LNetGet(lnet_nid_t self, lnet_handle_md_t mdh, int cpt; int rc; - LASSERT(the_lnet.ln_init); LASSERT(the_lnet.ln_refcount > 0); if (!list_empty(&the_lnet.ln_test_peers) && /* normally we don't */ @@ -2436,7 +2432,6 @@ LNetDist(lnet_nid_t dstnid, lnet_nid_t *srcnidp, __u32 *orderp) * keep order 0 free for 0 at lo and order 1 free for a local NID * match */ - LASSERT(the_lnet.ln_init); LASSERT(the_lnet.ln_refcount > 0); cpt = lnet_net_lock_current(); diff --git a/drivers/staging/lustre/lnet/lnet/lib-msg.c b/drivers/staging/lustre/lnet/lnet/lib-msg.c index 43977e8..5751dc4 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-msg.c +++ b/drivers/staging/lustre/lnet/lnet/lib-msg.c @@ -559,35 +559,17 @@ lnet_msg_container_cleanup(struct lnet_msg_container *container) sizeof(*container->msc_finalizers)); container->msc_finalizers = NULL; } -#ifdef LNET_USE_LIB_FREELIST - lnet_freelist_fini(&container->msc_freelist); -#endif container->msc_init = 0; } int lnet_msg_container_setup(struct lnet_msg_container *container, int cpt) { - int rc; - container->msc_init = 1; INIT_LIST_HEAD(&container->msc_active); INIT_LIST_HEAD(&container->msc_finalizing); -#ifdef LNET_USE_LIB_FREELIST - memset(&container->msc_freelist, 0, sizeof(lnet_freelist_t)); - - rc = lnet_freelist_init(&container->msc_freelist, - LNET_FL_MAX_MSGS, sizeof(lnet_msg_t)); - if (rc != 0) { - CERROR("Failed to init freelist for message container\n"); - lnet_msg_container_cleanup(container); - return rc; - } -#else - rc = 0; -#endif /* number of CPUs */ container->msc_nfinalizers = cfs_cpt_weight(lnet_cpt_table(), cpt); @@ -601,7 +583,7 @@ lnet_msg_container_setup(struct lnet_msg_container *container, int cpt) return -ENOMEM; } - return rc; + return 0; } void diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index b4ac670..91f3f09 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -1046,7 +1046,7 @@ lnet_router_checker_start(void) { struct task_struct *task; int rc; - int eqsz; + int eqsz = 0; LASSERT(the_lnet.ln_rc_state == LNET_RC_STATE_SHUTDOWN); @@ -1057,11 +1057,8 @@ lnet_router_checker_start(void) } sema_init(&the_lnet.ln_rc_signal, 0); - /* EQ size doesn't matter; the callback is guaranteed to get every - * event */ - eqsz = 0; - rc = LNetEQAlloc(eqsz, lnet_router_checker_event, - &the_lnet.ln_rc_eqh); + + rc = LNetEQAlloc(0, lnet_router_checker_event, &the_lnet.ln_rc_eqh); if (rc != 0) { CERROR("Can't allocate EQ(%d): %d\n", eqsz, rc); return -ENOMEM; -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:15 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:15 -0500 Subject: [lustre-devel] [PATCH 39/40] staging: lustre: Use lnet_is_route_alive for router aliveness In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-40-git-send-email-jsimmons@infradead.org> From: Chris Horn lctl show_route and lctl route_list will output router aliveness information via lnet_get_route(). lnet_get_route() should use the lnet_is_route_alive() function, introduced in e8a1124 http://review.whamcloud.com/7857, to determine route aliveness. Signed-off-by: Chris Horn Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5733 Reviewed-on: http://review.whamcloud.com/14055 Reviewed-by: James Simmons Reviewed-by: Amir Shehata Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/router.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 35cfced..83d233b 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -611,8 +611,7 @@ lnet_get_route(int idx, __u32 *net, __u32 *hops, *hops = route->lr_hops; *priority = route->lr_priority; *gateway = route->lr_gateway->lp_nid; - *alive = route->lr_gateway->lp_alive && - !route->lr_downis; + *alive = lnet_is_route_alive(route); lnet_net_unlock(cpt); return 0; } -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:46 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:46 -0500 Subject: [lustre-devel] [PATCH 10/40] staging: lustre: Dynamic LNet Configuration (DLC) dynamic routing In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-11-git-send-email-jsimmons@infradead.org> From: Amir Shehata This is the second patch of a set of patches that enables DLC. This patch adds the following features to LNET. Currently these features are not driven by user space. - Enabling Routing on Demand. The default number of router buffers are allocated. - Disable Routing on demand. Unused router buffers are freed and used router buffers are freed when they are no longer in use. The following time routing is enabled the default router buffer values are used. It has been decided that remembering the user set router buffer values should be remembered and re-set by user space scripts. - Increase the number of router buffers on demand, by allocating new ones. - Decrease the number of router buffers. Exccess buffers are freed if they are not in use. Otherwise they are freed once they are no longer in use. Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2456 Change-Id: Id07d4ad424d8f5ba72475d4149380afe2ac54e77 Reviewed-on: http://review.whamcloud.com/9831 Reviewed-by: James Simmons Reviewed-by: Doug Oucharek Reviewed-by: Liang Zhen Reviewed-by: Oleg Drokin --- .../staging/lustre/include/linux/lnet/lib-lnet.h | 8 +- .../staging/lustre/include/linux/lnet/lib-types.h | 8 +- drivers/staging/lustre/lnet/lnet/api-ni.c | 4 +- drivers/staging/lustre/lnet/lnet/lib-move.c | 89 +++++-- drivers/staging/lustre/lnet/lnet/router.c | 276 +++++++++++++++----- 5 files changed, 304 insertions(+), 81 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 1e0b236..60accdf 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -459,7 +459,11 @@ int lnet_get_route(int idx, __u32 *net, __u32 *hops, void lnet_router_debugfs_init(void); void lnet_router_debugfs_fini(void); int lnet_rtrpools_alloc(int im_a_router); -void lnet_rtrpools_free(void); +void lnet_destroy_rtrbuf(lnet_rtrbuf_t *rb, int npages); +int lnet_rtrpools_adjust(int tiny, int small, int large); +int lnet_rtrpools_enable(void); +void lnet_rtrpools_disable(void); +void lnet_rtrpools_free(int keep_pools); lnet_remotenet_t *lnet_find_net_locked(__u32 net); int lnet_islocalnid(lnet_nid_t nid); @@ -479,6 +483,8 @@ void lnet_prep_send(lnet_msg_t *msg, int type, lnet_process_id_t target, int lnet_send(lnet_nid_t nid, lnet_msg_t *msg, lnet_nid_t rtr_nid); void lnet_return_tx_credits_locked(lnet_msg_t *msg); void lnet_return_rx_credits_locked(lnet_msg_t *msg); +void lnet_schedule_blocked_locked(lnet_rtrbufpool_t *rbp); +void lnet_drop_routed_msgs_locked(struct list_head *list, int cpt); /* portals functions */ /* portals attributes */ diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index 39381d9..e7585b9 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -277,6 +277,7 @@ typedef struct lnet_ni { #define LNET_PING_FEAT_INVAL (0) /* no feature */ #define LNET_PING_FEAT_BASE (1 << 0) /* just a ping */ #define LNET_PING_FEAT_NI_STATUS (1 << 1) /* return NI status */ +#define LNET_PING_FEAT_RTE_DISABLED (1 << 2) /* Routing enabled */ #define LNET_PING_FEAT_MASK (LNET_PING_FEAT_BASE | \ LNET_PING_FEAT_NI_STATUS) @@ -400,7 +401,12 @@ typedef struct { #define LNET_PEER_HASHSIZE 503 /* prime! */ -#define LNET_NRBPOOLS 3 /* # different router buffer pools */ +#define LNET_TINY_BUF_IDX 0 +#define LNET_SMALL_BUF_IDX 1 +#define LNET_LARGE_BUF_IDX 2 + +/* # different router buffer pools */ +#define LNET_NRBPOOLS (LNET_LARGE_BUF_IDX + 1) enum { /* Didn't match anything */ diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index f3c9937..0338537 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -632,7 +632,7 @@ lnet_unprepare(void) lnet_msg_containers_destroy(); lnet_peer_tables_destroy(); - lnet_rtrpools_free(); + lnet_rtrpools_free(0); if (the_lnet.ln_counters != NULL) { cfs_percpt_free(the_lnet.ln_counters); @@ -1515,6 +1515,8 @@ lnet_create_ping_info(void) pinfo->pi_pid = the_lnet.ln_pid; pinfo->pi_magic = LNET_PROTO_PING_MAGIC; pinfo->pi_features = LNET_PING_FEAT_NI_STATUS; + if (!the_lnet.ln_routing) + pinfo->pi_features |= LNET_PING_FEAT_RTE_DISABLED; for (i = 0; i < n; i++) { lnet_ni_status_t *ns = &pinfo->pi_ni[i]; diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index 021a81d..e1461af 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -935,9 +935,6 @@ lnet_post_routed_recv_locked(lnet_msg_t *msg, int do_recv) rbp = lnet_msg2bufpool(msg); if (!msg->msg_rtrcredit) { - LASSERT((rbp->rbp_credits < 0) == - !list_empty(&rbp->rbp_msgs)); - msg->msg_rtrcredit = 1; rbp->rbp_credits--; if (rbp->rbp_credits < rbp->rbp_mincredits) @@ -1029,6 +1026,43 @@ lnet_return_tx_credits_locked(lnet_msg_t *msg) } void +lnet_schedule_blocked_locked(lnet_rtrbufpool_t *rbp) +{ + lnet_msg_t *msg; + + if (list_empty(&rbp->rbp_msgs)) + return; + msg = list_entry(rbp->rbp_msgs.next, + lnet_msg_t, msg_list); + list_del(&msg->msg_list); + + (void)lnet_post_routed_recv_locked(msg, 1); +} + +void +lnet_drop_routed_msgs_locked(struct list_head *list, int cpt) +{ + struct list_head drop; + lnet_msg_t *msg; + lnet_msg_t *tmp; + + INIT_LIST_HEAD(&drop); + + list_splice_init(list, &drop); + + lnet_net_unlock(cpt); + + list_for_each_entry_safe(msg, tmp, &drop, msg_list) { + lnet_ni_recv(msg->msg_rxpeer->lp_ni, msg->msg_private, NULL, + 0, 0, 0, msg->msg_hdr.payload_length); + list_del_init(&msg->msg_list); + lnet_finalize(NULL, msg, -ECANCELED); + } + + lnet_net_lock(cpt); +} + +void lnet_return_rx_credits_locked(lnet_msg_t *msg) { lnet_peer_t *rxpeer = msg->msg_rxpeer; @@ -1046,27 +1080,41 @@ lnet_return_rx_credits_locked(lnet_msg_t *msg) rb = list_entry(msg->msg_kiov, lnet_rtrbuf_t, rb_kiov[0]); rbp = rb->rb_pool; - LASSERT(rbp == lnet_msg2bufpool(msg)); msg->msg_kiov = NULL; msg->msg_rtrcredit = 0; - LASSERT((rbp->rbp_credits < 0) == - !list_empty(&rbp->rbp_msgs)); + LASSERT(rbp == lnet_msg2bufpool(msg)); + LASSERT((rbp->rbp_credits > 0) == !list_empty(&rbp->rbp_bufs)); - list_add(&rb->rb_list, &rbp->rbp_bufs); - rbp->rbp_credits++; - if (rbp->rbp_credits <= 0) { - msg2 = list_entry(rbp->rbp_msgs.next, - lnet_msg_t, msg_list); - list_del(&msg2->msg_list); + /* + * If routing is now turned off, we just drop this buffer and + * don't bother trying to return credits. + */ + if (!the_lnet.ln_routing) { + lnet_destroy_rtrbuf(rb, rbp->rbp_npages); + goto routing_off; + } - (void) lnet_post_routed_recv_locked(msg2, 1); + /* + * It is possible that a user has lowered the desired number of + * buffers in this pool. Make sure we never put back + * more buffers than the stated number. + */ + if (rbp->rbp_credits >= rbp->rbp_nbuffers) { + /* Discard this buffer so we don't have too many. */ + lnet_destroy_rtrbuf(rb, rbp->rbp_npages); + } else { + list_add(&rb->rb_list, &rbp->rbp_bufs); + rbp->rbp_credits++; + if (rbp->rbp_credits <= 0) + lnet_schedule_blocked_locked(rbp); } } +routing_off: if (msg->msg_peerrtrcredit) { /* give back peer router credits */ msg->msg_peerrtrcredit = 0; @@ -1075,7 +1123,14 @@ lnet_return_rx_credits_locked(lnet_msg_t *msg) !list_empty(&rxpeer->lp_rtrq)); rxpeer->lp_rtrcredits++; - if (rxpeer->lp_rtrcredits <= 0) { + /* + * drop all messages which are queued to be routed on that + * peer. + */ + if (!the_lnet.ln_routing) { + lnet_drop_routed_msgs_locked(&rxpeer->lp_rtrq, + msg->msg_rx_cpt); + } else if (rxpeer->lp_rtrcredits <= 0) { msg2 = list_entry(rxpeer->lp_rtrq.next, lnet_msg_t, msg_list); list_del(&msg2->msg_list); @@ -1625,6 +1680,9 @@ lnet_parse_forward_locked(lnet_ni_t *ni, lnet_msg_t *msg) { int rc = 0; + if (!the_lnet.ln_routing) + return -ECANCELED; + if (msg->msg_rxpeer->lp_rtrcredits <= 0 || lnet_msg2bufpool(msg)->rbp_credits <= 0) { if (ni->ni_lnd->lnd_eager_recv == NULL) { @@ -1780,9 +1838,8 @@ lnet_parse(lnet_ni_t *ni, lnet_hdr_t *hdr, lnet_nid_t from_nid, if (the_lnet.ln_routing && ni->ni_last_alive != ktime_get_real_seconds()) { - lnet_ni_lock(ni); - /* NB: so far here is the only place to set NI status to "up */ + lnet_ni_lock(ni); ni->ni_last_alive = ktime_get_real_seconds(); if (ni->ni_status != NULL && ni->ni_status->ns_status == LNET_NI_STATUS_DOWN) diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 47f80aa..749085f 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -28,8 +28,11 @@ #define LNET_NRB_TINY (LNET_NRB_TINY_MIN * 4) #define LNET_NRB_SMALL_MIN 4096 /* min value for each CPT */ #define LNET_NRB_SMALL (LNET_NRB_SMALL_MIN * 4) +#define LNET_NRB_SMALL_PAGES 1 #define LNET_NRB_LARGE_MIN 256 /* min value for each CPT */ #define LNET_NRB_LARGE (LNET_NRB_LARGE_MIN * 4) +#define LNET_NRB_LARGE_PAGES ((LNET_MTU + PAGE_CACHE_SIZE - 1) >> \ + PAGE_CACHE_SHIFT) static char *forwarding = ""; module_param(forwarding, charp, 0444); @@ -566,7 +569,8 @@ lnet_get_route(int idx, __u32 *net, __u32 *hops, *hops = route->lr_hops; *priority = route->lr_priority; *gateway = route->lr_gateway->lp_nid; - *alive = route->lr_gateway->lp_alive; + *alive = route->lr_gateway->lp_alive && + !route->lr_downis; lnet_net_unlock(cpt); return 0; } @@ -604,7 +608,7 @@ lnet_parse_rc_info(lnet_rc_data_t *rcd) { lnet_ping_info_t *info = rcd->rcd_pinginfo; struct lnet_peer *gw = rcd->rcd_gateway; - lnet_route_t *rtr; + lnet_route_t *rte; if (!gw->lp_alive) return; @@ -630,11 +634,16 @@ lnet_parse_rc_info(lnet_rc_data_t *rcd) if ((gw->lp_ping_feats & LNET_PING_FEAT_NI_STATUS) == 0) return; /* can't carry NI status info */ - list_for_each_entry(rtr, &gw->lp_routes, lr_gwlist) { + list_for_each_entry(rte, &gw->lp_routes, lr_gwlist) { int down = 0; int up = 0; int i; + if ((gw->lp_ping_feats & LNET_PING_FEAT_RTE_DISABLED) != 0) { + rte->lr_downis = 1; + continue; + } + for (i = 0; i < info->pi_nnis && i < LNET_MAX_RTR_NIS; i++) { lnet_ni_status_t *stat = &info->pi_ni[i]; lnet_nid_t nid = stat->ns_nid; @@ -655,7 +664,7 @@ lnet_parse_rc_info(lnet_rc_data_t *rcd) } if (stat->ns_status == LNET_NI_STATUS_UP) { - if (LNET_NIDNET(nid) == rtr->lr_net) { + if (LNET_NIDNET(nid) == rte->lr_net) { up = 1; break; } @@ -669,10 +678,10 @@ lnet_parse_rc_info(lnet_rc_data_t *rcd) } if (up) { /* ignore downed NIs if NI for dest network is up */ - rtr->lr_downis = 0; + rte->lr_downis = 0; continue; } - rtr->lr_downis = down; + rte->lr_downis = down; } } @@ -1209,7 +1218,7 @@ rescan: return 0; } -static void +void lnet_destroy_rtrbuf(lnet_rtrbuf_t *rb, int npages) { int sz = offsetof(lnet_rtrbuf_t, rb_kiov[npages]); @@ -1256,66 +1265,103 @@ lnet_new_rtrbuf(lnet_rtrbufpool_t *rbp, int cpt) } static void -lnet_rtrpool_free_bufs(lnet_rtrbufpool_t *rbp) +lnet_rtrpool_free_bufs(lnet_rtrbufpool_t *rbp, int cpt) { int npages = rbp->rbp_npages; - int nbuffers = 0; + struct list_head tmp; lnet_rtrbuf_t *rb; if (rbp->rbp_nbuffers == 0) /* not initialized or already freed */ return; - LASSERT(list_empty(&rbp->rbp_msgs)); - LASSERT(rbp->rbp_credits == rbp->rbp_nbuffers); + INIT_LIST_HEAD(&tmp); - while (!list_empty(&rbp->rbp_bufs)) { - LASSERT(rbp->rbp_credits > 0); + lnet_net_lock(cpt); + lnet_drop_routed_msgs_locked(&rbp->rbp_msgs, cpt); + list_splice_init(&rbp->rbp_bufs, &tmp); + rbp->rbp_nbuffers = 0; + rbp->rbp_credits = 0; + rbp->rbp_mincredits = 0; + lnet_net_unlock(cpt); - rb = list_entry(rbp->rbp_bufs.next, - lnet_rtrbuf_t, rb_list); + /* Free buffers on the free list. */ + while (!list_empty(&tmp)) { + rb = list_entry(tmp.next, lnet_rtrbuf_t, rb_list); list_del(&rb->rb_list); lnet_destroy_rtrbuf(rb, npages); - nbuffers++; } - - LASSERT(rbp->rbp_nbuffers == nbuffers); - LASSERT(rbp->rbp_credits == nbuffers); - - rbp->rbp_nbuffers = rbp->rbp_credits = 0; } static int -lnet_rtrpool_alloc_bufs(lnet_rtrbufpool_t *rbp, int nbufs, int cpt) +lnet_rtrpool_adjust_bufs(lnet_rtrbufpool_t *rbp, int nbufs, int cpt) { + struct list_head rb_list; lnet_rtrbuf_t *rb; - int i; + int num_rb; + int num_buffers = 0; + int npages = rbp->rbp_npages; - if (rbp->rbp_nbuffers != 0) { - LASSERT(rbp->rbp_nbuffers == nbufs); + /* + * If we are called for less buffers than already in the pool, we + * just lower the nbuffers number and excess buffers will be + * thrown away as they are returned to the free list. Credits + * then get adjusted as well. + */ + if (nbufs <= rbp->rbp_nbuffers) { + lnet_net_lock(cpt); + rbp->rbp_nbuffers = nbufs; + lnet_net_unlock(cpt); return 0; } - for (i = 0; i < nbufs; i++) { - rb = lnet_new_rtrbuf(rbp, cpt); + INIT_LIST_HEAD(&rb_list); + /* + * allocate the buffers on a local list first. If all buffers are + * allocated successfully then join this list to the rbp buffer + * list. If not then free all allocated buffers. + */ + num_rb = rbp->rbp_nbuffers; + + while (num_rb < nbufs) { + rb = lnet_new_rtrbuf(rbp, cpt); if (rb == NULL) { - CERROR("Failed to allocate %d router bufs of %d pages\n", - nbufs, rbp->rbp_npages); - return -ENOMEM; + CERROR("Failed to allocate %d route bufs of %d pages\n", + nbufs, npages); + goto failed; } - rbp->rbp_nbuffers++; - rbp->rbp_credits++; - rbp->rbp_mincredits++; - list_add(&rb->rb_list, &rbp->rbp_bufs); - - /* No allocation "under fire" */ - /* Otherwise we'd need code to schedule blocked msgs etc */ - LASSERT(!the_lnet.ln_routing); + list_add(&rb->rb_list, &rb_list); + num_buffers++; + num_rb++; } - LASSERT(rbp->rbp_credits == nbufs); + lnet_net_lock(cpt); + + list_splice_tail(&rb_list, &rbp->rbp_bufs); + rbp->rbp_nbuffers += num_buffers; + rbp->rbp_credits += num_buffers; + rbp->rbp_mincredits = rbp->rbp_credits; + /* + * We need to schedule blocked msg using the newly + * added buffers. + */ + while (!list_empty(&rbp->rbp_bufs) && + !list_empty(&rbp->rbp_msgs)) + lnet_schedule_blocked_locked(rbp); + + lnet_net_unlock(cpt); + return 0; + +failed: + while (!list_empty(&rb_list)) { + rb = list_entry(rb_list.next, lnet_rtrbuf_t, rb_list); + list_del(&rb->rb_list); + lnet_destroy_rtrbuf(rb, npages); + } + + return -ENOMEM; } static void @@ -1330,7 +1376,7 @@ lnet_rtrpool_init(lnet_rtrbufpool_t *rbp, int npages) } void -lnet_rtrpools_free(void) +lnet_rtrpools_free(int keep_pools) { lnet_rtrbufpool_t *rtrp; int i; @@ -1339,17 +1385,19 @@ lnet_rtrpools_free(void) return; cfs_percpt_for_each(rtrp, i, the_lnet.ln_rtrpools) { - lnet_rtrpool_free_bufs(&rtrp[0]); - lnet_rtrpool_free_bufs(&rtrp[1]); - lnet_rtrpool_free_bufs(&rtrp[2]); + lnet_rtrpool_free_bufs(&rtrp[LNET_TINY_BUF_IDX], i); + lnet_rtrpool_free_bufs(&rtrp[LNET_SMALL_BUF_IDX], i); + lnet_rtrpool_free_bufs(&rtrp[LNET_LARGE_BUF_IDX], i); } - cfs_percpt_free(the_lnet.ln_rtrpools); - the_lnet.ln_rtrpools = NULL; + if (!keep_pools) { + cfs_percpt_free(the_lnet.ln_rtrpools); + the_lnet.ln_rtrpools = NULL; + } } static int -lnet_nrb_tiny_calculate(int npages) +lnet_nrb_tiny_calculate(void) { int nrbs = LNET_NRB_TINY; @@ -1368,7 +1416,7 @@ lnet_nrb_tiny_calculate(int npages) } static int -lnet_nrb_small_calculate(int npages) +lnet_nrb_small_calculate(void) { int nrbs = LNET_NRB_SMALL; @@ -1387,7 +1435,7 @@ lnet_nrb_small_calculate(int npages) } static int -lnet_nrb_large_calculate(int npages) +lnet_nrb_large_calculate(void) { int nrbs = LNET_NRB_LARGE; @@ -1409,16 +1457,12 @@ int lnet_rtrpools_alloc(int im_a_router) { lnet_rtrbufpool_t *rtrp; - int large_pages; - int small_pages = 1; int nrb_tiny; int nrb_small; int nrb_large; int rc; int i; - large_pages = (LNET_MTU + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; - if (!strcmp(forwarding, "")) { /* not set either way */ if (!im_a_router) @@ -1433,15 +1477,15 @@ lnet_rtrpools_alloc(int im_a_router) return -EINVAL; } - nrb_tiny = lnet_nrb_tiny_calculate(0); + nrb_tiny = lnet_nrb_tiny_calculate(); if (nrb_tiny < 0) return -EINVAL; - nrb_small = lnet_nrb_small_calculate(small_pages); + nrb_small = lnet_nrb_small_calculate(); if (nrb_small < 0) return -EINVAL; - nrb_large = lnet_nrb_large_calculate(large_pages); + nrb_large = lnet_nrb_large_calculate(); if (nrb_large < 0) return -EINVAL; @@ -1455,18 +1499,23 @@ lnet_rtrpools_alloc(int im_a_router) } cfs_percpt_for_each(rtrp, i, the_lnet.ln_rtrpools) { - lnet_rtrpool_init(&rtrp[0], 0); - rc = lnet_rtrpool_alloc_bufs(&rtrp[0], nrb_tiny, i); + lnet_rtrpool_init(&rtrp[LNET_TINY_BUF_IDX], 0); + rc = lnet_rtrpool_adjust_bufs(&rtrp[LNET_TINY_BUF_IDX], + nrb_tiny, i); if (rc != 0) goto failed; - lnet_rtrpool_init(&rtrp[1], small_pages); - rc = lnet_rtrpool_alloc_bufs(&rtrp[1], nrb_small, i); + lnet_rtrpool_init(&rtrp[LNET_SMALL_BUF_IDX], + LNET_NRB_SMALL_PAGES); + rc = lnet_rtrpool_adjust_bufs(&rtrp[LNET_SMALL_BUF_IDX], + nrb_small, i); if (rc != 0) goto failed; - lnet_rtrpool_init(&rtrp[2], large_pages); - rc = lnet_rtrpool_alloc_bufs(&rtrp[2], nrb_large, i); + lnet_rtrpool_init(&rtrp[LNET_LARGE_BUF_IDX], + LNET_NRB_LARGE_PAGES); + rc = lnet_rtrpool_adjust_bufs(&rtrp[LNET_LARGE_BUF_IDX], + nrb_large, i); if (rc != 0) goto failed; } @@ -1478,11 +1527,114 @@ lnet_rtrpools_alloc(int im_a_router) return 0; failed: - lnet_rtrpools_free(); + lnet_rtrpools_free(0); return rc; } int +lnet_rtrpools_adjust(int tiny, int small, int large) +{ + int nrb = 0; + int rc = 0; + int i; + lnet_rtrbufpool_t *rtrp; + + /* + * this function doesn't revert the changes if adding new buffers + * failed. It's up to the user space caller to revert the + * changes. + */ + + if (!the_lnet.ln_routing) + return 0; + + /* + * If the provided values for each buffer pool are different than the + * configured values, we need to take action. + */ + if (tiny >= 0 && tiny != tiny_router_buffers) { + tiny_router_buffers = tiny; + nrb = lnet_nrb_tiny_calculate(); + cfs_percpt_for_each(rtrp, i, the_lnet.ln_rtrpools) { + rc = lnet_rtrpool_adjust_bufs(&rtrp[LNET_TINY_BUF_IDX], + nrb, i); + if (rc != 0) + return rc; + } + } + if (small >= 0 && small != small_router_buffers) { + small_router_buffers = small; + nrb = lnet_nrb_small_calculate(); + cfs_percpt_for_each(rtrp, i, the_lnet.ln_rtrpools) { + rc = lnet_rtrpool_adjust_bufs(&rtrp[LNET_SMALL_BUF_IDX], + nrb, i); + if (rc != 0) + return rc; + } + } + if (large >= 0 && large != large_router_buffers) { + large_router_buffers = large; + nrb = lnet_nrb_large_calculate(); + cfs_percpt_for_each(rtrp, i, the_lnet.ln_rtrpools) { + rc = lnet_rtrpool_adjust_bufs(&rtrp[LNET_LARGE_BUF_IDX], + nrb, i); + if (rc != 0) + return rc; + } + } + + return 0; +} + +int +lnet_rtrpools_enable(void) +{ + int rc; + + if (the_lnet.ln_routing) + return 0; + + if (!the_lnet.ln_rtrpools) + /* + * If routing is turned off, and we have never + * initialized the pools before, just call the + * standard buffer pool allocation routine as + * if we are just configuring this for the first + * time. + */ + return lnet_rtrpools_alloc(1); + + rc = lnet_rtrpools_adjust(0, 0, 0); + if (rc != 0) + return rc; + + lnet_net_lock(LNET_LOCK_EX); + the_lnet.ln_routing = 1; + + the_lnet.ln_ping_info->pi_features &= ~LNET_PING_FEAT_RTE_DISABLED; + lnet_net_unlock(LNET_LOCK_EX); + + return 0; +} + +void +lnet_rtrpools_disable(void) +{ + if (!the_lnet.ln_routing) + return; + + lnet_net_lock(LNET_LOCK_EX); + the_lnet.ln_routing = 0; + the_lnet.ln_ping_info->pi_features |= LNET_PING_FEAT_RTE_DISABLED; + + tiny_router_buffers = 0; + small_router_buffers = 0; + large_router_buffers = 0; + lnet_net_unlock(LNET_LOCK_EX); + lnet_rtrpools_free(1); +} + +int lnet_notify(lnet_ni_t *ni, lnet_nid_t nid, int alive, unsigned long when) { struct lnet_peer *lp = NULL; -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:51 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:51 -0500 Subject: [lustre-devel] [PATCH 15/40] staging: lustre: DLC user/kernel space glue code In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-16-git-send-email-jsimmons@infradead.org> From: Amir Shehata This is the sixth patch of a set of patches that enables DLC. This patch enables the user space to call into the kernel space DLC code. Added handlers in the LNetCtl function to call the new functions added for Dynamic Lnet Configuration Signed-off-by: Amir Shehata ntel-bug-id: https://jira.hpdd.intel.com/browse/LU-2456 Reviewed-on: http://review.whamcloud.com/8023 Reviewed-by: James Simmons Reviewed-by: Doug Oucharek Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- .../staging/lustre/include/linux/lnet/lib-lnet.h | 22 ++- .../staging/lustre/include/linux/lnet/lib-types.h | 8 + drivers/staging/lustre/lnet/lnet/api-ni.c | 172 ++++++++++++++++++-- drivers/staging/lustre/lnet/lnet/module.c | 53 ++++++- drivers/staging/lustre/lnet/lnet/peer.c | 34 ++-- drivers/staging/lustre/lnet/lnet/router.c | 71 +++++++-- 6 files changed, 307 insertions(+), 53 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index f2874e0..63919dd 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -39,6 +39,7 @@ #include "api.h" #include "lnet.h" #include "lib-types.h" +#include "lib-dlc.h" extern lnet_t the_lnet; /* THE network */ @@ -456,6 +457,12 @@ int lnet_del_route(__u32 net, lnet_nid_t gw_nid); void lnet_destroy_routes(void); int lnet_get_route(int idx, __u32 *net, __u32 *hops, lnet_nid_t *gateway, __u32 *alive, __u32 *priority); +int lnet_get_net_config(int idx, __u32 *cpt_count, __u64 *nid, + int *peer_timeout, int *peer_tx_credits, + int *peer_rtr_cr, int *max_tx_credits, + struct lnet_ioctl_net_config *net_config); +int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg); + void lnet_router_debugfs_init(void); void lnet_router_debugfs_fini(void); int lnet_rtrpools_alloc(int im_a_router); @@ -465,6 +472,10 @@ int lnet_rtrpools_enable(void); void lnet_rtrpools_disable(void); void lnet_rtrpools_free(int keep_pools); lnet_remotenet_t *lnet_find_net_locked(__u32 net); +int lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets, + __s32 peer_timeout, __s32 peer_cr, __s32 peer_buf_cr, + __s32 credits); +int lnet_dyn_del_ni(__u32 net); int lnet_islocalnid(lnet_nid_t nid); int lnet_islocalnet(__u32 net); @@ -694,11 +705,12 @@ void lnet_peer_tables_cleanup(lnet_ni_t *ni); void lnet_peer_tables_destroy(void); int lnet_peer_tables_create(void); void lnet_debug_peer(lnet_nid_t nid); -int lnet_get_peers(int count, __u64 *nid, char *alivness, - int *ncpt, int *refcount, - int *ni_peer_tx_credits, int *peer_tx_credits, - int *peer_rtr_credits, int *peer_min_rtr_credtis, - int *peer_tx_qnob); +int lnet_get_peer_info(__u32 peer_index, __u64 *nid, + char alivness[LNET_MAX_STR_LEN], + __u32 *cpt_iter, __u32 *refcount, + __u32 *ni_peer_tx_credits, __u32 *peer_tx_credits, + __u32 *peer_rtr_credits, __u32 *peer_min_rtr_credtis, + __u32 *peer_tx_qnob); static inline void lnet_peer_set_alive(lnet_peer_t *lp) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index e7585b9..3282782 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -611,6 +611,14 @@ typedef struct { /* test protocol compatibility flags */ int ln_testprotocompat; + /* + * 0 - load the NIs from the mod params + * 1 - do not load the NIs from the mod params + * Reverse logic to ensure that other calls to LNetNIInit + * need no change + */ + bool ln_nis_from_mod_params; + } lnet_t; #endif diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index cc87900..125d018 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1542,7 +1542,9 @@ LNetNIInit(lnet_pid_t requested_pid) if (rc != 0) goto failed0; - rc = lnet_parse_networks(&net_head, lnet_get_networks()); + rc = lnet_parse_networks(&net_head, + !the_lnet.ln_nis_from_mod_params ? + lnet_get_networks() : ""); if (rc < 0) goto failed1; @@ -1657,6 +1659,93 @@ LNetNIFini(void) } EXPORT_SYMBOL(LNetNIFini); +/** + * Grabs the ni data from the ni structure and fills the out + * parameters + * + * \param[in] ni network interface structure + * \param[out] cpt_count the number of cpts the ni is on + * \param[out] nid Network Interface ID + * \param[out] peer_timeout NI peer timeout + * \param[out] peer_tx_crdits NI peer transmit credits + * \param[out] peer_rtr_credits NI peer router credits + * \param[out] max_tx_credits NI max transmit credit + * \param[out] net_config Network configuration + */ +static void +lnet_fill_ni_info(struct lnet_ni *ni, __u32 *cpt_count, __u64 *nid, + int *peer_timeout, int *peer_tx_credits, + int *peer_rtr_credits, int *max_tx_credits, + struct lnet_ioctl_net_config *net_config) +{ + int i; + + if (!ni) + return; + + if (!net_config) + return; + + CLASSERT(ARRAY_SIZE(ni->ni_interfaces) == + ARRAY_SIZE(net_config->ni_interfaces)); + + if (ni->ni_interfaces[0]) { + for (i = 0; i < ARRAY_SIZE(ni->ni_interfaces); i++) { + if (ni->ni_interfaces[i]) { + strncpy(net_config->ni_interfaces[i], + ni->ni_interfaces[i], + sizeof(net_config->ni_interfaces[i])); + } + } + } + + *nid = ni->ni_nid; + *peer_timeout = ni->ni_peertimeout; + *peer_tx_credits = ni->ni_peertxcredits; + *peer_rtr_credits = ni->ni_peerrtrcredits; + *max_tx_credits = ni->ni_maxtxcredits; + + net_config->ni_status = ni->ni_status->ns_status; + + for (i = 0; + ni->ni_cpts && i < ni->ni_ncpts && + i < LNET_MAX_SHOW_NUM_CPT; + i++) + net_config->ni_cpts[i] = ni->ni_cpts[i]; + + *cpt_count = ni->ni_ncpts; +} + +int +lnet_get_net_config(int idx, __u32 *cpt_count, __u64 *nid, int *peer_timeout, + int *peer_tx_credits, int *peer_rtr_credits, + int *max_tx_credits, + struct lnet_ioctl_net_config *net_config) +{ + struct lnet_ni *ni; + struct list_head *tmp; + int cpt; + int rc = -ENOENT; + + cpt = lnet_net_lock_current(); + + list_for_each(tmp, &the_lnet.ln_nis) { + ni = list_entry(tmp, lnet_ni_t, ni_list); + if (idx-- == 0) { + rc = 0; + lnet_ni_lock(ni); + lnet_fill_ni_info(ni, cpt_count, nid, peer_timeout, + peer_tx_credits, peer_rtr_credits, + max_tx_credits, net_config); + lnet_ni_unlock(ni); + break; + } + } + + lnet_net_unlock(cpt); + return rc; +} + int lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets, __s32 peer_timeout, __s32 peer_cr, __s32 peer_buf_cr, @@ -1757,9 +1846,13 @@ LNetCtl(unsigned int cmd, void *arg) return lnet_fail_nid(data->ioc_nid, data->ioc_count); case IOC_LIBCFS_ADD_ROUTE: + config = arg; mutex_lock(&the_lnet.ln_api_mutex); - rc = lnet_add_route(data->ioc_net, data->ioc_count, - data->ioc_nid, data->ioc_priority); + rc = lnet_add_route(config->cfg_net, + config->cfg_config_u.cfg_route.rtr_hop, + config->cfg_nid, + config->cfg_config_u.cfg_route. + rtr_priority); mutex_unlock(&the_lnet.ln_api_mutex); return (rc != 0) ? rc : lnet_check_routes(); @@ -1780,14 +1873,28 @@ LNetCtl(unsigned int cmd, void *arg) &config->cfg_config_u.cfg_route. rtr_priority); - case IOC_LIBCFS_ADD_NET: - return 0; - - case IOC_LIBCFS_DEL_NET: - return 0; + case IOC_LIBCFS_GET_NET: { + struct lnet_ioctl_net_config *net_config; - case IOC_LIBCFS_GET_NET: - return 0; + config = arg; + net_config = (struct lnet_ioctl_net_config *) + config->cfg_bulk; + if (!config || !net_config) + return -1; + + return lnet_get_net_config(config->cfg_count, + &config->cfg_ncpts, + &config->cfg_nid, + &config->cfg_config_u.cfg_net. + net_peer_timeout, + &config->cfg_config_u.cfg_net. + net_peer_tx_credits, + &config->cfg_config_u.cfg_net. + net_peer_rtr_credits, + &config->cfg_config_u.cfg_net. + net_max_tx_credits, + net_config); + } case IOC_LIBCFS_GET_LNET_STATS: { @@ -1798,16 +1905,51 @@ LNetCtl(unsigned int cmd, void *arg) } case IOC_LIBCFS_CONFIG_RTR: + config = arg; + mutex_lock(&the_lnet.ln_api_mutex); + if (config->cfg_config_u.cfg_buffers.buf_enable) { + rc = lnet_rtrpools_enable(); + mutex_unlock(&the_lnet.ln_api_mutex); + return rc; + } + lnet_rtrpools_disable(); + mutex_unlock(&the_lnet.ln_api_mutex); return 0; case IOC_LIBCFS_ADD_BUF: - return 0; + config = arg; + mutex_lock(&the_lnet.ln_api_mutex); + rc = lnet_rtrpools_adjust(config->cfg_config_u.cfg_buffers. + buf_tiny, + config->cfg_config_u.cfg_buffers. + buf_small, + config->cfg_config_u.cfg_buffers. + buf_large); + mutex_unlock(&the_lnet.ln_api_mutex); + return rc; - case IOC_LIBCFS_GET_BUF: - return 0; + case IOC_LIBCFS_GET_BUF: { + struct lnet_ioctl_pool_cfg *pool_cfg; - case IOC_LIBCFS_GET_PEER_INFO: - return 0; + config = arg; + pool_cfg = (struct lnet_ioctl_pool_cfg *)config->cfg_bulk; + return lnet_get_rtr_pool_cfg(config->cfg_count, pool_cfg); + } + + case IOC_LIBCFS_GET_PEER_INFO: { + struct lnet_ioctl_peer *peer_info = arg; + + return lnet_get_peer_info(peer_info->pr_count, + &peer_info->pr_nid, + peer_info->pr_lnd_u.pr_peer_credits.cr_aliveness, + &peer_info->pr_lnd_u.pr_peer_credits.cr_ncpt, + &peer_info->pr_lnd_u.pr_peer_credits.cr_refcount, + &peer_info->pr_lnd_u.pr_peer_credits.cr_ni_peer_tx_credits, + &peer_info->pr_lnd_u.pr_peer_credits.cr_peer_tx_credits, + &peer_info->pr_lnd_u.pr_peer_credits.cr_peer_rtr_credits, + &peer_info->pr_lnd_u.pr_peer_credits.cr_peer_min_rtr_credits, + &peer_info->pr_lnd_u.pr_peer_credits.cr_peer_tx_qnob); + } case IOC_LIBCFS_NOTIFY_ROUTER: secs_passed = (ktime_get_real_seconds() - data->ioc_u64[0]); diff --git a/drivers/staging/lustre/lnet/lnet/module.c b/drivers/staging/lustre/lnet/lnet/module.c index ffc5700..281315c 100644 --- a/drivers/staging/lustre/lnet/lnet/module.c +++ b/drivers/staging/lustre/lnet/lnet/module.c @@ -84,20 +84,69 @@ lnet_unconfigure(void) return (refcount == 0) ? 0 : -EBUSY; } +int +lnet_dyn_configure(struct libcfs_ioctl_hdr *hdr) +{ + struct lnet_ioctl_config_data *conf = + (struct lnet_ioctl_config_data *)hdr; + int rc; + + mutex_lock(&lnet_config_mutex); + if (the_lnet.ln_niinit_self) + rc = lnet_dyn_add_ni(LUSTRE_SRV_LNET_PID, + conf->cfg_config_u.cfg_net.net_intf, + conf->cfg_config_u.cfg_net. + net_peer_timeout, + conf->cfg_config_u.cfg_net. + net_peer_tx_credits, + conf->cfg_config_u.cfg_net. + net_peer_rtr_credits, + conf->cfg_config_u.cfg_net. + net_max_tx_credits); + else + rc = -EINVAL; + mutex_unlock(&lnet_config_mutex); + return rc; +} + +int +lnet_dyn_unconfigure(struct libcfs_ioctl_hdr *hdr) +{ + struct lnet_ioctl_config_data *conf = + (struct lnet_ioctl_config_data *)hdr; + int rc; + + mutex_lock(&lnet_config_mutex); + if (the_lnet.ln_niinit_self) + rc = lnet_dyn_del_ni(conf->cfg_net); + else + rc = -EINVAL; + mutex_unlock(&lnet_config_mutex); + + return rc; +} + static int lnet_ioctl(unsigned int cmd, struct libcfs_ioctl_hdr *hdr) { int rc; switch (cmd) { - case IOC_LIBCFS_CONFIGURE: + case IOC_LIBCFS_CONFIGURE: { + struct libcfs_ioctl_data *data = + (struct libcfs_ioctl_data *)hdr; + the_lnet.ln_nis_from_mod_params = data->ioc_flags; return lnet_configure(NULL); + } case IOC_LIBCFS_UNCONFIGURE: return lnet_unconfigure(); case IOC_LIBCFS_ADD_NET: - return LNetCtl(cmd, hdr); + return lnet_dyn_configure(hdr); + + case IOC_LIBCFS_DEL_NET: + return lnet_dyn_unconfigure(hdr); default: /* Passing LNET_PID_ANY only gives me a ref if the net is up diff --git a/drivers/staging/lustre/lnet/lnet/peer.c b/drivers/staging/lustre/lnet/lnet/peer.c index 1402e27..3b71812 100644 --- a/drivers/staging/lustre/lnet/lnet/peer.c +++ b/drivers/staging/lustre/lnet/lnet/peer.c @@ -394,16 +394,18 @@ lnet_debug_peer(lnet_nid_t nid) lnet_net_unlock(cpt); } -int lnet_get_peers(int count, __u64 *nid, char *aliveness, - int *ncpt, int *refcount, - int *ni_peer_tx_credits, int *peer_tx_credits, - int *peer_rtr_credits, int *peer_min_rtr_credits, - int *peer_tx_qnob) +int +lnet_get_peer_info(__u32 peer_index, __u64 *nid, + char aliveness[LNET_MAX_STR_LEN], + __u32 *cpt_iter, __u32 *refcount, + __u32 *ni_peer_tx_credits, __u32 *peer_tx_credits, + __u32 *peer_rtr_credits, __u32 *peer_min_rtr_credits, + __u32 *peer_tx_qnob) { struct lnet_peer_table *peer_table; lnet_peer_t *lp; - int j; - int lncpt, found = 0; + bool found = false; + int lncpt, j; /* get the number of CPTs */ lncpt = cfs_percpt_number(the_lnet.ln_peer_tables); @@ -412,22 +414,22 @@ int lnet_get_peers(int count, __u64 *nid, char *aliveness, * if the cpt number to be examined is >= the number of cpts in * the system then indicate that there are no more cpts to examin */ - if (*ncpt > lncpt) - return -1; + if (*cpt_iter > lncpt) + return -ENOENT; /* get the current table */ - peer_table = the_lnet.ln_peer_tables[*ncpt]; + peer_table = the_lnet.ln_peer_tables[*cpt_iter]; /* if the ptable is NULL then there are no more cpts to examine */ if (!peer_table) - return -1; + return -ENOENT; - lnet_net_lock(*ncpt); + lnet_net_lock(*cpt_iter); for (j = 0; j < LNET_PEER_HASH_SIZE && !found; j++) { struct list_head *peers = &peer_table->pt_hash[j]; list_for_each_entry(lp, peers, lp_hashlist) { - if (count-- > 0) + if (peer_index-- > 0) continue; snprintf(aliveness, LNET_MAX_STR_LEN, "NA"); @@ -444,12 +446,12 @@ int lnet_get_peers(int count, __u64 *nid, char *aliveness, *peer_min_rtr_credits = lp->lp_mintxcredits; *peer_tx_qnob = lp->lp_txqnob; - found = 1; + found = true; } } - lnet_net_unlock(*ncpt); + lnet_net_unlock(*cpt_iter); - *ncpt = lncpt; + *cpt_iter = lncpt; return found ? 0 : -ENOENT; } diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 749085f..17e6795 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -541,6 +541,42 @@ lnet_destroy_routes(void) lnet_del_route(LNET_NIDNET(LNET_NID_ANY), LNET_NID_ANY); } +int lnet_get_rtr_pool_cfg(int idx, struct lnet_ioctl_pool_cfg *pool_cfg) +{ + int i, rc = -ENOENT, lidx, j; + + if (!the_lnet.ln_rtrpools) + return rc; + + for (i = 0; i < LNET_NRBPOOLS; i++) { + lnet_rtrbufpool_t *rbp; + + lnet_net_lock(LNET_LOCK_EX); + lidx = idx; + cfs_percpt_for_each(rbp, j, the_lnet.ln_rtrpools) { + if (lidx-- == 0) { + rc = 0; + pool_cfg->pl_pools[i].pl_npages = + rbp[i].rbp_npages; + pool_cfg->pl_pools[i].pl_nbuffers = + rbp[i].rbp_nbuffers; + pool_cfg->pl_pools[i].pl_credits = + rbp[i].rbp_credits; + pool_cfg->pl_pools[i].pl_mincredits = + rbp[i].rbp_mincredits; + break; + } + } + lnet_net_unlock(LNET_LOCK_EX); + } + + lnet_net_lock(LNET_LOCK_EX); + pool_cfg->pl_routing = the_lnet.ln_routing; + lnet_net_unlock(LNET_LOCK_EX); + + return rc; +} + int lnet_get_route(int idx, __u32 *net, __u32 *hops, lnet_nid_t *gateway, __u32 *alive, __u32 *priority) @@ -1531,8 +1567,8 @@ lnet_rtrpools_alloc(int im_a_router) return rc; } -int -lnet_rtrpools_adjust(int tiny, int small, int large) +static int +lnet_rtrpools_adjust_helper(int tiny, int small, int large) { int nrb = 0; int rc = 0; @@ -1540,19 +1576,10 @@ lnet_rtrpools_adjust(int tiny, int small, int large) lnet_rtrbufpool_t *rtrp; /* - * this function doesn't revert the changes if adding new buffers - * failed. It's up to the user space caller to revert the - * changes. - */ - - if (!the_lnet.ln_routing) - return 0; - - /* * If the provided values for each buffer pool are different than the * configured values, we need to take action. */ - if (tiny >= 0 && tiny != tiny_router_buffers) { + if (tiny >= 0) { tiny_router_buffers = tiny; nrb = lnet_nrb_tiny_calculate(); cfs_percpt_for_each(rtrp, i, the_lnet.ln_rtrpools) { @@ -1562,7 +1589,7 @@ lnet_rtrpools_adjust(int tiny, int small, int large) return rc; } } - if (small >= 0 && small != small_router_buffers) { + if (small >= 0) { small_router_buffers = small; nrb = lnet_nrb_small_calculate(); cfs_percpt_for_each(rtrp, i, the_lnet.ln_rtrpools) { @@ -1572,7 +1599,7 @@ lnet_rtrpools_adjust(int tiny, int small, int large) return rc; } } - if (large >= 0 && large != large_router_buffers) { + if (large >= 0) { large_router_buffers = large; nrb = lnet_nrb_large_calculate(); cfs_percpt_for_each(rtrp, i, the_lnet.ln_rtrpools) { @@ -1587,6 +1614,20 @@ lnet_rtrpools_adjust(int tiny, int small, int large) } int +lnet_rtrpools_adjust(int tiny, int small, int large) +{ + /* + * this function doesn't revert the changes if adding new buffers + * failed. It's up to the user space caller to revert the + * changes. + */ + if (!the_lnet.ln_routing) + return 0; + + return lnet_rtrpools_adjust_helper(tiny, small, large); +} + +int lnet_rtrpools_enable(void) { int rc; @@ -1604,7 +1645,7 @@ lnet_rtrpools_enable(void) */ return lnet_rtrpools_alloc(1); - rc = lnet_rtrpools_adjust(0, 0, 0); + rc = lnet_rtrpools_adjust_helper(0, 0, 0); if (rc != 0) return rc; -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:16 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:16 -0500 Subject: [lustre-devel] [PATCH 40/40] staging: lustre: Remove LASSERTS from router checker In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-41-git-send-email-jsimmons@infradead.org> From: Doug Oucharek In lnet_router_checker(), there are two LASSERTS. Neither protects us from anything and one of them triggered for a customer crashing the system unecessarily. This patch removes them. Signed-off-by: Doug Oucharek Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-7362 Reviewed-on: http://review.whamcloud.com/17003 Reviewed-by: James Simmons Reviewed-by: Chris Horn Reviewed-by: Matt Ezell Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/router.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 83d233b..476b4dd 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -1223,8 +1223,6 @@ lnet_router_checker(void *arg) cfs_block_allsigs(); - LASSERT(the_lnet.ln_rc_state == LNET_RC_STATE_RUNNING); - while (the_lnet.ln_rc_state == LNET_RC_STATE_RUNNING) { __u64 version; int cpt; @@ -1280,8 +1278,6 @@ rescan: cfs_time_seconds(1)); } - LASSERT(the_lnet.ln_rc_state == LNET_RC_STATE_STOPPING); - lnet_prune_rc_data(1); /* wait for UNLINK */ the_lnet.ln_rc_state = LNET_RC_STATE_SHUTDOWN; -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:40 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:40 -0500 Subject: [lustre-devel] [PATCH 04/40] staging: lustre: fix failure handle of create reply In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-5-git-send-email-jsimmons@infradead.org> From: Liang Zhen error handler of lnet_create_reply_msg() didn't release lnet_res_lock if lnet_msg_alloc() failed. It can be fixed by moving validation check of msg out from lock. Signed-off-by: Liang Zhen Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2745 Reviewed-on: http://review.whamcloud.com/5542 Reviewed-by: Doug Oucharek Reviewed-by: Isaac Huang Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/lib-move.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index c56de44..03fcddc 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -2160,17 +2160,17 @@ lnet_create_reply_msg(lnet_ni_t *ni, lnet_msg_t *getmsg) LASSERT(!getmsg->msg_target_is_router); LASSERT(!getmsg->msg_routing); - cpt = lnet_cpt_of_cookie(getmd->md_lh.lh_cookie); - lnet_res_lock(cpt); - - LASSERT(getmd->md_refcount > 0); - if (msg == NULL) { CERROR("%s: Dropping REPLY from %s: can't allocate msg\n", - libcfs_nid2str(ni->ni_nid), libcfs_id2str(peer_id)); + libcfs_nid2str(ni->ni_nid), libcfs_id2str(peer_id)); goto drop; } + cpt = lnet_cpt_of_cookie(getmd->md_lh.lh_cookie); + lnet_res_lock(cpt); + + LASSERT(getmd->md_refcount > 0); + if (getmd->md_threshold == 0) { CERROR("%s: Dropping REPLY from %s for inactive MD %p\n", libcfs_nid2str(ni->ni_nid), libcfs_id2str(peer_id), -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:57 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:57 -0500 Subject: [lustre-devel] [PATCH 21/40] staging: lustre: improve LNet clean up code and API In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-22-git-send-email-jsimmons@infradead.org> From: Amir Shehata This patch addresses a set of related issues: LU-5734, LU-5839, LU-5849, LU-5850. Create the local lnet_startup_lndni() API. This function starts up one LND. lnet_startup_lndnis() calls this function in a loop on every ni in the list passed in. lnet_startup_lndni() is responsible for cleaning up after itself in case of failure. It calls lnet_free_ni() if the ni fails to start. It calls lnet_shutdown_lndni() if it successfully called the lnd startup function, but fails later on. lnet_startup_lndnis() also cleans up after itself. If lnet_startup_lndni() fails then lnet_shutdown_lndnis() is called to clean up all nis that might have been started, and then free the rest of the nis on the list which have not been started yet. To facilitate the above changes lnet_dyn_del_ni() now manages the ping info. It calls lnet_shutdown_lndni(), to shutdown the NI. lnet_shutdown_lndni() is no longer an exposed API and doesn't manage the ping info, making it callable from lnet_startup_lndni() as well. There are two scenarios for calling lnet_startup_lndni() 1. from lnet_startup_lndnis() If lnet_startup_lndni() fails it requires to shutdown the ni without doing anything with the ping information as it hasn't been created yet. 2. from lnet_dyn_add_ni() As above it will shutdown the ni, and then lnet_dyn_add_ni() will take care of managing the ping info The second part of this change is to ensure that the LOLND is not added by lnet_parse_networks(), but the caller which needs to do it (IE: LNetNIInit) This change ensures that lnet_dyn_add_ni() need only check if there is only one net that's being added, if not then it frees everything, otherwise it proceeds to startup the requested net. Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5734 Reviewed-on: http://review.whamcloud.com/12658 Reviewed-by: Liang Zhen Reviewed-by: Isaac Huang Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- .../staging/lustre/include/linux/lnet/lib-lnet.h | 2 + drivers/staging/lustre/lnet/lnet/api-ni.c | 461 ++++++++++---------- drivers/staging/lustre/lnet/lnet/config.c | 14 +- 3 files changed, 245 insertions(+), 232 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index a1f94db..4c2d824 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -420,6 +420,8 @@ lnet_ni_decref(lnet_ni_t *ni) } void lnet_ni_free(lnet_ni_t *ni); +lnet_ni_t * +lnet_ni_alloc(__u32 net, struct cfs_expr_list *el, struct list_head *nilist); static inline int lnet_nid2peerhash(lnet_nid_t nid) diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index bfc1f13..e40c657 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1064,6 +1064,20 @@ lnet_ni_tq_credits(lnet_ni_t *ni) } static void +lnet_ni_unlink_locked(lnet_ni_t *ni) +{ + if (!list_empty(&ni->ni_cptlist)) { + list_del_init(&ni->ni_cptlist); + lnet_ni_decref_locked(ni, 0); + } + + /* move it to zombie list and nobody can find it anymore */ + LASSERT(!list_empty(&ni->ni_list)); + list_move(&ni->ni_list, &the_lnet.ln_nis_zombie); + lnet_ni_decref_locked(ni, 0); /* drop ln_nis' ref */ +} + +static void lnet_clear_zombies_nis_locked(void) { int i; @@ -1146,14 +1160,7 @@ lnet_shutdown_lndnis(void) while (!list_empty(&the_lnet.ln_nis)) { ni = list_entry(the_lnet.ln_nis.next, lnet_ni_t, ni_list); - /* move it to zombie list and nobody can find it anymore */ - list_move(&ni->ni_list, &the_lnet.ln_nis_zombie); - lnet_ni_decref_locked(ni, 0); /* drop ln_nis' ref */ - - if (!list_empty(&ni->ni_cptlist)) { - list_del_init(&ni->ni_cptlist); - lnet_ni_decref_locked(ni, 0); - } + lnet_ni_unlink_locked(ni); } /* Drop the cached eqwait NI. */ @@ -1186,233 +1193,196 @@ lnet_shutdown_lndnis(void) lnet_net_unlock(LNET_LOCK_EX); } -int -lnet_shutdown_lndni(__u32 net) +/* shutdown down the NI and release refcount */ +static void +lnet_shutdown_lndni(struct lnet_ni *ni) { - lnet_ping_info_t *pinfo; - lnet_handle_md_t md_handle; - lnet_ni_t *found_ni = NULL; - int ni_count; - int rc; - - if (LNET_NETTYP(net) == LOLND) - return -EINVAL; - - ni_count = lnet_get_ni_count(); - - /* create and link a new ping info, before removing the old one */ - rc = lnet_ping_info_setup(&pinfo, &md_handle, ni_count - 1, false); - if (rc != 0) - return rc; - - /* proceed with shutting down the NI */ lnet_net_lock(LNET_LOCK_EX); - - found_ni = lnet_net2ni_locked(net, 0); - if (!found_ni) { - lnet_net_unlock(LNET_LOCK_EX); - lnet_ping_md_unlink(pinfo, &md_handle); - lnet_ping_info_free(pinfo); - return -EINVAL; - } - - /* - * decrement the reference counter on found_ni which was - * incremented when we called lnet_net2ni_locked() - */ - lnet_ni_decref_locked(found_ni, 0); - /* Move ni to zombie list so nobody can find it anymore */ - list_move(&found_ni->ni_list, &the_lnet.ln_nis_zombie); - - /* Drop the lock reference for the ln_nis ref. */ - lnet_ni_decref_locked(found_ni, 0); - - if (!list_empty(&found_ni->ni_cptlist)) { - list_del_init(&found_ni->ni_cptlist); - lnet_ni_decref_locked(found_ni, 0); - } - + lnet_ni_unlink_locked(ni); lnet_net_unlock(LNET_LOCK_EX); /* Do peer table cleanup for this ni */ - lnet_peer_tables_cleanup(found_ni); + lnet_peer_tables_cleanup(ni); lnet_net_lock(LNET_LOCK_EX); lnet_clear_zombies_nis_locked(); lnet_net_unlock(LNET_LOCK_EX); - - lnet_ping_target_update(pinfo, md_handle); - - return 0; } -/* - * Callers of lnet_startup_lndnis need to clean up using - * lnet_shutdown_lndnis if startup fails - */ static int -lnet_startup_lndnis(struct list_head *nilist, __s32 peer_timeout, - __s32 peer_cr, __s32 peer_buf_cr, __s32 credits, - int *ni_count) +lnet_startup_lndni(struct lnet_ni *ni, __s32 peer_timeout, + __s32 peer_cr, __s32 peer_buf_cr, __s32 credits) { + int rc = 0; + __u32 lnd_type; lnd_t *lnd; - struct lnet_ni *ni; struct lnet_tx_queue *tq; int i; - int rc = 0; - __u32 lnd_type; - while (!list_empty(nilist)) { - ni = list_entry(nilist->next, lnet_ni_t, ni_list); - lnd_type = LNET_NETTYP(LNET_NIDNET(ni->ni_nid)); + lnd_type = LNET_NETTYP(LNET_NIDNET(ni->ni_nid)); - if (!libcfs_isknown_lnd(lnd_type)) - goto failed; - - if (lnd_type == CIBLND || - lnd_type == OPENIBLND || - lnd_type == IIBLND || - lnd_type == VIBLND) { - CERROR("LND %s obsoleted\n", - libcfs_lnd2str(lnd_type)); - goto failed; - } + LASSERT(libcfs_isknown_lnd(lnd_type)); - /* Make sure this new NI is unique. */ - lnet_net_lock(LNET_LOCK_EX); - if (!lnet_net_unique(LNET_NIDNET(ni->ni_nid), - &the_lnet.ln_nis)) { - if (lnd_type == LOLND) { - lnet_net_unlock(LNET_LOCK_EX); - list_del(&ni->ni_list); - lnet_ni_free(ni); - continue; - } + if (lnd_type == CIBLND || lnd_type == OPENIBLND || + lnd_type == IIBLND || lnd_type == VIBLND) { + CERROR("LND %s obsoleted\n", libcfs_lnd2str(lnd_type)); + goto failed0; + } - CERROR("Net %s is not unique\n", - libcfs_net2str(LNET_NIDNET(ni->ni_nid))); + /* Make sure this new NI is unique. */ + lnet_net_lock(LNET_LOCK_EX); + if (!lnet_net_unique(LNET_NIDNET(ni->ni_nid), &the_lnet.ln_nis)) { + if (lnd_type == LOLND) { lnet_net_unlock(LNET_LOCK_EX); - goto failed; + lnet_ni_free(ni); + return 0; } lnet_net_unlock(LNET_LOCK_EX); + CERROR("Net %s is not unique\n", + libcfs_net2str(LNET_NIDNET(ni->ni_nid))); + goto failed0; + } + lnet_net_unlock(LNET_LOCK_EX); + + mutex_lock(&the_lnet.ln_lnd_mutex); + lnd = lnet_find_lnd_by_type(lnd_type); + + if (!lnd) { + mutex_unlock(&the_lnet.ln_lnd_mutex); + rc = request_module("%s", libcfs_lnd2modname(lnd_type)); mutex_lock(&the_lnet.ln_lnd_mutex); - lnd = lnet_find_lnd_by_type(lnd_type); + lnd = lnet_find_lnd_by_type(lnd_type); if (lnd == NULL) { mutex_unlock(&the_lnet.ln_lnd_mutex); - rc = request_module("%s", - libcfs_lnd2modname(lnd_type)); - mutex_lock(&the_lnet.ln_lnd_mutex); - - lnd = lnet_find_lnd_by_type(lnd_type); - if (lnd == NULL) { - mutex_unlock(&the_lnet.ln_lnd_mutex); - CERROR("Can't load LND %s, module %s, rc=%d\n", - libcfs_lnd2str(lnd_type), - libcfs_lnd2modname(lnd_type), rc); - goto failed; - } + CERROR("Can't load LND %s, module %s, rc=%d\n", + libcfs_lnd2str(lnd_type), + libcfs_lnd2modname(lnd_type), rc); + goto failed0; } + } + + lnet_net_lock(LNET_LOCK_EX); + lnd->lnd_refcount++; + lnet_net_unlock(LNET_LOCK_EX); + + ni->ni_lnd = lnd; + rc = lnd->lnd_startup(ni); + + mutex_unlock(&the_lnet.ln_lnd_mutex); + + if (rc != 0) { + LCONSOLE_ERROR_MSG(0x105, "Error %d starting up LNI %s\n", + rc, libcfs_lnd2str(lnd->lnd_type)); lnet_net_lock(LNET_LOCK_EX); - lnd->lnd_refcount++; + lnd->lnd_refcount--; lnet_net_unlock(LNET_LOCK_EX); + goto failed0; + } - ni->ni_lnd = lnd; + /* + * If given some LND tunable parameters, parse those now to + * override the values in the NI structure. + */ + if (peer_buf_cr >= 0) + ni->ni_peerrtrcredits = peer_buf_cr; + if (peer_timeout >= 0) + ni->ni_peertimeout = peer_timeout; + /* + * TODO + * Note: For now, don't allow the user to change + * peertxcredits as this number is used in the + * IB LND to control queue depth. + * if (peer_cr != -1) + * ni->ni_peertxcredits = peer_cr; + */ + if (credits >= 0) + ni->ni_maxtxcredits = credits; - rc = (lnd->lnd_startup)(ni); + LASSERT(ni->ni_peertimeout <= 0 || lnd->lnd_query); - mutex_unlock(&the_lnet.ln_lnd_mutex); + lnet_net_lock(LNET_LOCK_EX); + /* refcount for ln_nis */ + lnet_ni_addref_locked(ni, 0); + list_add_tail(&ni->ni_list, &the_lnet.ln_nis); + if (ni->ni_cpts) { + lnet_ni_addref_locked(ni, 0); + list_add_tail(&ni->ni_cptlist, &the_lnet.ln_nis_cpt); + } - if (rc != 0) { - LCONSOLE_ERROR_MSG(0x105, "Error %d starting up LNI %s\n", - rc, libcfs_lnd2str(lnd->lnd_type)); - lnet_net_lock(LNET_LOCK_EX); - lnd->lnd_refcount--; - lnet_net_unlock(LNET_LOCK_EX); - goto failed; - } + lnet_net_unlock(LNET_LOCK_EX); + if (lnd->lnd_type == LOLND) { + lnet_ni_addref(ni); + LASSERT(!the_lnet.ln_loni); + the_lnet.ln_loni = ni; + return 0; + } + + if (ni->ni_peertxcredits == 0 || ni->ni_maxtxcredits == 0) { + LCONSOLE_ERROR_MSG(0x107, "LNI %s has no %scredits\n", + libcfs_lnd2str(lnd->lnd_type), + ni->ni_peertxcredits == 0 ? + "" : "per-peer "); /* - * If given some LND tunable parameters, parse those now to - * override the values in the NI structure. - */ - if (peer_buf_cr >= 0) - ni->ni_peerrtrcredits = peer_buf_cr; - if (peer_timeout >= 0) - ni->ni_peertimeout = peer_timeout; - /* - * TODO - * Note: For now, don't allow the user to change - * peertxcredits as this number is used in the - * IB LND to control queue depth. - * if (peer_cr != -1) - * ni->ni_peertxcredits = peer_cr; + * shutdown the NI since if we get here then it must've already + * been started */ - if (credits >= 0) - ni->ni_maxtxcredits = credits; + lnet_shutdown_lndni(ni); + return -EINVAL; + } - LASSERT(ni->ni_peertimeout <= 0 || lnd->lnd_query != NULL); + cfs_percpt_for_each(tq, i, ni->ni_tx_queues) { + tq->tq_credits_min = + tq->tq_credits_max = + tq->tq_credits = lnet_ni_tq_credits(ni); + } - list_del(&ni->ni_list); + CDEBUG(D_LNI, "Added LNI %s [%d/%d/%d/%d]\n", + libcfs_nid2str(ni->ni_nid), ni->ni_peertxcredits, + lnet_ni_tq_credits(ni) * LNET_CPT_NUMBER, + ni->ni_peerrtrcredits, ni->ni_peertimeout); - lnet_net_lock(LNET_LOCK_EX); - /* refcount for ln_nis */ - lnet_ni_addref_locked(ni, 0); - list_add_tail(&ni->ni_list, &the_lnet.ln_nis); - if (ni->ni_cpts != NULL) { - list_add_tail(&ni->ni_cptlist, - &the_lnet.ln_nis_cpt); - lnet_ni_addref_locked(ni, 0); - } - - lnet_net_unlock(LNET_LOCK_EX); + return 0; +failed0: + lnet_ni_free(ni); + return -EINVAL; +} - /* increment the ni_count here to account for the LOLND as - * well. If we increment past this point then the number - * of count will be missing the LOLND, and then ping and - * will not report the LOLND - */ - if (ni_count) - (*ni_count)++; +static int +lnet_startup_lndnis(struct list_head *nilist) +{ + struct lnet_ni *ni; + int rc; + int lnd_type; + int ni_count = 0; - if (lnd->lnd_type == LOLND) { - lnet_ni_addref(ni); - LASSERT(the_lnet.ln_loni == NULL); - the_lnet.ln_loni = ni; - continue; - } + while (!list_empty(nilist)) { + ni = list_entry(nilist->next, lnet_ni_t, ni_list); + list_del(&ni->ni_list); + rc = lnet_startup_lndni(ni, -1, -1, -1, -1); - if (ni->ni_peertxcredits == 0 || - ni->ni_maxtxcredits == 0) { - LCONSOLE_ERROR_MSG(0x107, "LNI %s has no %scredits\n", - libcfs_lnd2str(lnd->lnd_type), - ni->ni_peertxcredits == 0 ? - "" : "per-peer "); + if (rc < 0) goto failed; - } - cfs_percpt_for_each(tq, i, ni->ni_tx_queues) { - tq->tq_credits_min = - tq->tq_credits_max = - tq->tq_credits = lnet_ni_tq_credits(ni); - } + ni_count++; + } - CDEBUG(D_LNI, "Added LNI %s [%d/%d/%d/%d]\n", - libcfs_nid2str(ni->ni_nid), ni->ni_peertxcredits, - lnet_ni_tq_credits(ni) * LNET_CPT_NUMBER, - ni->ni_peerrtrcredits, ni->ni_peertimeout); + if (the_lnet.ln_eq_waitni && ni_count > 1) { + lnd_type = the_lnet.ln_eq_waitni->ni_lnd->lnd_type; + LCONSOLE_ERROR_MSG(0x109, "LND %s can only run single-network\n", + libcfs_lnd2str(lnd_type)); + rc = -EINVAL; + goto failed; } - return 0; + return ni_count; failed: - while (!list_empty(nilist)) { - ni = list_entry(nilist->next, lnet_ni_t, ni_list); - list_del(&ni->ni_list); - lnet_ni_free(ni); - } - return -EINVAL; + lnet_shutdown_lndnis(); + + return rc; } /** @@ -1525,10 +1495,8 @@ int LNetNIInit(lnet_pid_t requested_pid) { int im_a_router = 0; - int rc; - int ni_count = 0; - int lnd_type; - struct lnet_ni *ni; + int rc, rc2; + int ni_count; lnet_ping_info_t *pinfo; lnet_handle_md_t md_handle; struct list_head net_head; @@ -1547,37 +1515,50 @@ LNetNIInit(lnet_pid_t requested_pid) } rc = lnet_prepare(requested_pid); - if (rc != 0) - goto failed0; + if (rc != 0) { + mutex_unlock(&the_lnet.ln_api_mutex); + return rc; + } - rc = lnet_parse_networks(&net_head, - !the_lnet.ln_nis_from_mod_params ? - lnet_get_networks() : ""); - if (rc < 0) - goto failed1; + /* Add in the loopback network */ + if (!lnet_ni_alloc(LNET_MKNET(LOLND, 0), NULL, &net_head)) { + rc = -ENOMEM; + goto failed0; + } - rc = lnet_startup_lndnis(&net_head, -1, -1, -1, -1, &ni_count); - if (rc != 0) - goto failed2; + /* + * If LNet is being initialized via DLC it is possible + * that the user requests not to load module parameters (ones which + * are supported by DLC) on initialization. Therefore, make sure not + * to load networks, routes and forwarding from module parameters + * in this case. On cleanup in case of failure only clean up + * routes if it has been loaded + */ + if (!the_lnet.ln_nis_from_mod_params) { + rc = lnet_parse_networks(&net_head, lnet_get_networks()); + if (rc < 0) + goto failed0; + } - if (the_lnet.ln_eq_waitni && ni_count > 1) { - lnd_type = the_lnet.ln_eq_waitni->ni_lnd->lnd_type; - LCONSOLE_ERROR_MSG(0x109, "LND %s can only run single-network\n", - libcfs_lnd2str(lnd_type)); - goto failed2; + ni_count = lnet_startup_lndnis(&net_head); + if (ni_count < 0) { + rc = ni_count; + goto failed0; } - rc = lnet_parse_routes(lnet_get_routes(), &im_a_router); - if (rc != 0) - goto failed2; + if (!the_lnet.ln_nis_from_mod_params) { + rc = lnet_parse_routes(lnet_get_routes(), &im_a_router); + if (rc != 0) + goto failed1; - rc = lnet_check_routes(); - if (rc != 0) - goto failed2; + rc = lnet_check_routes(); + if (rc != 0) + goto failed2; - rc = lnet_rtrpools_alloc(im_a_router); - if (rc != 0) - goto failed2; + rc = lnet_rtrpools_alloc(im_a_router); + if (rc != 0) + goto failed2; + } rc = lnet_acceptor_start(); if (rc != 0) @@ -1603,22 +1584,25 @@ LNetNIInit(lnet_pid_t requested_pid) return 0; failed4: - the_lnet.ln_refcount = 0; lnet_ping_md_unlink(pinfo, &md_handle); lnet_ping_info_free(pinfo); + rc2 = LNetEQFree(the_lnet.ln_ping_target_eq); + LASSERT(rc2 == 0); failed3: + the_lnet.ln_refcount = 0; lnet_acceptor_stop(); - rc = LNetEQFree(the_lnet.ln_ping_target_eq); - LASSERT(rc == 0); failed2: - lnet_destroy_routes(); - lnet_shutdown_lndnis(); + if (!the_lnet.ln_nis_from_mod_params) + lnet_destroy_routes(); failed1: - lnet_unprepare(); + lnet_shutdown_lndnis(); failed0: + lnet_unprepare(); LASSERT(rc < 0); mutex_unlock(&the_lnet.ln_api_mutex); while (!list_empty(&net_head)) { + struct lnet_ni *ni; + ni = list_entry(net_head.next, struct lnet_ni, ni_list); list_del_init(&ni->ni_list); lnet_ni_free(ni); @@ -1769,8 +1753,8 @@ lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets, /* Create a ni structure for the network string */ rc = lnet_parse_networks(&net_head, nets); - if (rc < 0) - return rc; + if (rc <= 0) + return rc == 0 ? -EINVAL : rc; mutex_lock(&the_lnet.ln_api_mutex); @@ -1784,8 +1768,11 @@ lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets, if (rc != 0) goto failed0; - rc = lnet_startup_lndnis(&net_head, peer_timeout, peer_cr, - peer_buf_cr, credits, NULL); + ni = list_entry(net_head.next, struct lnet_ni, ni_list); + list_del_init(&ni->ni_list); + + rc = lnet_startup_lndni(ni, peer_timeout, peer_cr, + peer_buf_cr, credits); if (rc != 0) goto failed1; @@ -1810,10 +1797,38 @@ failed0: int lnet_dyn_del_ni(__u32 net) { + lnet_ni_t *ni; + lnet_ping_info_t *pinfo; + lnet_handle_md_t md_handle; int rc; + /* don't allow userspace to shutdown the LOLND */ + if (LNET_NETTYP(net) == LOLND) + return -EINVAL; + mutex_lock(&the_lnet.ln_api_mutex); - rc = lnet_shutdown_lndni(net); + /* create and link a new ping info, before removing the old one */ + rc = lnet_ping_info_setup(&pinfo, &md_handle, + lnet_get_ni_count() - 1, false); + if (rc != 0) + goto out; + + ni = lnet_net2ni(net); + if (!ni) { + rc = -EINVAL; + goto failed; + } + + /* decrement the reference counter taken by lnet_net2ni() */ + lnet_ni_decref_locked(ni, 0); + + lnet_shutdown_lndni(ni); + lnet_ping_target_update(pinfo, md_handle); + goto out; +failed: + lnet_ping_md_unlink(pinfo, &md_handle); + lnet_ping_info_free(pinfo); +out: mutex_unlock(&the_lnet.ln_api_mutex); return rc; diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c index d1e0217..7b7412b 100644 --- a/drivers/staging/lustre/lnet/lnet/config.c +++ b/drivers/staging/lustre/lnet/lnet/config.c @@ -114,7 +114,7 @@ lnet_ni_free(struct lnet_ni *ni) LIBCFS_FREE(ni, sizeof(*ni)); } -static lnet_ni_t * +lnet_ni_t * lnet_ni_alloc(__u32 net, struct cfs_expr_list *el, struct list_head *nilist) { struct lnet_tx_queue *tq; @@ -191,6 +191,7 @@ lnet_parse_networks(struct list_head *nilist, char *networks) struct lnet_ni *ni; __u32 net; int nnets = 0; + struct list_head *temp_node; if (!networks) { CERROR("networks string is undefined\n"); @@ -215,11 +216,6 @@ lnet_parse_networks(struct list_head *nilist, char *networks) memcpy(tokens, networks, tokensize); str = tmp = tokens; - /* Add in the loopback network */ - ni = lnet_ni_alloc(LNET_MKNET(LOLND, 0), NULL, nilist); - if (ni == NULL) - goto failed; - while (str != NULL && *str != 0) { char *comma = strchr(str, ','); char *bracket = strchr(str, '('); @@ -292,7 +288,6 @@ lnet_parse_networks(struct list_head *nilist, char *networks) goto failed_syntax; } - nnets++; ni = lnet_ni_alloc(net, el, nilist); if (ni == NULL) goto failed; @@ -370,10 +365,11 @@ lnet_parse_networks(struct list_head *nilist, char *networks) } } - LASSERT(!list_empty(nilist)); + list_for_each(temp_node, nilist) + nnets++; LIBCFS_FREE(tokens, tokensize); - return 0; + return nnets; failed_syntax: lnet_syntax("networks", networks, (int)(tmp - tokens), strlen(tmp)); -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:50 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:50 -0500 Subject: [lustre-devel] [PATCH 14/40] staging: lustre: fix crash due to NULL networks string In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-15-git-send-email-jsimmons@infradead.org> From: Amir Shehata If there is an invalid networks or ip2nets lnet_parse_networks() gets called with a NULL 'network' string parameter lnet_parse_networks() needs to sanitize its input string now that it's being called from multiple places. Instead, check for a NULL string everytime the function is called, which reduces the probability of errors with other code modifications. Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5540 Reviewed-on: http://review.whamcloud.com/11626 Reviewed-by: Isaac Huang Reviewed-by: Doug Oucharek Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/api-ni.c | 5 +---- drivers/staging/lustre/lnet/lnet/config.c | 9 ++++++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 165345c..cc87900 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1524,7 +1524,6 @@ LNetNIInit(lnet_pid_t requested_pid) lnet_ping_info_t *pinfo; lnet_handle_md_t md_handle; struct list_head net_head; - char *nets; INIT_LIST_HEAD(&net_head); @@ -1539,13 +1538,11 @@ LNetNIInit(lnet_pid_t requested_pid) return rc; } - nets = lnet_get_networks(); - rc = lnet_prepare(requested_pid); if (rc != 0) goto failed0; - rc = lnet_parse_networks(&net_head, nets); + rc = lnet_parse_networks(&net_head, lnet_get_networks()); if (rc < 0) goto failed1; diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c index 1c7ad7c..d1e0217 100644 --- a/drivers/staging/lustre/lnet/lnet/config.c +++ b/drivers/staging/lustre/lnet/lnet/config.c @@ -184,7 +184,7 @@ int lnet_parse_networks(struct list_head *nilist, char *networks) { struct cfs_expr_list *el = NULL; - int tokensize = strlen(networks) + 1; + int tokensize; char *tokens; char *str; char *tmp; @@ -192,6 +192,11 @@ lnet_parse_networks(struct list_head *nilist, char *networks) __u32 net; int nnets = 0; + if (!networks) { + CERROR("networks string is undefined\n"); + return -EINVAL; + } + if (strlen(networks) > LNET_SINGLE_TEXTBUF_NOB) { /* _WAY_ conservative */ LCONSOLE_ERROR_MSG(0x112, @@ -199,6 +204,8 @@ lnet_parse_networks(struct list_head *nilist, char *networks) return -EINVAL; } + tokensize = strlen(networks) + 1; + LIBCFS_ALLOC(tokens, tokensize); if (tokens == NULL) { CERROR("Can't allocate net tokens\n"); -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:59 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:59 -0500 Subject: [lustre-devel] [PATCH 23/40] staging: lustre: return appropriate errno when adding route In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-24-git-send-email-jsimmons@infradead.org> From: Amir Shehata When adding route it ignored specific scenarios, namely: 1. route already exists 2. route is on a local net 3. route is unreacheable This patch returns the appropriate return codes from the lower level function lnet_add_route(), and then ignores the above case from the calling function, lnet_parse_route(). This is needed so we don't halt processing routes in the module parameters. However, we can now add routes dynamically, and it should be returned to the user whether adding the requested route succeeded or failed. In userspace it is determined whether to continue adding routes or to halt processing. Currently "lnetctl import < config" continues adding the rest of the configuration and reports at the end which operations passed and which ones failed. Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6045 Reviewed-on: http://review.whamcloud.com/13116 Reviewed-by: James Simmons Reviewed-by: Doug Oucharek Reviewed-by: Isaac Huang Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/config.c | 2 +- drivers/staging/lustre/lnet/lnet/router.c | 11 +++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c index 7b7412b..1028195 100644 --- a/drivers/staging/lustre/lnet/lnet/config.c +++ b/drivers/staging/lustre/lnet/lnet/config.c @@ -771,7 +771,7 @@ lnet_parse_route(char *str, int *im_a_router) } rc = lnet_add_route(net, hops, nid, priority); - if (rc != 0) { + if (rc != 0 && rc != -EEXIST && rc != -EHOSTUNREACH) { CERROR("Can't create route to %s via %s\n", libcfs_net2str(net), libcfs_nid2str(nid)); diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 1f5a4b1..9271be6 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -315,7 +315,7 @@ lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t gateway, return -EINVAL; if (lnet_islocalnet(net)) /* it's a local network */ - return 0; /* ignore the route entry */ + return -EEXIST; /* Assume net, route, all new */ LIBCFS_ALLOC(route, sizeof(*route)); @@ -346,7 +346,7 @@ lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t gateway, LIBCFS_FREE(rnet, sizeof(*rnet)); if (rc == -EHOSTUNREACH) /* gateway is not on a local net */ - return 0; /* ignore the route entry */ + return rc; /* ignore the route entry */ CERROR("Error %d creating route %s %d %s\n", rc, libcfs_net2str(net), hops, libcfs_nid2str(gateway)); @@ -394,14 +394,17 @@ lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t gateway, /* -1 for notify or !add_route */ lnet_peer_decref_locked(route->lr_gateway); lnet_net_unlock(LNET_LOCK_EX); + rc = 0; - if (!add_route) + if (!add_route) { + rc = -EEXIST; LIBCFS_FREE(route, sizeof(*route)); + } if (rnet != rnet2) LIBCFS_FREE(rnet, sizeof(*rnet)); - return 0; + return rc; } int -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:05 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:05 -0500 Subject: [lustre-devel] [PATCH 29/40] staging: lustre: handle lnet_check_routes() errors In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-30-git-send-email-jsimmons@infradead.org> From: Amir Shehata After adding a route, lnet_check_routes() is called to ensure that the route added doesn't invalidate the routing configuration. If lnet_check_routes() fails then the route just added, which caused the current configuration to be invalidated is deleted, and an error is returned to the user. Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6218 Reviewed-on: http://review.whamcloud.com/13445 Reviewed-by: Liang Zhen Reviewed-by: Doug Oucharek Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/api-ni.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index ed167c8..b119c6c 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1910,8 +1910,14 @@ LNetCtl(unsigned int cmd, void *arg) config->cfg_nid, config->cfg_config_u.cfg_route. rtr_priority); + if (rc == 0) { + rc = lnet_check_routes(); + if (rc != 0) + lnet_del_route(config->cfg_net, + config->cfg_nid); + } mutex_unlock(&the_lnet.ln_api_mutex); - return (rc != 0) ? rc : lnet_check_routes(); + return rc; case IOC_LIBCFS_DEL_ROUTE: config = arg; -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:06 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:06 -0500 Subject: [lustre-devel] [PATCH 30/40] staging: lustre: improvement to router checker In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-31-git-send-email-jsimmons@infradead.org> From: Amir Shehata This patch starts router checker thread all the time. The router checker only checks routes by ping if live_router_check_interval or dead_router_check_interval are set to something other than 0, and there are routes configured. If these conditions are not met the router checker sleeps until woken up when a route is added. It is also woken up whenever the RC is being stopped to ensure the thread doesn't hang. In the future when DLC starts configuring the live and dead router_check_interval parameters, then by manipulating them the router checker can be turned on and off by the user. Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6003 Reviewed-on: http://review.whamcloud.com/13035 Reviewed-by: Liang Zhen Reviewed-by: Doug Oucharek Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- .../staging/lustre/include/linux/lnet/lib-types.h | 7 +++ drivers/staging/lustre/lnet/lnet/api-ni.c | 1 + drivers/staging/lustre/lnet/lnet/router.c | 51 +++++++++++++++++--- 3 files changed, 52 insertions(+), 7 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index 3282782..574de55 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -619,6 +619,13 @@ typedef struct { */ bool ln_nis_from_mod_params; + /* + * waitq for router checker. As long as there are no routes in + * the list, the router checker will sleep on this queue. when + * routes are added the thread will wake up + */ + wait_queue_head_t ln_rc_waitq; + } lnet_t; #endif diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index b119c6c..09656a1 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -99,6 +99,7 @@ lnet_init_locks(void) { spin_lock_init(&the_lnet.ln_eq_wait_lock); init_waitqueue_head(&the_lnet.ln_eq_waitq); + init_waitqueue_head(&the_lnet.ln_rc_waitq); mutex_init(&the_lnet.ln_lnd_mutex); mutex_init(&the_lnet.ln_api_mutex); } diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 9271be6..b4ac670 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -404,6 +404,9 @@ lnet_add_route(__u32 net, unsigned int hops, lnet_nid_t gateway, if (rnet != rnet2) LIBCFS_FREE(rnet, sizeof(*rnet)); + /* indicate to startup the router checker if configured */ + wake_up(&the_lnet.ln_rc_waitq); + return rc; } @@ -1053,11 +1056,6 @@ lnet_router_checker_start(void) return -EINVAL; } - if (!the_lnet.ln_routing && - live_router_check_interval <= 0 && - dead_router_check_interval <= 0) - return 0; - sema_init(&the_lnet.ln_rc_signal, 0); /* EQ size doesn't matter; the callback is guaranteed to get every * event */ @@ -1102,6 +1100,8 @@ lnet_router_checker_stop(void) LASSERT(the_lnet.ln_rc_state == LNET_RC_STATE_RUNNING); the_lnet.ln_rc_state = LNET_RC_STATE_STOPPING; + /* wakeup the RC thread if it's sleeping */ + wake_up(&the_lnet.ln_rc_waitq); /* block until event callback signals exit */ down(&the_lnet.ln_rc_signal); @@ -1192,6 +1192,33 @@ lnet_prune_rc_data(int wait_unlink) lnet_net_unlock(LNET_LOCK_EX); } +/* + * This function is called to check if the RC should block indefinitely. + * It's called from lnet_router_checker() as well as being passed to + * wait_event_interruptible() to avoid the lost wake_up problem. + * + * When it's called from wait_event_interruptible() it is necessary to + * also not sleep if the rc state is not running to avoid a deadlock + * when the system is shutting down + */ +static inline bool +lnet_router_checker_active(void) +{ + if (the_lnet.ln_rc_state != LNET_RC_STATE_RUNNING) + return true; + + /* + * Router Checker thread needs to run when routing is enabled in + * order to call lnet_update_ni_status_locked() + */ + if (the_lnet.ln_routing) + return true; + + return !list_empty(&the_lnet.ln_routers) && + (live_router_check_interval > 0 || + dead_router_check_interval > 0); +} + static int lnet_router_checker(void *arg) { @@ -1243,8 +1270,18 @@ rescan: /* Call schedule_timeout() here always adds 1 to load average * because kernel counts # active tasks as nr_running * + nr_uninterruptible. */ - set_current_state(TASK_INTERRUPTIBLE); - schedule_timeout(cfs_time_seconds(1)); + /* + * if there are any routes then wakeup every second. If + * there are no routes then sleep indefinitely until woken + * up by a user adding a route + */ + if (!lnet_router_checker_active()) + wait_event_interruptible(the_lnet.ln_rc_waitq, + lnet_router_checker_active()); + else + wait_event_interruptible_timeout(the_lnet.ln_rc_waitq, + false, + cfs_time_seconds(1)); } LASSERT(the_lnet.ln_rc_state == LNET_RC_STATE_STOPPING); -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:14 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:14 -0500 Subject: [lustre-devel] [PATCH 38/40] staging: lustre: Allocate the correct number of rtr buffers In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-39-git-send-email-jsimmons@infradead.org> From: Amir Shehata This patch ensures that the correct number of router buffers are allocated. It keeps a count that keeps track of the number of buffers allocated. Another count keeps the number of buffers requested. The number of buffers allocated is set when creating new buffers and reduced when buffers are freed. The number of requested buffer is set when the buffers are allocated and is checked when credits are returned to determine whether the buffer should be freed or kept. In lnet_rtrpool_adjust_bufs() grab lnet_net_lock() before using rbp_nbuffers to ensure that it doesn't change by lnet_return_rx_credits_locked() during the process of allocating new buffers. All other access to rbp_nbuffers is already being protected by lnet_net_lock(). This avoids the case where we allocate less than the desired number of buffers. Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6122 Reviewed-on: http://review.whamcloud.com/13519 Reviewed-by: Jinshan Xiong Reviewed-by: Doug Oucharek Reviewed-by: Oleg Drokin --- .../staging/lustre/include/linux/lnet/lib-types.h | 5 ++- drivers/staging/lustre/lnet/lnet/lib-move.c | 3 +- drivers/staging/lustre/lnet/lnet/router.c | 32 +++++++++++++++----- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index 695b5be..24b3c1a 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -386,7 +386,10 @@ typedef struct { struct list_head rbp_msgs; /* messages blocking for a buffer */ int rbp_npages; /* # pages in each buffer */ - int rbp_nbuffers; /* # buffers */ + /* requested number of buffers */ + int rbp_req_nbuffers; + /* # buffers actually allocated */ + int rbp_nbuffers; int rbp_credits; /* # free buffers / blocked messages */ int rbp_mincredits; /* low water mark */ diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index 430cb9a..21a7c6f 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -1101,9 +1101,10 @@ lnet_return_rx_credits_locked(lnet_msg_t *msg) * buffers in this pool. Make sure we never put back * more buffers than the stated number. */ - if (rbp->rbp_credits >= rbp->rbp_nbuffers) { + if (unlikely(rbp->rbp_credits >= rbp->rbp_req_nbuffers)) { /* Discard this buffer so we don't have too many. */ lnet_destroy_rtrbuf(rb, rbp->rbp_npages); + rbp->rbp_nbuffers--; } else { list_add(&rb->rb_list, &rbp->rbp_bufs); rbp->rbp_credits++; diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 91f3f09..35cfced 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -1352,6 +1352,7 @@ lnet_rtrpool_free_bufs(lnet_rtrbufpool_t *rbp, int cpt) lnet_net_lock(cpt); lnet_drop_routed_msgs_locked(&rbp->rbp_msgs, cpt); list_splice_init(&rbp->rbp_bufs, &tmp); + rbp->rbp_req_nbuffers = 0; rbp->rbp_nbuffers = 0; rbp->rbp_credits = 0; rbp->rbp_mincredits = 0; @@ -1372,20 +1373,33 @@ lnet_rtrpool_adjust_bufs(lnet_rtrbufpool_t *rbp, int nbufs, int cpt) lnet_rtrbuf_t *rb; int num_rb; int num_buffers = 0; + int old_req_nbufs; int npages = rbp->rbp_npages; + lnet_net_lock(cpt); /* * If we are called for less buffers than already in the pool, we - * just lower the nbuffers number and excess buffers will be + * just lower the req_nbuffers number and excess buffers will be * thrown away as they are returned to the free list. Credits * then get adjusted as well. + * If we already have enough buffers allocated to serve the + * increase requested, then we can treat that the same way as we + * do the decrease. */ - if (nbufs <= rbp->rbp_nbuffers) { - lnet_net_lock(cpt); - rbp->rbp_nbuffers = nbufs; + num_rb = nbufs - rbp->rbp_nbuffers; + if (nbufs <= rbp->rbp_req_nbuffers || num_rb <= 0) { + rbp->rbp_req_nbuffers = nbufs; lnet_net_unlock(cpt); return 0; } + /* + * store the older value of rbp_req_nbuffers and then set it to + * the new request to prevent lnet_return_rx_credits_locked() from + * freeing buffers that we need to keep around + */ + old_req_nbufs = rbp->rbp_req_nbuffers; + rbp->rbp_req_nbuffers = nbufs; + lnet_net_unlock(cpt); INIT_LIST_HEAD(&rb_list); @@ -1394,19 +1408,21 @@ lnet_rtrpool_adjust_bufs(lnet_rtrbufpool_t *rbp, int nbufs, int cpt) * allocated successfully then join this list to the rbp buffer * list. If not then free all allocated buffers. */ - num_rb = rbp->rbp_nbuffers; - - while (num_rb < nbufs) { + while (num_rb-- > 0) { rb = lnet_new_rtrbuf(rbp, cpt); if (rb == NULL) { CERROR("Failed to allocate %d route bufs of %d pages\n", nbufs, npages); + + lnet_net_lock(cpt); + rbp->rbp_req_nbuffers = old_req_nbufs; + lnet_net_unlock(cpt); + goto failed; } list_add(&rb->rb_list, &rb_list); num_buffers++; - num_rb++; } lnet_net_lock(cpt); -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:49 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:49 -0500 Subject: [lustre-devel] [PATCH 13/40] staging: lustre: Dynamic LNet Configuration (DLC) show command In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-14-git-send-email-jsimmons@infradead.org> From: Amir Shehata This is the fifth patch of a set of patches that enables DLC. This patch adds the new structures which will be used in the IOCTL communication. It also added a set of show operations to show buffers, networks, statistics and peer information. Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2456 Change-Id: I96e5cb3dcf07289c6cd1deb46f4acb3c263ae21e Reviewed-on: http://review.whamcloud.com/8022 Reviewed-by: John L. Hammond Reviewed-by: Doug Oucharek Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- .../lustre/include/linux/libcfs/libcfs_ioctl.h | 44 +++++++- .../staging/lustre/include/linux/lnet/lib-dlc.h | 118 ++++++++++++++++++++ .../staging/lustre/include/linux/lnet/lib-lnet.h | 5 + drivers/staging/lustre/lnet/lnet/api-ni.c | 47 +++++++- drivers/staging/lustre/lnet/lnet/module.c | 4 + drivers/staging/lustre/lnet/lnet/peer.c | 61 ++++++++++ .../lustre/lustre/libcfs/linux/linux-module.c | 3 +- drivers/staging/lustre/lustre/libcfs/module.c | 15 ++- 8 files changed, 282 insertions(+), 15 deletions(-) create mode 100644 drivers/staging/lustre/include/linux/lnet/lib-dlc.h diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h index e14788c..f24330d 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h @@ -41,7 +41,8 @@ #ifndef __LIBCFS_IOCTL_H__ #define __LIBCFS_IOCTL_H__ -#define LIBCFS_IOCTL_VERSION 0x0001000a +#define LIBCFS_IOCTL_VERSION 0x0001000a +#define LIBCFS_IOCTL_VERSION2 0x0001000b struct libcfs_ioctl_hdr { __u32 ioc_len; @@ -87,6 +88,13 @@ do { \ data.ioc_hdr.ioc_len = sizeof(data); \ } while (0) +#define LIBCFS_IOC_INIT_V2(data, hdr) \ +do { \ + memset(&(data), 0, sizeof(data)); \ + (data).hdr.ioc_version = LIBCFS_IOCTL_VERSION2; \ + (data).hdr.ioc_len = sizeof(data); \ +} while (0) + struct libcfs_ioctl_handler { struct list_head item; int (*handle_ioctl)(unsigned int cmd, struct libcfs_ioctl_hdr *hdr); @@ -112,9 +120,6 @@ struct libcfs_ioctl_handler { /* lnet ioctls */ #define IOC_LIBCFS_GET_NI _IOWR('e', 50, long) #define IOC_LIBCFS_FAIL_NID _IOWR('e', 51, long) -#define IOC_LIBCFS_ADD_ROUTE _IOWR('e', 52, long) -#define IOC_LIBCFS_DEL_ROUTE _IOWR('e', 53, long) -#define IOC_LIBCFS_GET_ROUTE _IOWR('e', 54, long) #define IOC_LIBCFS_NOTIFY_ROUTER _IOWR('e', 55, long) #define IOC_LIBCFS_UNCONFIGURE _IOWR('e', 56, long) #define IOC_LIBCFS_PORTALS_COMPATIBILITY _IOWR('e', 57, long) @@ -137,7 +142,36 @@ struct libcfs_ioctl_handler { #define IOC_LIBCFS_DEL_INTERFACE _IOWR('e', 79, long) #define IOC_LIBCFS_GET_INTERFACE _IOWR('e', 80, long) -#define IOC_LIBCFS_MAX_NR 80 +/* + * DLC Specific IOCTL numbers. + * In order to maintain backward compatibility with any possible external + * tools which might be accessing the IOCTL numbers, a new group of IOCTL + * number have been allocated. + */ +#define IOCTL_CONFIG_SIZE struct lnet_ioctl_config_data +#define IOC_LIBCFS_ADD_ROUTE _IOWR(IOC_LIBCFS_TYPE, 81, \ + IOCTL_CONFIG_SIZE) +#define IOC_LIBCFS_DEL_ROUTE _IOWR(IOC_LIBCFS_TYPE, 82, \ + IOCTL_CONFIG_SIZE) +#define IOC_LIBCFS_GET_ROUTE _IOWR(IOC_LIBCFS_TYPE, 83, \ + IOCTL_CONFIG_SIZE) +#define IOC_LIBCFS_ADD_NET _IOWR(IOC_LIBCFS_TYPE, 84, \ + IOCTL_CONFIG_SIZE) +#define IOC_LIBCFS_DEL_NET _IOWR(IOC_LIBCFS_TYPE, 85, \ + IOCTL_CONFIG_SIZE) +#define IOC_LIBCFS_GET_NET _IOWR(IOC_LIBCFS_TYPE, 86, \ + IOCTL_CONFIG_SIZE) +#define IOC_LIBCFS_CONFIG_RTR _IOWR(IOC_LIBCFS_TYPE, 87, \ + IOCTL_CONFIG_SIZE) +#define IOC_LIBCFS_ADD_BUF _IOWR(IOC_LIBCFS_TYPE, 88, \ + IOCTL_CONFIG_SIZE) +#define IOC_LIBCFS_GET_BUF _IOWR(IOC_LIBCFS_TYPE, 89, \ + IOCTL_CONFIG_SIZE) +#define IOC_LIBCFS_GET_PEER_INFO _IOWR(IOC_LIBCFS_TYPE, 90, \ + IOCTL_CONFIG_SIZE) +#define IOC_LIBCFS_GET_LNET_STATS _IOWR(IOC_LIBCFS_TYPE, 91, \ + IOCTL_CONFIG_SIZE) +#define IOC_LIBCFS_MAX_NR 91 static inline int libcfs_ioctl_packlen(struct libcfs_ioctl_data *data) { diff --git a/drivers/staging/lustre/include/linux/lnet/lib-dlc.h b/drivers/staging/lustre/include/linux/lnet/lib-dlc.h new file mode 100644 index 0000000..b6a2e91 --- /dev/null +++ b/drivers/staging/lustre/include/linux/lnet/lib-dlc.h @@ -0,0 +1,118 @@ +/* + * GPL HEADER START + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 only, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License version 2 for more details (a copy is included + * in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU General Public License + * version 2 along with this program; If not, see + * http://www.gnu.org/licenses/gpl-2.0.html + * + * GPL HEADER END + * + * Contributers: + * Amir Shehata + */ + +#ifndef LNET_DLC_H +#define LNET_DLC_H + +#include "../libcfs/libcfs_ioctl.h" +#include "types.h" + +#define MAX_NUM_SHOW_ENTRIES 32 +#define LNET_MAX_STR_LEN 128 +#define LNET_MAX_SHOW_NUM_CPT 128 + +struct lnet_ioctl_net_config { + char ni_interfaces[LNET_MAX_INTERFACES][LNET_MAX_STR_LEN]; + __u32 ni_status; + __u32 ni_cpts[LNET_MAX_SHOW_NUM_CPT]; +}; + +#define LNET_TINY_BUF_IDX 0 +#define LNET_SMALL_BUF_IDX 1 +#define LNET_LARGE_BUF_IDX 2 + +/* # different router buffer pools */ +#define LNET_NRBPOOLS (LNET_LARGE_BUF_IDX + 1) + +struct lnet_ioctl_pool_cfg { + struct { + __u32 pl_npages; + __u32 pl_nbuffers; + __u32 pl_credits; + __u32 pl_mincredits; + } pl_pools[LNET_NRBPOOLS]; + __u32 pl_routing; +}; + +struct lnet_ioctl_config_data { + struct libcfs_ioctl_hdr cfg_hdr; + + __u32 cfg_net; + __u32 cfg_count; + __u64 cfg_nid; + __u32 cfg_ncpts; + + union { + struct { + __u32 rtr_hop; + __u32 rtr_priority; + __u32 rtr_flags; + } cfg_route; + struct { + char net_intf[LNET_MAX_STR_LEN]; + __s32 net_peer_timeout; + __s32 net_peer_tx_credits; + __s32 net_peer_rtr_credits; + __s32 net_max_tx_credits; + __u32 net_cksum_algo; + __u32 net_pad; + } cfg_net; + struct { + __u32 buf_enable; + __s32 buf_tiny; + __s32 buf_small; + __s32 buf_large; + } cfg_buffers; + } cfg_config_u; + + char cfg_bulk[0]; +}; + +struct lnet_ioctl_peer { + struct libcfs_ioctl_hdr pr_hdr; + __u32 pr_count; + __u32 pr_pad; + __u64 pr_nid; + + union { + struct { + char cr_aliveness[LNET_MAX_STR_LEN]; + __u32 cr_refcount; + __u32 cr_ni_peer_tx_credits; + __u32 cr_peer_tx_credits; + __u32 cr_peer_rtr_credits; + __u32 cr_peer_min_rtr_credits; + __u32 cr_peer_tx_qnob; + __u32 cr_ncpt; + } pr_peer_credits; + } pr_lnd_u; +}; + +struct lnet_ioctl_lnet_stats { + struct libcfs_ioctl_hdr st_hdr; + struct lnet_counters st_cntrs; +}; + +#endif /* LNET_DLC_H */ diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 94d0dc5..f2874e0 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -694,6 +694,11 @@ void lnet_peer_tables_cleanup(lnet_ni_t *ni); void lnet_peer_tables_destroy(void); int lnet_peer_tables_create(void); void lnet_debug_peer(lnet_nid_t nid); +int lnet_get_peers(int count, __u64 *nid, char *alivness, + int *ncpt, int *refcount, + int *ni_peer_tx_credits, int *peer_tx_credits, + int *peer_rtr_credits, int *peer_min_rtr_credtis, + int *peer_tx_qnob); static inline void lnet_peer_set_alive(lnet_peer_t *lp) diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 9661f6a..165345c 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -39,6 +39,7 @@ #include #include "../../include/linux/lnet/lib-lnet.h" +#include "../../include/linux/lnet/lib-dlc.h" #define D_LNI D_CONSOLE @@ -1741,6 +1742,7 @@ int LNetCtl(unsigned int cmd, void *arg) { struct libcfs_ioctl_data *data = arg; + struct lnet_ioctl_config_data *config; lnet_process_id_t id = {0}; lnet_ni_t *ni; int rc; @@ -1765,16 +1767,51 @@ LNetCtl(unsigned int cmd, void *arg) return (rc != 0) ? rc : lnet_check_routes(); case IOC_LIBCFS_DEL_ROUTE: + config = arg; mutex_lock(&the_lnet.ln_api_mutex); - rc = lnet_del_route(data->ioc_net, data->ioc_nid); + rc = lnet_del_route(config->cfg_net, config->cfg_nid); mutex_unlock(&the_lnet.ln_api_mutex); return rc; case IOC_LIBCFS_GET_ROUTE: - return lnet_get_route(data->ioc_count, - &data->ioc_net, &data->ioc_count, - &data->ioc_nid, &data->ioc_flags, - &data->ioc_priority); + config = arg; + return lnet_get_route(config->cfg_count, + &config->cfg_net, + &config->cfg_config_u.cfg_route.rtr_hop, + &config->cfg_nid, + &config->cfg_config_u.cfg_route.rtr_flags, + &config->cfg_config_u.cfg_route. + rtr_priority); + + case IOC_LIBCFS_ADD_NET: + return 0; + + case IOC_LIBCFS_DEL_NET: + return 0; + + case IOC_LIBCFS_GET_NET: + return 0; + + case IOC_LIBCFS_GET_LNET_STATS: + { + struct lnet_ioctl_lnet_stats *lnet_stats = arg; + + lnet_counters_get(&lnet_stats->st_cntrs); + return 0; + } + + case IOC_LIBCFS_CONFIG_RTR: + return 0; + + case IOC_LIBCFS_ADD_BUF: + return 0; + + case IOC_LIBCFS_GET_BUF: + return 0; + + case IOC_LIBCFS_GET_PEER_INFO: + return 0; + case IOC_LIBCFS_NOTIFY_ROUTER: secs_passed = (ktime_get_real_seconds() - data->ioc_u64[0]); return lnet_notify(NULL, data->ioc_nid, data->ioc_flags, diff --git a/drivers/staging/lustre/lnet/lnet/module.c b/drivers/staging/lustre/lnet/lnet/module.c index 0afdad0..ffc5700 100644 --- a/drivers/staging/lustre/lnet/lnet/module.c +++ b/drivers/staging/lustre/lnet/lnet/module.c @@ -36,6 +36,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include "../../include/linux/lnet/lib-lnet.h" +#include "../../include/linux/lnet/lib-dlc.h" static int config_on_load; module_param(config_on_load, int, 0444); @@ -95,6 +96,9 @@ lnet_ioctl(unsigned int cmd, struct libcfs_ioctl_hdr *hdr) case IOC_LIBCFS_UNCONFIGURE: return lnet_unconfigure(); + case IOC_LIBCFS_ADD_NET: + return LNetCtl(cmd, hdr); + default: /* Passing LNET_PID_ANY only gives me a ref if the net is up * already; I'll need it to ensure the net can't go down while diff --git a/drivers/staging/lustre/lnet/lnet/peer.c b/drivers/staging/lustre/lnet/lnet/peer.c index bb5a0bb..1402e27 100644 --- a/drivers/staging/lustre/lnet/lnet/peer.c +++ b/drivers/staging/lustre/lnet/lnet/peer.c @@ -39,6 +39,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include "../../include/linux/lnet/lib-lnet.h" +#include "../../include/linux/lnet/lib-dlc.h" int lnet_peer_tables_create(void) @@ -392,3 +393,63 @@ lnet_debug_peer(lnet_nid_t nid) lnet_net_unlock(cpt); } + +int lnet_get_peers(int count, __u64 *nid, char *aliveness, + int *ncpt, int *refcount, + int *ni_peer_tx_credits, int *peer_tx_credits, + int *peer_rtr_credits, int *peer_min_rtr_credits, + int *peer_tx_qnob) +{ + struct lnet_peer_table *peer_table; + lnet_peer_t *lp; + int j; + int lncpt, found = 0; + + /* get the number of CPTs */ + lncpt = cfs_percpt_number(the_lnet.ln_peer_tables); + + /* + * if the cpt number to be examined is >= the number of cpts in + * the system then indicate that there are no more cpts to examin + */ + if (*ncpt > lncpt) + return -1; + + /* get the current table */ + peer_table = the_lnet.ln_peer_tables[*ncpt]; + /* if the ptable is NULL then there are no more cpts to examine */ + if (!peer_table) + return -1; + + lnet_net_lock(*ncpt); + + for (j = 0; j < LNET_PEER_HASH_SIZE && !found; j++) { + struct list_head *peers = &peer_table->pt_hash[j]; + + list_for_each_entry(lp, peers, lp_hashlist) { + if (count-- > 0) + continue; + + snprintf(aliveness, LNET_MAX_STR_LEN, "NA"); + if (lnet_isrouter(lp) || + lnet_peer_aliveness_enabled(lp)) + snprintf(aliveness, LNET_MAX_STR_LEN, + lp->lp_alive ? "up" : "down"); + + *nid = lp->lp_nid; + *refcount = lp->lp_refcount; + *ni_peer_tx_credits = lp->lp_ni->ni_peertxcredits; + *peer_tx_credits = lp->lp_txcredits; + *peer_rtr_credits = lp->lp_rtrcredits; + *peer_min_rtr_credits = lp->lp_mintxcredits; + *peer_tx_qnob = lp->lp_txqnob; + + found = 1; + } + } + lnet_net_unlock(*ncpt); + + *ncpt = lncpt; + + return found ? 0 : -ENOENT; +} diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c index ef1c247..1c31e2e 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c @@ -65,7 +65,8 @@ int libcfs_ioctl_getdata_len(const struct libcfs_ioctl_hdr __user *arg, if (copy_from_user(&hdr, arg, sizeof(hdr))) return -EFAULT; - if (hdr.ioc_version != LIBCFS_IOCTL_VERSION) { + if (hdr.ioc_version != LIBCFS_IOCTL_VERSION && + hdr.ioc_version != LIBCFS_IOCTL_VERSION2) { CERROR("LNET: version mismatch expected %#x, got %#x\n", LIBCFS_IOCTL_VERSION, hdr.ioc_version); return -EINVAL; diff --git a/drivers/staging/lustre/lustre/libcfs/module.c b/drivers/staging/lustre/lustre/libcfs/module.c index 5348699..992ff3c 100644 --- a/drivers/staging/lustre/lustre/libcfs/module.c +++ b/drivers/staging/lustre/lustre/libcfs/module.c @@ -54,13 +54,15 @@ # define DEBUG_SUBSYSTEM S_LNET -#define LIBCFS_MAX_IOCTL_BUF_LEN 2048 +#define LNET_MAX_IOCTL_BUF_LEN (sizeof(struct lnet_ioctl_net_config) + \ + sizeof(struct lnet_ioctl_config_data)) #include "../../include/linux/libcfs/libcfs.h" #include #include "../../include/linux/libcfs/libcfs_crypto.h" #include "../../include/linux/lnet/lib-lnet.h" +#include "../../include/linux/lnet/lib-dlc.h" #include "../../include/linux/lnet/lnet.h" #include "tracefile.h" @@ -249,8 +251,13 @@ static int libcfs_ioctl_handle(struct cfs_psdev_file *pfile, unsigned long cmd, struct libcfs_ioctl_data *data = NULL; int err = -EINVAL; - if ((cmd <= IOC_LIBCFS_LNETST) || - (cmd >= IOC_LIBCFS_REGISTER_MYNID)) { + /* + * The libcfs_ioctl_data_adjust() function performs adjustment + * operations on the libcfs_ioctl_data structure to make + * it usable by the code. This doesn't need to be called + * for new data structures added. + */ + if (hdr->ioc_version == LIBCFS_IOCTL_VERSION) { data = container_of(hdr, struct libcfs_ioctl_data, ioc_hdr); err = libcfs_ioctl_data_adjust(data); if (err != 0) { @@ -322,7 +329,7 @@ static int libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *a * do a check here to restrict the size of the memory * to allocate to guard against DoS attacks. */ - if (buf_len > LIBCFS_MAX_IOCTL_BUF_LEN) { + if (buf_len > LNET_MAX_IOCTL_BUF_LEN) { CERROR("LNET: user buffer exceeds kernel buffer\n"); return -EINVAL; } -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:56 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:56 -0500 Subject: [lustre-devel] [PATCH 20/40] staging: lustre: fix kernel crash when network failed to start In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-21-git-send-email-jsimmons@infradead.org> From: Amir Shehata When loading Lustre modules without proper network configuration, it always hit the following kernel panic: LNetError: 105-4: Error -100 starting up LNI tcp LNetError: 2145:0:(api-ni.c:823:lnet_unprepare()) ASSERTION( list_empty(&the_lnet.ln_nis) ) failed: NetError: 2145:0:(api-ni.c:823:lnet_unprepare()) LBUG Pid: 2145, comm: modprobe x0aCall Trace: [] libcfs_debug_dumpstack+0x53/0x80 [libcfs] [] lbug_with_loc+0x45/0xc0 [libcfs] [] lnet_unprepare+0x297/0x340 [lnet] [] LNetNIInit+0x25c/0x3e0 [lnet] [] ? put_online_cpus+0x56/0x80 [] ? init_module+0x0/0x1000 [ptlrpc] [] ptlrpc_ni_init+0x2c/0x1a0 [ptlrpc] [] ? init_module+0x0/0x1000 [ptlrpc] [] ptlrpc_init_portals+0x11/0xf0 [ptlrpc] [] ? init_module+0x0/0x1000 [ptlrpc] [] init_module+0x1c4/0x1000 [ptlrpc] [] do_one_initcall+0xe2/0x190 [] load_module+0x129b/0x1a90 [] ? ddebug_dyndbg_module_param_cb+0x0/0x60 [] ? copy_module_from_fd.isra.43+0x53/0x150 [] SyS_finit_module+0xa6/0xd0 [] system_call_fastpath+0x16/0x1b ... This is because in lnet_startup_lndnis(), we may add list items to @the_lnet.ln_nis and @the_lnet.ln_nis_cpt before it failed. But in lnet_startup_lndis() failure path,it did not cleanup list thus causing assertion in lnet_unprepare(). Fix the assertion by cleaning up using lnet_shutdown_lndnis() if the startup fails. In a future enahancement the ni startup API will be modified to cleanup after itself in case of failure. Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5568 Reviewed-on: http://review.whamcloud.com/12512 Reviewed-by: Liang Zhen Reviewed-by: Isaac Huang Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/api-ni.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 4c4e6d3..bfc1f13 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1246,6 +1246,10 @@ lnet_shutdown_lndni(__u32 net) return 0; } +/* + * Callers of lnet_startup_lndnis need to clean up using + * lnet_shutdown_lndnis if startup fails + */ static int lnet_startup_lndnis(struct list_head *nilist, __s32 peer_timeout, __s32 peer_cr, __s32 peer_buf_cr, __s32 credits, @@ -1554,7 +1558,7 @@ LNetNIInit(lnet_pid_t requested_pid) rc = lnet_startup_lndnis(&net_head, -1, -1, -1, -1, &ni_count); if (rc != 0) - goto failed1; + goto failed2; if (the_lnet.ln_eq_waitni && ni_count > 1) { lnd_type = the_lnet.ln_eq_waitni->ni_lnd->lnd_type; -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:53 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:53 -0500 Subject: [lustre-devel] [PATCH 17/40] staging: lustre: add sparse annotation __user wherever needed for lnet In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-18-git-send-email-jsimmons@infradead.org> From: frank zago This fixes sparse warnings such as: .../api-ni.c:1639:33: warning: incorrect type in argument 3 (different address spaces) .../api-ni.c:1639:33: expected struct lnet_process_id_t [noderef] [usertype] *ids .../api-ni.c:1639:33: got struct lnet_process_id_t [usertype] * There is no code change. Signed-off-by: frank zago Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396 Reviewed-on: http://review.whamcloud.com/11819 Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Reviewed-by: Oleg Drokin --- .../staging/lustre/include/linux/lnet/lib-lnet.h | 9 +- drivers/staging/lustre/include/linux/lnet/lnetst.h | 96 ++++++++++---------- drivers/staging/lustre/lnet/lnet/api-ni.c | 5 +- drivers/staging/lustre/lnet/selftest/conrpc.c | 4 +- drivers/staging/lustre/lnet/selftest/conrpc.h | 5 +- drivers/staging/lustre/lnet/selftest/console.c | 91 ++++++++++--------- drivers/staging/lustre/lnet/selftest/console.h | 54 ++++++----- 7 files changed, 140 insertions(+), 124 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 874af17..a1f94db 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -602,7 +602,7 @@ void lnet_copy_kiov2kiov(unsigned int ndkiov, lnet_kiov_t *dkiov, unsigned int soffset, unsigned int nob); static inline void -lnet_copy_iov2flat(int dlen, void *dest, unsigned int doffset, +lnet_copy_iov2flat(int dlen, void __user *dest, unsigned int doffset, unsigned int nsiov, struct kvec *siov, unsigned int soffset, unsigned int nob) { @@ -613,7 +613,7 @@ lnet_copy_iov2flat(int dlen, void *dest, unsigned int doffset, } static inline void -lnet_copy_kiov2flat(int dlen, void *dest, unsigned int doffset, +lnet_copy_kiov2flat(int dlen, void __user *dest, unsigned int doffset, unsigned int nsiov, lnet_kiov_t *skiov, unsigned int soffset, unsigned int nob) { @@ -625,7 +625,8 @@ lnet_copy_kiov2flat(int dlen, void *dest, unsigned int doffset, static inline void lnet_copy_flat2iov(unsigned int ndiov, struct kvec *diov, unsigned int doffset, - int slen, void *src, unsigned int soffset, unsigned int nob) + int slen, void __user *src, unsigned int soffset, + unsigned int nob) { struct kvec siov = {/*.iov_base = */ src, /*.iov_len = */slen}; @@ -635,7 +636,7 @@ lnet_copy_flat2iov(unsigned int ndiov, struct kvec *diov, unsigned int doffset, static inline void lnet_copy_flat2kiov(unsigned int ndiov, lnet_kiov_t *dkiov, - unsigned int doffset, int slen, void *src, + unsigned int doffset, int slen, void __user *src, unsigned int soffset, unsigned int nob) { struct kvec siov = {/* .iov_base = */ src, /* .iov_len = */ slen}; diff --git a/drivers/staging/lustre/include/linux/lnet/lnetst.h b/drivers/staging/lustre/include/linux/lnet/lnetst.h index fd1e0fd..fc183f8 100644 --- a/drivers/staging/lustre/include/linux/lnet/lnetst.h +++ b/drivers/staging/lustre/include/linux/lnet/lnetst.h @@ -245,20 +245,20 @@ typedef struct { int lstio_ses_force; /* IN: force create ? */ /** IN: session features */ unsigned lstio_ses_feats; - lst_sid_t *lstio_ses_idp; /* OUT: session id */ + lst_sid_t __user *lstio_ses_idp; /* OUT: session id */ int lstio_ses_nmlen; /* IN: name length */ - char *lstio_ses_namep; /* IN: session name */ + char __user *lstio_ses_namep; /* IN: session name */ } lstio_session_new_args_t; /* query current session */ typedef struct { - lst_sid_t *lstio_ses_idp; /* OUT: session id */ - int *lstio_ses_keyp; /* OUT: local key */ + lst_sid_t __user *lstio_ses_idp; /* OUT: session id */ + int __user *lstio_ses_keyp; /* OUT: local key */ /** OUT: session features */ - unsigned *lstio_ses_featp; - lstcon_ndlist_ent_t *lstio_ses_ndinfo; /* OUT: */ + unsigned __user *lstio_ses_featp; + lstcon_ndlist_ent_t __user *lstio_ses_ndinfo; /* OUT: */ int lstio_ses_nmlen; /* IN: name length */ - char *lstio_ses_namep; /* OUT: session name */ + char __user *lstio_ses_namep; /* OUT: session name */ } lstio_session_info_args_t; /* delete a session */ @@ -283,26 +283,26 @@ typedef struct { int lstio_dbg_timeout; /* IN: timeout of debug */ int lstio_dbg_nmlen; /* IN: len of name */ - char *lstio_dbg_namep; /* IN: name of + char __user *lstio_dbg_namep; /* IN: name of group|batch */ int lstio_dbg_count; /* IN: # of test nodes to debug */ - lnet_process_id_t *lstio_dbg_idsp; /* IN: id of test + lnet_process_id_t __user *lstio_dbg_idsp; /* IN: id of test nodes */ - struct list_head *lstio_dbg_resultp; /* OUT: list head of + struct list_head __user *lstio_dbg_resultp; /* OUT: list head of result buffer */ } lstio_debug_args_t; typedef struct { int lstio_grp_key; /* IN: session key */ int lstio_grp_nmlen; /* IN: name length */ - char *lstio_grp_namep; /* IN: group name */ + char __user *lstio_grp_namep; /* IN: group name */ } lstio_group_add_args_t; typedef struct { int lstio_grp_key; /* IN: session key */ int lstio_grp_nmlen; /* IN: name length */ - char *lstio_grp_namep; /* IN: group name */ + char __user *lstio_grp_namep; /* IN: group name */ } lstio_group_del_args_t; #define LST_GROUP_CLEAN 1 /* remove inactive nodes in the group */ @@ -315,22 +315,22 @@ typedef struct { int lstio_grp_opc; /* IN: OPC */ int lstio_grp_args; /* IN: arguments */ int lstio_grp_nmlen; /* IN: name length */ - char *lstio_grp_namep; /* IN: group name */ + char __user *lstio_grp_namep; /* IN: group name */ int lstio_grp_count; /* IN: # of nodes id */ - lnet_process_id_t *lstio_grp_idsp; /* IN: array of nodes */ - struct list_head *lstio_grp_resultp; /* OUT: list head of + lnet_process_id_t __user *lstio_grp_idsp; /* IN: array of nodes */ + struct list_head __user *lstio_grp_resultp; /* OUT: list head of result buffer */ } lstio_group_update_args_t; typedef struct { int lstio_grp_key; /* IN: session key */ int lstio_grp_nmlen; /* IN: name length */ - char *lstio_grp_namep; /* IN: group name */ + char __user *lstio_grp_namep; /* IN: group name */ int lstio_grp_count; /* IN: # of nodes */ /** OUT: session features */ - unsigned *lstio_grp_featp; - lnet_process_id_t *lstio_grp_idsp; /* IN: nodes */ - struct list_head *lstio_grp_resultp; /* OUT: list head of + unsigned __user *lstio_grp_featp; + lnet_process_id_t __user *lstio_grp_idsp; /* IN: nodes */ + struct list_head __user *lstio_grp_resultp; /* OUT: list head of result buffer */ } lstio_group_nodes_args_t; @@ -338,18 +338,18 @@ typedef struct { int lstio_grp_key; /* IN: session key */ int lstio_grp_idx; /* IN: group idx */ int lstio_grp_nmlen; /* IN: name len */ - char *lstio_grp_namep; /* OUT: name */ + char __user *lstio_grp_namep; /* OUT: name */ } lstio_group_list_args_t; typedef struct { int lstio_grp_key; /* IN: session key */ int lstio_grp_nmlen; /* IN: name len */ - char *lstio_grp_namep; /* IN: name */ - lstcon_ndlist_ent_t *lstio_grp_entp; /* OUT: description of + char __user *lstio_grp_namep; /* IN: name */ + lstcon_ndlist_ent_t __user *lstio_grp_entp; /* OUT: description of group */ - int *lstio_grp_idxp; /* IN/OUT: node index */ - int *lstio_grp_ndentp; /* IN/OUT: # of nodent */ - lstcon_node_ent_t *lstio_grp_dentsp; /* OUT: nodent array */ + int __user *lstio_grp_idxp; /* IN/OUT: node index */ + int __user *lstio_grp_ndentp; /* IN/OUT: # of nodent */ + lstcon_node_ent_t __user *lstio_grp_dentsp; /* OUT: nodent array */ } lstio_group_info_args_t; #define LST_DEFAULT_BATCH "batch" /* default batch name */ @@ -357,13 +357,13 @@ typedef struct { typedef struct { int lstio_bat_key; /* IN: session key */ int lstio_bat_nmlen; /* IN: name length */ - char *lstio_bat_namep; /* IN: batch name */ + char __user *lstio_bat_namep; /* IN: batch name */ } lstio_batch_add_args_t; typedef struct { int lstio_bat_key; /* IN: session key */ int lstio_bat_nmlen; /* IN: name length */ - char *lstio_bat_namep; /* IN: batch name */ + char __user *lstio_bat_namep; /* IN: batch name */ } lstio_batch_del_args_t; typedef struct { @@ -371,8 +371,8 @@ typedef struct { int lstio_bat_timeout; /* IN: timeout for the batch */ int lstio_bat_nmlen; /* IN: name length */ - char *lstio_bat_namep; /* IN: batch name */ - struct list_head *lstio_bat_resultp; /* OUT: list head of + char __user *lstio_bat_namep; /* IN: batch name */ + struct list_head __user *lstio_bat_resultp; /* OUT: list head of result buffer */ } lstio_batch_run_args_t; @@ -381,8 +381,8 @@ typedef struct { int lstio_bat_force; /* IN: abort unfinished test RPC */ int lstio_bat_nmlen; /* IN: name length */ - char *lstio_bat_namep; /* IN: batch name */ - struct list_head *lstio_bat_resultp; /* OUT: list head of + char __user *lstio_bat_namep; /* IN: batch name */ + struct list_head __user *lstio_bat_resultp; /* OUT: list head of result buffer */ } lstio_batch_stop_args_t; @@ -394,8 +394,8 @@ typedef struct { int lstio_bat_timeout; /* IN: timeout for waiting */ int lstio_bat_nmlen; /* IN: name length */ - char *lstio_bat_namep; /* IN: batch name */ - struct list_head *lstio_bat_resultp; /* OUT: list head of + char __user *lstio_bat_namep; /* IN: batch name */ + struct list_head __user *lstio_bat_resultp; /* OUT: list head of result buffer */ } lstio_batch_query_args_t; @@ -403,21 +403,21 @@ typedef struct { int lstio_bat_key; /* IN: session key */ int lstio_bat_idx; /* IN: index */ int lstio_bat_nmlen; /* IN: name length */ - char *lstio_bat_namep; /* IN: batch name */ + char __user *lstio_bat_namep; /* IN: batch name */ } lstio_batch_list_args_t; typedef struct { int lstio_bat_key; /* IN: session key */ int lstio_bat_nmlen; /* IN: name length */ - char *lstio_bat_namep; /* IN: name */ + char __user *lstio_bat_namep; /* IN: name */ int lstio_bat_server; /* IN: query server or not */ int lstio_bat_testidx; /* IN: test index */ - lstcon_test_batch_ent_t *lstio_bat_entp; /* OUT: batch ent */ + lstcon_test_batch_ent_t __user *lstio_bat_entp; /* OUT: batch ent */ - int *lstio_bat_idxp; /* IN/OUT: index of node */ - int *lstio_bat_ndentp; /* IN/OUT: # of nodent */ - lstcon_node_ent_t *lstio_bat_dentsp; /* array of nodent */ + int __user *lstio_bat_idxp; /* IN/OUT: index of node */ + int __user *lstio_bat_ndentp; /* IN/OUT: # of nodent */ + lstcon_node_ent_t __user *lstio_bat_dentsp; /* array of nodent */ } lstio_batch_info_args_t; /* add stat in session */ @@ -427,10 +427,10 @@ typedef struct { stat request */ int lstio_sta_nmlen; /* IN: group name length */ - char *lstio_sta_namep; /* IN: group name */ + char __user *lstio_sta_namep; /* IN: group name */ int lstio_sta_count; /* IN: # of pid */ - lnet_process_id_t *lstio_sta_idsp; /* IN: pid */ - struct list_head *lstio_sta_resultp; /* OUT: list head of + lnet_process_id_t __user *lstio_sta_idsp; /* IN: pid */ + struct list_head __user *lstio_sta_resultp; /* OUT: list head of result buffer */ } lstio_stat_args_t; @@ -445,7 +445,7 @@ typedef enum { typedef struct { int lstio_tes_key; /* IN: session key */ int lstio_tes_bat_nmlen; /* IN: batch name len */ - char *lstio_tes_bat_name; /* IN: batch name */ + char __user *lstio_tes_bat_name; /* IN: batch name */ int lstio_tes_type; /* IN: test type */ int lstio_tes_oneside; /* IN: one sided test */ int lstio_tes_loop; /* IN: loop count */ @@ -457,20 +457,20 @@ typedef struct { destination groups */ int lstio_tes_sgrp_nmlen; /* IN: source group name length */ - char *lstio_tes_sgrp_name; /* IN: group name */ + char __user *lstio_tes_sgrp_name; /* IN: group name */ int lstio_tes_dgrp_nmlen; /* IN: destination group name length */ - char *lstio_tes_dgrp_name; /* IN: group name */ + char __user *lstio_tes_dgrp_name; /* IN: group name */ int lstio_tes_param_len; /* IN: param buffer len */ - void *lstio_tes_param; /* IN: parameter for specified + void __user *lstio_tes_param; /* IN: parameter for specified test: lstio_bulk_param_t, lstio_ping_param_t, ... more */ - int *lstio_tes_retp; /* OUT: private returned + int __user *lstio_tes_retp; /* OUT: private returned value */ - struct list_head *lstio_tes_resultp; /* OUT: list head of + struct list_head __user *lstio_tes_resultp; /* OUT: list head of result buffer */ } lstio_test_args_t; diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 3b2bfd5..acc216e 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1982,7 +1982,7 @@ LNetCtl(unsigned int cmd, void *arg) id.nid = data->ioc_nid; id.pid = data->ioc_u32[0]; rc = lnet_ping(id, data->ioc_u32[1], /* timeout */ - (lnet_process_id_t *)data->ioc_pbuf1, + (lnet_process_id_t __user *)data->ioc_pbuf1, data->ioc_plen1/sizeof(lnet_process_id_t)); if (rc < 0) return rc; @@ -2085,7 +2085,8 @@ LNetSnprintHandle(char *str, int len, lnet_handle_any_t h) EXPORT_SYMBOL(LNetSnprintHandle); static int -lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t *ids, int n_ids) +lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t __user *ids, + int n_ids) { lnet_handle_eq_t eqh; lnet_handle_md_t mdh; diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.c b/drivers/staging/lustre/lnet/selftest/conrpc.c index 1066c70..15a61de 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.c +++ b/drivers/staging/lustre/lnet/selftest/conrpc.c @@ -466,11 +466,11 @@ lstcon_rpc_trans_stat(lstcon_rpc_trans_t *trans, lstcon_trans_stat_t *stat) int lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans, - struct list_head *head_up, + struct list_head __user *head_up, lstcon_rpc_readent_func_t readent) { struct list_head tmp; - struct list_head *next; + struct list_head __user *next; lstcon_rpc_ent_t *ent; srpc_generic_reply_t *rep; lstcon_rpc_t *crpc; diff --git a/drivers/staging/lustre/lnet/selftest/conrpc.h b/drivers/staging/lustre/lnet/selftest/conrpc.h index 95c832f..d2133bc 100644 --- a/drivers/staging/lustre/lnet/selftest/conrpc.h +++ b/drivers/staging/lustre/lnet/selftest/conrpc.h @@ -106,7 +106,8 @@ typedef struct lstcon_rpc_trans { #define LST_TRANS_STATQRY 0x21 typedef int (*lstcon_rpc_cond_func_t)(int, struct lstcon_node *, void *); -typedef int (*lstcon_rpc_readent_func_t)(int, srpc_msg_t *, lstcon_rpc_ent_t *); +typedef int (*lstcon_rpc_readent_func_t)(int, srpc_msg_t *, + lstcon_rpc_ent_t __user *); int lstcon_sesrpc_prep(struct lstcon_node *nd, int transop, unsigned version, lstcon_rpc_t **crpc); @@ -128,7 +129,7 @@ int lstcon_rpc_trans_ndlist(struct list_head *ndlist, void lstcon_rpc_trans_stat(lstcon_rpc_trans_t *trans, lstcon_trans_stat_t *stat); int lstcon_rpc_trans_interpreter(lstcon_rpc_trans_t *trans, - struct list_head *head_up, + struct list_head __user *head_up, lstcon_rpc_readent_func_t readent); void lstcon_rpc_trans_abort(lstcon_rpc_trans_t *trans, int error); void lstcon_rpc_trans_destroy(lstcon_rpc_trans_t *trans); diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c index 898912b..f8d6dfe 100644 --- a/drivers/staging/lustre/lnet/selftest/console.c +++ b/drivers/staging/lustre/lnet/selftest/console.c @@ -363,7 +363,7 @@ lstcon_sesrpc_condition(int transop, lstcon_node_t *nd, void *arg) static int lstcon_sesrpc_readent(int transop, srpc_msg_t *msg, - lstcon_rpc_ent_t *ent_up) + lstcon_rpc_ent_t __user *ent_up) { srpc_debug_reply_t *rep; @@ -392,8 +392,8 @@ lstcon_sesrpc_readent(int transop, srpc_msg_t *msg, static int lstcon_group_nodes_add(lstcon_group_t *grp, - int count, lnet_process_id_t *ids_up, - unsigned *featp, struct list_head *result_up) + int count, lnet_process_id_t __user *ids_up, + unsigned *featp, struct list_head __user *result_up) { lstcon_rpc_trans_t *trans; lstcon_ndlink_t *ndl; @@ -459,8 +459,8 @@ lstcon_group_nodes_add(lstcon_group_t *grp, static int lstcon_group_nodes_remove(lstcon_group_t *grp, - int count, lnet_process_id_t *ids_up, - struct list_head *result_up) + int count, lnet_process_id_t __user *ids_up, + struct list_head __user *result_up) { lstcon_rpc_trans_t *trans; lstcon_ndlink_t *ndl; @@ -537,8 +537,8 @@ lstcon_group_add(char *name) } int -lstcon_nodes_add(char *name, int count, lnet_process_id_t *ids_up, - unsigned *featp, struct list_head *result_up) +lstcon_nodes_add(char *name, int count, lnet_process_id_t __user *ids_up, + unsigned *featp, struct list_head __user *result_up) { lstcon_group_t *grp; int rc; @@ -642,7 +642,8 @@ lstcon_group_clean(char *name, int args) int lstcon_nodes_remove(char *name, int count, - lnet_process_id_t *ids_up, struct list_head *result_up) + lnet_process_id_t __user *ids_up, + struct list_head __user *result_up) { lstcon_group_t *grp = NULL; int rc; @@ -671,7 +672,7 @@ lstcon_nodes_remove(char *name, int count, } int -lstcon_group_refresh(char *name, struct list_head *result_up) +lstcon_group_refresh(char *name, struct list_head __user *result_up) { lstcon_rpc_trans_t *trans; lstcon_group_t *grp; @@ -732,7 +733,7 @@ lstcon_group_list(int index, int len, char *name_up) static int lstcon_nodes_getent(struct list_head *head, int *index_p, - int *count_p, lstcon_node_ent_t *dents_up) + int *count_p, lstcon_node_ent_t __user *dents_up) { lstcon_ndlink_t *ndl; lstcon_node_t *nd; @@ -771,8 +772,9 @@ lstcon_nodes_getent(struct list_head *head, int *index_p, } int -lstcon_group_info(char *name, lstcon_ndlist_ent_t *gents_p, - int *index_p, int *count_p, lstcon_node_ent_t *dents_up) +lstcon_group_info(char *name, lstcon_ndlist_ent_t __user *gents_p, + int *index_p, int *count_p, + lstcon_node_ent_t __user *dents_up) { lstcon_ndlist_ent_t *gentp; lstcon_group_t *grp; @@ -910,9 +912,9 @@ lstcon_batch_list(int index, int len, char *name_up) } int -lstcon_batch_info(char *name, lstcon_test_batch_ent_t *ent_up, int server, - int testidx, int *index_p, int *ndent_p, - lstcon_node_ent_t *dents_up) +lstcon_batch_info(char *name, lstcon_test_batch_ent_t __user *ent_up, + int server, int testidx, int *index_p, int *ndent_p, + lstcon_node_ent_t __user *dents_up) { lstcon_test_batch_ent_t *entp; struct list_head *clilst; @@ -1006,7 +1008,7 @@ lstcon_batrpc_condition(int transop, lstcon_node_t *nd, void *arg) static int lstcon_batch_op(lstcon_batch_t *bat, int transop, - struct list_head *result_up) + struct list_head __user *result_up) { lstcon_rpc_trans_t *trans; int rc; @@ -1029,7 +1031,7 @@ lstcon_batch_op(lstcon_batch_t *bat, int transop, } int -lstcon_batch_run(char *name, int timeout, struct list_head *result_up) +lstcon_batch_run(char *name, int timeout, struct list_head __user *result_up) { lstcon_batch_t *bat; int rc; @@ -1051,7 +1053,7 @@ lstcon_batch_run(char *name, int timeout, struct list_head *result_up) } int -lstcon_batch_stop(char *name, int force, struct list_head *result_up) +lstcon_batch_stop(char *name, int force, struct list_head __user *result_up) { lstcon_batch_t *bat; int rc; @@ -1170,7 +1172,7 @@ lstcon_testrpc_condition(int transop, lstcon_node_t *nd, void *arg) } static int -lstcon_test_nodes_add(lstcon_test_t *test, struct list_head *result_up) +lstcon_test_nodes_add(lstcon_test_t *test, struct list_head __user *result_up) { lstcon_rpc_trans_t *trans; lstcon_group_t *grp; @@ -1266,7 +1268,7 @@ lstcon_test_add(char *batch_name, int type, int loop, int concur, int dist, int span, char *src_name, char *dst_name, void *param, int paramlen, int *retp, - struct list_head *result_up) + struct list_head __user *result_up) { lstcon_test_t *test = NULL; int rc; @@ -1369,7 +1371,7 @@ lstcon_test_find(lstcon_batch_t *batch, int idx, lstcon_test_t **testpp) static int lstcon_tsbrpc_readent(int transop, srpc_msg_t *msg, - lstcon_rpc_ent_t *ent_up) + lstcon_rpc_ent_t __user *ent_up) { srpc_batch_reply_t *rep = &msg->msg_body.bat_reply; @@ -1386,7 +1388,7 @@ lstcon_tsbrpc_readent(int transop, srpc_msg_t *msg, int lstcon_test_batch_query(char *name, int testidx, int client, - int timeout, struct list_head *result_up) + int timeout, struct list_head __user *result_up) { lstcon_rpc_trans_t *trans; struct list_head *translist; @@ -1448,19 +1450,21 @@ lstcon_test_batch_query(char *name, int testidx, int client, static int lstcon_statrpc_readent(int transop, srpc_msg_t *msg, - lstcon_rpc_ent_t *ent_up) + lstcon_rpc_ent_t __user *ent_up) { srpc_stat_reply_t *rep = &msg->msg_body.stat_reply; - sfw_counters_t *sfwk_stat; - srpc_counters_t *srpc_stat; - lnet_counters_t *lnet_stat; + sfw_counters_t __user *sfwk_stat; + srpc_counters_t __user *srpc_stat; + lnet_counters_t __user *lnet_stat; if (rep->str_status != 0) return 0; - sfwk_stat = (sfw_counters_t *)&ent_up->rpe_payload[0]; - srpc_stat = (srpc_counters_t *)((char *)sfwk_stat + sizeof(*sfwk_stat)); - lnet_stat = (lnet_counters_t *)((char *)srpc_stat + sizeof(*srpc_stat)); + sfwk_stat = (sfw_counters_t __user *)&ent_up->rpe_payload[0]; + srpc_stat = (srpc_counters_t __user *)((char __user *)sfwk_stat + + sizeof(*sfwk_stat)); + lnet_stat = (lnet_counters_t __user *)((char __user *)srpc_stat + + sizeof(*srpc_stat)); if (copy_to_user(sfwk_stat, &rep->str_fw, sizeof(*sfwk_stat)) || copy_to_user(srpc_stat, &rep->str_rpc, sizeof(*srpc_stat)) || @@ -1472,7 +1476,7 @@ lstcon_statrpc_readent(int transop, srpc_msg_t *msg, static int lstcon_ndlist_stat(struct list_head *ndlist, - int timeout, struct list_head *result_up) + int timeout, struct list_head __user *result_up) { struct list_head head; lstcon_rpc_trans_t *trans; @@ -1497,7 +1501,8 @@ lstcon_ndlist_stat(struct list_head *ndlist, } int -lstcon_group_stat(char *grp_name, int timeout, struct list_head *result_up) +lstcon_group_stat(char *grp_name, int timeout, + struct list_head __user *result_up) { lstcon_group_t *grp; int rc; @@ -1516,8 +1521,8 @@ lstcon_group_stat(char *grp_name, int timeout, struct list_head *result_up) } int -lstcon_nodes_stat(int count, lnet_process_id_t *ids_up, - int timeout, struct list_head *result_up) +lstcon_nodes_stat(int count, lnet_process_id_t __user *ids_up, + int timeout, struct list_head __user *result_up) { lstcon_ndlink_t *ndl; lstcon_group_t *tmp; @@ -1562,7 +1567,7 @@ lstcon_nodes_stat(int count, lnet_process_id_t *ids_up, static int lstcon_debug_ndlist(struct list_head *ndlist, struct list_head *translist, - int timeout, struct list_head *result_up) + int timeout, struct list_head __user *result_up) { lstcon_rpc_trans_t *trans; int rc; @@ -1584,7 +1589,7 @@ lstcon_debug_ndlist(struct list_head *ndlist, } int -lstcon_session_debug(int timeout, struct list_head *result_up) +lstcon_session_debug(int timeout, struct list_head __user *result_up) { return lstcon_debug_ndlist(&console_session.ses_ndl_list, NULL, timeout, result_up); @@ -1592,7 +1597,7 @@ lstcon_session_debug(int timeout, struct list_head *result_up) int lstcon_batch_debug(int timeout, char *name, - int client, struct list_head *result_up) + int client, struct list_head __user *result_up) { lstcon_batch_t *bat; int rc; @@ -1610,7 +1615,7 @@ lstcon_batch_debug(int timeout, char *name, int lstcon_group_debug(int timeout, char *name, - struct list_head *result_up) + struct list_head __user *result_up) { lstcon_group_t *grp; int rc; @@ -1628,8 +1633,8 @@ lstcon_group_debug(int timeout, char *name, int lstcon_nodes_debug(int timeout, - int count, lnet_process_id_t *ids_up, - struct list_head *result_up) + int count, lnet_process_id_t __user *ids_up, + struct list_head __user *result_up) { lnet_process_id_t id; lstcon_ndlink_t *ndl; @@ -1693,7 +1698,7 @@ extern srpc_service_t lstcon_acceptor_service; int lstcon_session_new(char *name, int key, unsigned feats, - int timeout, int force, lst_sid_t *sid_up) + int timeout, int force, lst_sid_t __user *sid_up) { int rc = 0; int i; @@ -1758,8 +1763,10 @@ lstcon_session_new(char *name, int key, unsigned feats, } int -lstcon_session_info(lst_sid_t *sid_up, int *key_up, unsigned *featp, - lstcon_ndlist_ent_t *ndinfo_up, char *name_up, int len) +lstcon_session_info(lst_sid_t __user *sid_up, int __user *key_up, + unsigned __user *featp, + lstcon_ndlist_ent_t __user *ndinfo_up, + char __user *name_up, int len) { lstcon_ndlist_ent_t *entp; lstcon_ndlink_t *ndl; diff --git a/drivers/staging/lustre/lnet/selftest/console.h b/drivers/staging/lustre/lnet/selftest/console.h index 7af3540..bab6557 100644 --- a/drivers/staging/lustre/lnet/selftest/console.h +++ b/drivers/staging/lustre/lnet/selftest/console.h @@ -187,47 +187,53 @@ int lstcon_console_init(void); int lstcon_console_fini(void); int lstcon_session_match(lst_sid_t sid); int lstcon_session_new(char *name, int key, unsigned version, - int timeout, int flags, lst_sid_t *sid_up); -int lstcon_session_info(lst_sid_t *sid_up, int *key, unsigned *verp, - lstcon_ndlist_ent_t *entp, char *name_up, int len); + int timeout, int flags, lst_sid_t __user *sid_up); +int lstcon_session_info(lst_sid_t __user *sid_up, int __user *key, + unsigned __user *verp, + lstcon_ndlist_ent_t __user *entp, + char __user *name_up, int len); int lstcon_session_end(void); -int lstcon_session_debug(int timeout, struct list_head *result_up); +int lstcon_session_debug(int timeout, struct list_head __user *result_up); int lstcon_session_feats_check(unsigned feats); int lstcon_batch_debug(int timeout, char *name, - int client, struct list_head *result_up); + int client, struct list_head __user *result_up); int lstcon_group_debug(int timeout, char *name, - struct list_head *result_up); -int lstcon_nodes_debug(int timeout, int nnd, lnet_process_id_t *nds_up, - struct list_head *result_up); + struct list_head __user *result_up); +int lstcon_nodes_debug(int timeout, int nnd, + lnet_process_id_t __user *nds_up, + struct list_head __user *result_up); int lstcon_group_add(char *name); int lstcon_group_del(char *name); int lstcon_group_clean(char *name, int args); -int lstcon_group_refresh(char *name, struct list_head *result_up); -int lstcon_nodes_add(char *name, int nnd, lnet_process_id_t *nds_up, - unsigned *featp, struct list_head *result_up); -int lstcon_nodes_remove(char *name, int nnd, lnet_process_id_t *nds_up, - struct list_head *result_up); -int lstcon_group_info(char *name, lstcon_ndlist_ent_t *gent_up, - int *index_p, int *ndent_p, lstcon_node_ent_t *ndents_up); +int lstcon_group_refresh(char *name, struct list_head __user *result_up); +int lstcon_nodes_add(char *name, int nnd, lnet_process_id_t __user *nds_up, + unsigned *featp, struct list_head __user *result_up); +int lstcon_nodes_remove(char *name, int nnd, lnet_process_id_t __user *nds_up, + struct list_head __user *result_up); +int lstcon_group_info(char *name, lstcon_ndlist_ent_t __user *gent_up, + int *index_p, int *ndent_p, + lstcon_node_ent_t __user *ndents_up); int lstcon_group_list(int idx, int len, char *name_up); int lstcon_batch_add(char *name); -int lstcon_batch_run(char *name, int timeout, struct list_head *result_up); -int lstcon_batch_stop(char *name, int force, struct list_head *result_up); +int lstcon_batch_run(char *name, int timeout, + struct list_head __user *result_up); +int lstcon_batch_stop(char *name, int force, + struct list_head __user *result_up); int lstcon_test_batch_query(char *name, int testidx, int client, int timeout, - struct list_head *result_up); + struct list_head __user *result_up); int lstcon_batch_del(char *name); int lstcon_batch_list(int idx, int namelen, char *name_up); -int lstcon_batch_info(char *name, lstcon_test_batch_ent_t *ent_up, +int lstcon_batch_info(char *name, lstcon_test_batch_ent_t __user *ent_up, int server, int testidx, int *index_p, - int *ndent_p, lstcon_node_ent_t *dents_up); + int *ndent_p, lstcon_node_ent_t __user *dents_up); int lstcon_group_stat(char *grp_name, int timeout, - struct list_head *result_up); -int lstcon_nodes_stat(int count, lnet_process_id_t *ids_up, - int timeout, struct list_head *result_up); + struct list_head __user *result_up); +int lstcon_nodes_stat(int count, lnet_process_id_t __user *ids_up, + int timeout, struct list_head __user *result_up); int lstcon_test_add(char *batch_name, int type, int loop, int concur, int dist, int span, char *src_name, char *dst_name, void *param, int paramlen, int *retp, - struct list_head *result_up); + struct list_head __user *result_up); #endif -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:12 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:12 -0500 Subject: [lustre-devel] [PATCH 36/40] staging: lustre: test for sk_sleep presence in compact-2.6.h In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-37-git-send-email-jsimmons@infradead.org> Like Lustre external infiniband stacks create a compatibility layer to handle various distributions and kernel versions. Due to this besides the linux kernel sk_sleep can also be defined by the external infiniband stack. We need to examine the infiniband stack's headers to see if sk_sleep is available there as well. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6763 Reviewed-on: http://review.whamcloud.com/15386 Reviewed-by: Chris Horn Reviewed-by: Amir Shehata Reviewed-by: Oleg Drokin --- .../staging/lustre/include/linux/lnet/lib-types.h | 1 - drivers/staging/lustre/lnet/lnet/acceptor.c | 1 + 2 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-types.h b/drivers/staging/lustre/include/linux/lnet/lib-types.h index dbfb069..695b5be 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-types.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-types.h @@ -38,7 +38,6 @@ #include #include #include -#include #include "types.h" diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c b/drivers/staging/lustre/lnet/lnet/acceptor.c index 61806ce..05eb5b2 100644 --- a/drivers/staging/lustre/lnet/lnet/acceptor.c +++ b/drivers/staging/lustre/lnet/lnet/acceptor.c @@ -36,6 +36,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include +#include #include "../../include/linux/lnet/lib-lnet.h" static int accept_port = 988; -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:02 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:02 -0500 Subject: [lustre-devel] [PATCH 26/40] staging: lustre: startup lnet acceptor thread dynamically In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-27-git-send-email-jsimmons@infradead.org> From: Amir Shehata With DLC it's possible to start up a system with no NIs that require the acceptor thread, and thus it won't start. Later on the user can add an NI that requires the acceptor thread to start, it is then necessary to start it up. If the user removes a NI and as a result there are no more NIs that require the acceptor thread then it should be stopped. This patch adds logic in the dynamically adding and removing NIs code to ensure the above logic is implemented. Signed-off-by: Amir Shehata ntel-bug-id: https://jira.hpdd.intel.com/browse/LU-6002 Reviewed-on: http://review.whamcloud.com/13010 Reviewed-by: Isaac Huang Reviewed-by: Doug Oucharek Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/acceptor.c | 10 ++++++++-- drivers/staging/lustre/lnet/lnet/api-ni.c | 14 ++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c b/drivers/staging/lustre/lnet/lnet/acceptor.c index d05754d..112b166 100644 --- a/drivers/staging/lustre/lnet/lnet/acceptor.c +++ b/drivers/staging/lustre/lnet/lnet/acceptor.c @@ -46,7 +46,9 @@ static struct { int pta_shutdown; struct socket *pta_sock; struct completion pta_signal; -} lnet_acceptor_state; +} lnet_acceptor_state = { + .pta_shutdown = 1 +}; int lnet_acceptor_port(void) @@ -441,6 +443,10 @@ lnet_acceptor_start(void) long rc2; long secure; + /* if acceptor is already running return immediately */ + if (!lnet_acceptor_state.pta_shutdown) + return 0; + LASSERT(lnet_acceptor_state.pta_sock == NULL); rc = lnet_acceptor_get_tunables(); @@ -481,7 +487,7 @@ lnet_acceptor_start(void) void lnet_acceptor_stop(void) { - if (lnet_acceptor_state.pta_sock == NULL) /* not running */ + if (lnet_acceptor_state.pta_shutdown) /* not running */ return; lnet_acceptor_state.pta_shutdown = 1; diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 89b390a..7d6e59f 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1776,6 +1776,16 @@ lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets, if (rc != 0) goto failed1; + if (ni->ni_lnd->lnd_accept) { + rc = lnet_acceptor_start(); + if (rc < 0) { + /* shutdown the ni that we just started */ + CERROR("Failed to start up acceptor thread\n"); + lnet_shutdown_lndni(ni); + goto failed1; + } + } + lnet_ping_target_update(pinfo, md_handle); mutex_unlock(&the_lnet.ln_api_mutex); @@ -1823,6 +1833,10 @@ lnet_dyn_del_ni(__u32 net) lnet_ni_decref_locked(ni, 0); lnet_shutdown_lndni(ni); + + if (lnet_count_acceptor_nis() == 0) + lnet_acceptor_stop(); + lnet_ping_target_update(pinfo, md_handle); goto out; failed: -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:13 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:13 -0500 Subject: [lustre-devel] [PATCH 37/40] staging: lustre: remove unnecessary NULL check in IOC_LIBCFS_GET_NET In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-38-git-send-email-jsimmons@infradead.org> From: Amir Shehata In LNetCtl():IOC_LIBCFS_GET_NET there is a check for config == NULL This is not necessary as it'll never be NULL. That's ensured before the call to LNetCtl. Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6502 Reviewed-on: http://review.whamcloud.com/15779 Reviewed-by: Dmitry Eremin Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/api-ni.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 7f5e0e8..6373de0 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1931,7 +1931,7 @@ LNetCtl(unsigned int cmd, void *arg) net_config = (struct lnet_ioctl_net_config *) config->cfg_bulk; - if (!config || !net_config) + if (!net_config) return -1; return lnet_get_net_config(config->cfg_count, -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:54 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:54 -0500 Subject: [lustre-devel] [PATCH 18/40] staging: lustre: remove LUSTRE_{, SRV_}LNET_PID In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-19-git-send-email-jsimmons@infradead.org> From: John L. Hammond Remove LUSTRE_LNET_PID (12354) and LUSTRE_SRV_LNET_PID (12345) from the libcfs headers and replace their uses with a new macro LNET_PID_LUSTRE (also 12345) in lnet/types.h. Signed-off-by: John L. Hammond Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2675 Reviewed-on: http://review.whamcloud.com/11985 Reviewed-by: James Simmons Reviewed-by: Bob Glossman Reviewed-by: Dmitry Eremin Reviewed-by: Andreas Dilger --- .../staging/lustre/include/linux/libcfs/libcfs.h | 2 -- .../lustre/include/linux/libcfs/linux/libcfs.h | 3 --- .../staging/lustre/lnet/klnds/socklnd/socklnd.c | 7 +++++-- drivers/staging/lustre/lnet/lnet/api-ni.c | 2 +- drivers/staging/lustre/lnet/lnet/lib-move.c | 2 +- drivers/staging/lustre/lnet/lnet/module.c | 4 ++-- drivers/staging/lustre/lnet/lnet/router.c | 2 +- drivers/staging/lustre/lnet/selftest/rpc.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/events.c | 4 ++-- 9 files changed, 13 insertions(+), 15 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/libcfs.h index 4d74e8a..1cca6c7 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs.h @@ -58,8 +58,6 @@ static inline int __is_po2(unsigned long long val) #define LERRCHKSUM(hexnum) (((hexnum) & 0xf) ^ ((hexnum) >> 4 & 0xf) ^ \ ((hexnum) >> 8 & 0xf)) -#define LUSTRE_SRV_LNET_PID LUSTRE_LNET_PID - #include /* need both kernel and user-land acceptor */ diff --git a/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h b/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h index aac5900..d94b266 100644 --- a/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h +++ b/drivers/staging/lustre/include/linux/libcfs/linux/libcfs.h @@ -118,9 +118,6 @@ do { \ #define CDEBUG_STACK() (0L) #endif /* __x86_64__ */ -/* initial pid */ -#define LUSTRE_LNET_PID 12345 - #define __current_nesting_level() (0) /** diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c index ebde036..6b88902 100644 --- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c +++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd.c @@ -1788,7 +1788,10 @@ ksocknal_query(lnet_ni_t *ni, lnet_nid_t nid, unsigned long *when) unsigned long now = cfs_time_current(); ksock_peer_t *peer = NULL; rwlock_t *glock = &ksocknal_data.ksnd_global_lock; - lnet_process_id_t id = {.nid = nid, .pid = LUSTRE_SRV_LNET_PID}; + lnet_process_id_t id = { + .nid = nid, + .pid = LNET_PID_LUSTRE, + }; read_lock(glock); @@ -2136,7 +2139,7 @@ ksocknal_ctl(lnet_ni_t *ni, unsigned int cmd, void *arg) case IOC_LIBCFS_ADD_PEER: id.nid = data->ioc_nid; - id.pid = LUSTRE_SRV_LNET_PID; + id.pid = LNET_PID_LUSTRE; return ksocknal_add_peer(ni, id, data->ioc_u32[0], /* IP */ data->ioc_u32[1]); /* port */ diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index acc216e..949fa2f 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -2114,7 +2114,7 @@ lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t __user *ids, return -EINVAL; if (id.pid == LNET_PID_ANY) - id.pid = LUSTRE_SRV_LNET_PID; + id.pid = LNET_PID_LUSTRE; LIBCFS_ALLOC(info, infosz); if (info == NULL) diff --git a/drivers/staging/lustre/lnet/lnet/lib-move.c b/drivers/staging/lustre/lnet/lnet/lib-move.c index e1461af..b9388ed 100644 --- a/drivers/staging/lustre/lnet/lnet/lib-move.c +++ b/drivers/staging/lustre/lnet/lnet/lib-move.c @@ -1388,7 +1388,7 @@ lnet_send(lnet_nid_t src_nid, lnet_msg_t *msg, lnet_nid_t rtr_nid) msg->msg_target_is_router = 1; msg->msg_target.nid = lp->lp_nid; - msg->msg_target.pid = LUSTRE_SRV_LNET_PID; + msg->msg_target.pid = LNET_PID_LUSTRE; } /* 'lp' is our best choice of peer */ diff --git a/drivers/staging/lustre/lnet/lnet/module.c b/drivers/staging/lustre/lnet/lnet/module.c index 281315c..48eb085 100644 --- a/drivers/staging/lustre/lnet/lnet/module.c +++ b/drivers/staging/lustre/lnet/lnet/module.c @@ -53,7 +53,7 @@ lnet_configure(void *arg) mutex_lock(&lnet_config_mutex); if (!the_lnet.ln_niinit_self) { - rc = LNetNIInit(LUSTRE_SRV_LNET_PID); + rc = LNetNIInit(LNET_PID_LUSTRE); if (rc >= 0) { the_lnet.ln_niinit_self = 1; rc = 0; @@ -93,7 +93,7 @@ lnet_dyn_configure(struct libcfs_ioctl_hdr *hdr) mutex_lock(&lnet_config_mutex); if (the_lnet.ln_niinit_self) - rc = lnet_dyn_add_ni(LUSTRE_SRV_LNET_PID, + rc = lnet_dyn_add_ni(LNET_PID_LUSTRE, conf->cfg_config_u.cfg_net.net_intf, conf->cfg_config_u.cfg_net. net_peer_timeout, diff --git a/drivers/staging/lustre/lnet/lnet/router.c b/drivers/staging/lustre/lnet/lnet/router.c index 17e6795..1f5a4b1 100644 --- a/drivers/staging/lustre/lnet/lnet/router.c +++ b/drivers/staging/lustre/lnet/lnet/router.c @@ -1009,7 +1009,7 @@ lnet_ping_router_locked(lnet_peer_t *rtr) lnet_handle_md_t mdh; id.nid = rtr->lp_nid; - id.pid = LUSTRE_SRV_LNET_PID; + id.pid = LNET_PID_LUSTRE; CDEBUG(D_NET, "Check: %s\n", libcfs_id2str(id)); rtr->lp_ping_notsent = 1; diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c index 86de680..2212199 100644 --- a/drivers/staging/lustre/lnet/selftest/rpc.c +++ b/drivers/staging/lustre/lnet/selftest/rpc.c @@ -1587,7 +1587,7 @@ srpc_startup(void) srpc_data.rpc_state = SRPC_STATE_NONE; - rc = LNetNIInit(LUSTRE_SRV_LNET_PID); + rc = LNetNIInit(LNET_PID_LUSTRE); if (rc < 0) { CERROR("LNetNIInit() has failed: %d\n", rc); return rc; diff --git a/drivers/staging/lustre/lustre/ptlrpc/events.c b/drivers/staging/lustre/lustre/ptlrpc/events.c index 9c2fd34..2a0dfa5 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/events.c +++ b/drivers/staging/lustre/lustre/ptlrpc/events.c @@ -446,7 +446,7 @@ int ptlrpc_uuid_to_peer(struct obd_uuid *uuid, portals_compatibility = LNetCtl(IOC_LIBCFS_PORTALS_COMPATIBILITY, NULL); - peer->pid = LUSTRE_SRV_LNET_PID; + peer->pid = LNET_PID_LUSTRE; /* Choose the matching UUID that's closest */ while (lustre_uuid_to_peer(uuid->uuid, &dst_nid, count++) == 0) { @@ -524,7 +524,7 @@ static lnet_pid_t ptl_get_pid(void) { lnet_pid_t pid; - pid = LUSTRE_SRV_LNET_PID; + pid = LNET_PID_LUSTRE; return pid; } -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:01 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:01 -0500 Subject: [lustre-devel] [PATCH 25/40] staging: lustre: missed a few cases of using NULL instead of 0 In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-26-git-send-email-jsimmons@infradead.org> From: frank zago It is preferable to use NULL instead of 0 for pointers. This fixes sparse warnings such as: lustre/fld/fld_request.c:126:17: warning: Using plain integer as NULL pointer The second parameter of class_match_param() was changed to a const, to be able to remove a cast in one user, to prevent splitting a long line. No other code change. Signed-off-by: frank zago Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396 Reviewed-on: http://review.whamcloud.com/12567 Reviewed-by: Dmitry Eremin Reviewed-by: John L. Hammond Reviewed-by: Bob Glossman Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/api-ni.c | 2 +- drivers/staging/lustre/lustre/llite/llite_lib.c | 2 +- .../staging/lustre/lustre/obdclass/obd_config.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 7657f88..89b390a 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -902,7 +902,7 @@ lnet_ping_info_setup(lnet_ping_info_t **ppinfo, lnet_handle_md_t *md_handle, { lnet_process_id_t id = {LNET_NID_ANY, LNET_PID_ANY}; lnet_handle_me_t me_handle; - lnet_md_t md = {0}; + lnet_md_t md = { NULL }; int rc, rc2; if (set_eq) { diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c index 4a8c759..2109297 100644 --- a/drivers/staging/lustre/lustre/llite/llite_lib.c +++ b/drivers/staging/lustre/lustre/llite/llite_lib.c @@ -1941,7 +1941,7 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req, struct super_block *sb, struct lookup_intent *it) { struct ll_sb_info *sbi = NULL; - struct lustre_md md; + struct lustre_md md = { NULL }; int rc; LASSERT(*inode || sb); diff --git a/drivers/staging/lustre/lustre/obdclass/obd_config.c b/drivers/staging/lustre/lustre/obdclass/obd_config.c index c231e0d..db8e12d 100644 --- a/drivers/staging/lustre/lustre/obdclass/obd_config.c +++ b/drivers/staging/lustre/lustre/obdclass/obd_config.c @@ -72,7 +72,7 @@ EXPORT_SYMBOL(class_find_param); /* returns 0 if this is the first key in the buffer, else 1. valp points to first char after key. */ -static int class_match_param(char *buf, char *key, char **valp) +static int class_match_param(char *buf, const char *key, char **valp) { if (!buf) return 1; @@ -1008,7 +1008,7 @@ int class_process_proc_param(char *prefix, struct lprocfs_vars *lvars, /* Search proc entries */ while (lvars[j].name) { var = &lvars[j]; - if (class_match_param(key, (char *)var->name, NULL) == 0 + if (class_match_param(key, var->name, NULL) == 0 && keylen == strlen(var->name)) { matched++; rc = -EROFS; -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:08 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:08 -0500 Subject: [lustre-devel] [PATCH 32/40] staging: lustre: prevent assert on LNet module unload In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-33-git-send-email-jsimmons@infradead.org> From: Amir Shehata There is a use case where lnet can be unloaded while there are no NIs configured. Removing lnet in this case will cause LNetFini() to be called without a prior call to LNetNIFini(). This will cause the LASSERT(the_lnet.ln_refcount == 0) to be triggered. To deal with this use case when LNet is configured a reference count on the module is taken using try_module_get(). This way LNet must be unconfigured before it could be removed; therefore avoiding the above case. When LNet is unconfigured module_put() is called to return the reference count. Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6010 Reviewed-on: http://review.whamcloud.com/13110 Reviewed-by: James Simmons Reviewed-by: Doug Oucharek Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/module.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/module.c b/drivers/staging/lustre/lnet/lnet/module.c index 48eb085..b1f32a6 100644 --- a/drivers/staging/lustre/lnet/lnet/module.c +++ b/drivers/staging/lustre/lnet/lnet/module.c @@ -53,13 +53,21 @@ lnet_configure(void *arg) mutex_lock(&lnet_config_mutex); if (!the_lnet.ln_niinit_self) { + rc = try_module_get(THIS_MODULE); + + if (rc != 1) + goto out; + rc = LNetNIInit(LNET_PID_LUSTRE); if (rc >= 0) { the_lnet.ln_niinit_self = 1; rc = 0; + } else { + module_put(THIS_MODULE); } } +out: mutex_unlock(&lnet_config_mutex); return rc; } @@ -74,6 +82,7 @@ lnet_unconfigure(void) if (the_lnet.ln_niinit_self) { the_lnet.ln_niinit_self = 0; LNetNIFini(); + module_put(THIS_MODULE); } mutex_lock(&the_lnet.ln_api_mutex); -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:11 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:11 -0500 Subject: [lustre-devel] [PATCH 35/40] staging: lustre: avoid race during lnet acceptor thread termination In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-36-git-send-email-jsimmons@infradead.org> From: Bruno Faccini This patch will avoid potential race, around socket sleepers wait list, during acceptor thread termination and using sk_callback_lock RW-Lock protection. Signed-off-by: Bruno Faccini Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6476 Reviewed-on: http://review.whamcloud.com/14503 Reviewed-by: Amir Shehata Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/acceptor.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/acceptor.c b/drivers/staging/lustre/lnet/lnet/acceptor.c index ffa2b19..61806ce 100644 --- a/drivers/staging/lustre/lnet/lnet/acceptor.c +++ b/drivers/staging/lustre/lnet/lnet/acceptor.c @@ -485,11 +485,17 @@ lnet_acceptor_start(void) void lnet_acceptor_stop(void) { + struct sock *sk; + if (lnet_acceptor_state.pta_shutdown) /* not running */ return; lnet_acceptor_state.pta_shutdown = 1; - wake_up_all(sk_sleep(lnet_acceptor_state.pta_sock->sk)); + + sk = lnet_acceptor_state.pta_sock->sk; + + /* awake any sleepers using safe method */ + sk->sk_state_change(sk); /* block until acceptor signals exit */ wait_for_completion(&lnet_acceptor_state.pta_signal); -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:58 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:58 -0500 Subject: [lustre-devel] [PATCH 22/40] staging: lustre: Fixes to make lnetctl function as expected. In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-23-git-send-email-jsimmons@infradead.org> During testing of the lnetctl utility I ran into some issues. One of the problems is when you print out help for peer_credits you get help for stats. With this patch the help option for peer_credits is set to return the proper help message. The second problem was for grabbing stats data. No data was returned but instead it reported a error. The reason for this is that libcfs_ioctl_getdata() test to see if the size of the data passed in is less than the struct libcfs_ioctl_data in size. For the stats function its data structure struct lnet_ioctl_lnet_stats is smaller than what is allowed. Instead of checking if the data is less than libcfs_ioctl_data in size we check to ensure that the data is not smaller than the ioctl hdr data which is universal. The bug in libcfs_ioctl_getdata() exposed a bunch of cases with new ioctls that don't check to see if the data imported from userland equals the size reported in the ioctl hdr data. We address those cases in this patch as well. Signed-off-by: James Simmons Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5935 Reviewed-on: http://review.whamcloud.com/12782 Reviewed-by: Liang Zhen Reviewed-by: Doug Oucharek Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/api-ni.c | 36 ++++++++++++++++++++ .../lustre/lustre/libcfs/linux/linux-module.c | 2 +- 2 files changed, 37 insertions(+), 1 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index e40c657..7657f88 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1872,6 +1872,10 @@ LNetCtl(unsigned int cmd, void *arg) case IOC_LIBCFS_ADD_ROUTE: config = arg; + + if (config->cfg_hdr.ioc_len < sizeof(*config)) + return -EINVAL; + mutex_lock(&the_lnet.ln_api_mutex); rc = lnet_add_route(config->cfg_net, config->cfg_config_u.cfg_route.rtr_hop, @@ -1883,6 +1887,10 @@ LNetCtl(unsigned int cmd, void *arg) case IOC_LIBCFS_DEL_ROUTE: config = arg; + + if (config->cfg_hdr.ioc_len < sizeof(*config)) + return -EINVAL; + mutex_lock(&the_lnet.ln_api_mutex); rc = lnet_del_route(config->cfg_net, config->cfg_nid); mutex_unlock(&the_lnet.ln_api_mutex); @@ -1890,6 +1898,10 @@ LNetCtl(unsigned int cmd, void *arg) case IOC_LIBCFS_GET_ROUTE: config = arg; + + if (config->cfg_hdr.ioc_len < sizeof(*config)) + return -EINVAL; + return lnet_get_route(config->cfg_count, &config->cfg_net, &config->cfg_config_u.cfg_route.rtr_hop, @@ -1900,8 +1912,13 @@ LNetCtl(unsigned int cmd, void *arg) case IOC_LIBCFS_GET_NET: { struct lnet_ioctl_net_config *net_config; + size_t total = sizeof(*config) + sizeof(*net_config); config = arg; + + if (config->cfg_hdr.ioc_len < total) + return -EINVAL; + net_config = (struct lnet_ioctl_net_config *) config->cfg_bulk; if (!config || !net_config) @@ -1925,12 +1942,19 @@ LNetCtl(unsigned int cmd, void *arg) { struct lnet_ioctl_lnet_stats *lnet_stats = arg; + if (lnet_stats->st_hdr.ioc_len < sizeof(*lnet_stats)) + return -EINVAL; + lnet_counters_get(&lnet_stats->st_cntrs); return 0; } case IOC_LIBCFS_CONFIG_RTR: config = arg; + + if (config->cfg_hdr.ioc_len < sizeof(*config)) + return -EINVAL; + mutex_lock(&the_lnet.ln_api_mutex); if (config->cfg_config_u.cfg_buffers.buf_enable) { rc = lnet_rtrpools_enable(); @@ -1943,6 +1967,10 @@ LNetCtl(unsigned int cmd, void *arg) case IOC_LIBCFS_ADD_BUF: config = arg; + + if (config->cfg_hdr.ioc_len < sizeof(*config)) + return -EINVAL; + mutex_lock(&the_lnet.ln_api_mutex); rc = lnet_rtrpools_adjust(config->cfg_config_u.cfg_buffers. buf_tiny, @@ -1955,8 +1983,13 @@ LNetCtl(unsigned int cmd, void *arg) case IOC_LIBCFS_GET_BUF: { struct lnet_ioctl_pool_cfg *pool_cfg; + size_t total = sizeof(*config) + sizeof(*pool_cfg); config = arg; + + if (config->cfg_hdr.ioc_len < total) + return -EINVAL; + pool_cfg = (struct lnet_ioctl_pool_cfg *)config->cfg_bulk; return lnet_get_rtr_pool_cfg(config->cfg_count, pool_cfg); } @@ -1964,6 +1997,9 @@ LNetCtl(unsigned int cmd, void *arg) case IOC_LIBCFS_GET_PEER_INFO: { struct lnet_ioctl_peer *peer_info = arg; + if (peer_info->pr_hdr.ioc_len < sizeof(*peer_info)) + return -EINVAL; + return lnet_get_peer_info(peer_info->pr_count, &peer_info->pr_nid, peer_info->pr_lnd_u.pr_peer_credits.cr_aliveness, diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c index 50a5464..9414746 100644 --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-module.c @@ -73,7 +73,7 @@ int libcfs_ioctl_getdata(struct libcfs_ioctl_hdr **hdr_pp, return -EINVAL; } - if (hdr.ioc_len < sizeof(struct libcfs_ioctl_data)) { + if (hdr.ioc_len < sizeof(struct libcfs_ioctl_hdr)) { CERROR("libcfs ioctl: user buffer too small for ioctl\n"); return -EINVAL; } -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:00 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:00 -0500 Subject: [lustre-devel] [PATCH 24/40] staging: lustre: make some lnet functions static In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-25-git-send-email-jsimmons@infradead.org> From: frank zago Some functions and variables are only used in their C file, so reduce their scope. This reduces the code size, and fixes sparse warnings such as: warning: symbol 'proc_lnet_routes' was not declared. Should it be static? warning: symbol 'proc_lnet_routers' was not declared. Should it be static? Some prototypes were removed from C files and added to the proper header. Signed-off-by: Frank Zago Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5396 Reviewed-on: http://review.whamcloud.com/12206 Reviewed-by: James Simmons Reviewed-by: John L. Hammond Reviewed-by: Andreas Dilger --- .../staging/lustre/include/linux/lnet/lib-lnet.h | 2 ++ drivers/staging/lustre/lnet/lnet/router_proc.c | 2 -- drivers/staging/lustre/lnet/selftest/console.c | 4 +--- drivers/staging/lustre/lnet/selftest/framework.c | 10 ---------- drivers/staging/lustre/lnet/selftest/module.c | 4 +--- drivers/staging/lustre/lnet/selftest/rpc.c | 2 +- 6 files changed, 5 insertions(+), 19 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 4c2d824..00ef4d0 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -446,6 +446,8 @@ lnet_ni_t *lnet_nid2ni_locked(lnet_nid_t nid, int cpt); lnet_ni_t *lnet_net2ni_locked(__u32 net, int cpt); lnet_ni_t *lnet_net2ni(__u32 net); +extern int portal_rotor; + int lnet_init(void); void lnet_fini(void); diff --git a/drivers/staging/lustre/lnet/lnet/router_proc.c b/drivers/staging/lustre/lnet/lnet/router_proc.c index af7423f..73183f1 100644 --- a/drivers/staging/lustre/lnet/lnet/router_proc.c +++ b/drivers/staging/lustre/lnet/lnet/router_proc.c @@ -795,8 +795,6 @@ static struct lnet_portal_rotors portal_rotors[] = { }, }; -extern int portal_rotor; - static int __proc_lnet_portal_rotor(void *data, int write, loff_t pos, void __user *buffer, int nob) { diff --git a/drivers/staging/lustre/lnet/selftest/console.c b/drivers/staging/lustre/lnet/selftest/console.c index f8d6dfe..551d664 100644 --- a/drivers/staging/lustre/lnet/selftest/console.c +++ b/drivers/staging/lustre/lnet/selftest/console.c @@ -1694,8 +1694,6 @@ lstcon_new_session_id(lst_sid_t *sid) sid->ses_stamp = cfs_time_current(); } -extern srpc_service_t lstcon_acceptor_service; - int lstcon_session_new(char *name, int key, unsigned feats, int timeout, int force, lst_sid_t __user *sid_up) @@ -1974,7 +1972,7 @@ out: return rc; } -srpc_service_t lstcon_acceptor_service; +static srpc_service_t lstcon_acceptor_service; static void lstcon_init_acceptor_service(void) { /* initialize selftest console acceptor service table */ diff --git a/drivers/staging/lustre/lnet/selftest/framework.c b/drivers/staging/lustre/lnet/selftest/framework.c index 1a2da74..b04c147 100644 --- a/drivers/staging/lustre/lnet/selftest/framework.c +++ b/drivers/staging/lustre/lnet/selftest/framework.c @@ -1622,16 +1622,6 @@ static srpc_service_t sfw_services[] = { } }; -extern sfw_test_client_ops_t ping_test_client; -extern srpc_service_t ping_test_service; -extern void ping_init_test_client(void); -extern void ping_init_test_service(void); - -extern sfw_test_client_ops_t brw_test_client; -extern srpc_service_t brw_test_service; -extern void brw_init_test_client(void); -extern void brw_init_test_service(void); - int sfw_startup(void) { diff --git a/drivers/staging/lustre/lnet/selftest/module.c b/drivers/staging/lustre/lnet/selftest/module.c index 46cbdf0..91564e5 100644 --- a/drivers/staging/lustre/lnet/selftest/module.c +++ b/drivers/staging/lustre/lnet/selftest/module.c @@ -37,6 +37,7 @@ #define DEBUG_SUBSYSTEM S_LNET #include "selftest.h" +#include "console.h" enum { LST_INIT_NONE = 0, @@ -47,9 +48,6 @@ enum { LST_INIT_CONSOLE }; -extern int lstcon_console_init(void); -extern int lstcon_console_fini(void); - static int lst_init_step = LST_INIT_NONE; struct cfs_wi_sched *lst_sched_serial; diff --git a/drivers/staging/lustre/lnet/selftest/rpc.c b/drivers/staging/lustre/lnet/selftest/rpc.c index 2212199..9b823be 100644 --- a/drivers/staging/lustre/lnet/selftest/rpc.c +++ b/drivers/staging/lustre/lnet/selftest/rpc.c @@ -1082,7 +1082,7 @@ srpc_client_rpc_expired(void *data) spin_unlock(&srpc_data.rpc_glock); } -inline void +static void srpc_add_client_rpc_timer(srpc_client_rpc_t *rpc) { stt_timer_t *timer = &rpc->crpc_timer; -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:36:04 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:36:04 -0500 Subject: [lustre-devel] [PATCH 28/40] staging: lustre: return -EEXIST if NI is not unique In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-29-git-send-email-jsimmons@infradead.org> From: Amir Shehata Return -EEXIST and not -EINVAL when trying to add a network interface which is not unique. Some minor cleanup in api-ni.c Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5875 Reviewed-on: http://review.whamcloud.com/13056 Reviewed-by: Isaac Huang Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- drivers/staging/lustre/lnet/lnet/api-ni.c | 20 +++++++++----------- 1 files changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 9b00bc1..ed167c8 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -1213,7 +1213,7 @@ static int lnet_startup_lndni(struct lnet_ni *ni, __s32 peer_timeout, __s32 peer_cr, __s32 peer_buf_cr, __s32 credits) { - int rc = 0; + int rc = -EINVAL; __u32 lnd_type; lnd_t *lnd; struct lnet_tx_queue *tq; @@ -1231,19 +1231,19 @@ lnet_startup_lndni(struct lnet_ni *ni, __s32 peer_timeout, /* Make sure this new NI is unique. */ lnet_net_lock(LNET_LOCK_EX); - if (!lnet_net_unique(LNET_NIDNET(ni->ni_nid), &the_lnet.ln_nis)) { + rc = lnet_net_unique(LNET_NIDNET(ni->ni_nid), &the_lnet.ln_nis); + lnet_net_unlock(LNET_LOCK_EX); + if (!rc) { if (lnd_type == LOLND) { - lnet_net_unlock(LNET_LOCK_EX); lnet_ni_free(ni); return 0; } - lnet_net_unlock(LNET_LOCK_EX); CERROR("Net %s is not unique\n", libcfs_net2str(LNET_NIDNET(ni->ni_nid))); + rc = -EEXIST; goto failed0; } - lnet_net_unlock(LNET_LOCK_EX); mutex_lock(&the_lnet.ln_lnd_mutex); lnd = lnet_find_lnd_by_type(lnd_type); @@ -1259,6 +1259,7 @@ lnet_startup_lndni(struct lnet_ni *ni, __s32 peer_timeout, CERROR("Can't load LND %s, module %s, rc=%d\n", libcfs_lnd2str(lnd_type), libcfs_lnd2modname(lnd_type), rc); + rc = -EINVAL; goto failed0; } } @@ -1348,7 +1349,7 @@ lnet_startup_lndni(struct lnet_ni *ni, __s32 peer_timeout, return 0; failed0: lnet_ni_free(ni); - return -EINVAL; + return rc; } static int @@ -1495,7 +1496,7 @@ int LNetNIInit(lnet_pid_t requested_pid) { int im_a_router = 0; - int rc, rc2; + int rc; int ni_count; lnet_ping_info_t *pinfo; lnet_handle_md_t md_handle; @@ -1584,10 +1585,7 @@ LNetNIInit(lnet_pid_t requested_pid) return 0; failed4: - lnet_ping_md_unlink(pinfo, &md_handle); - lnet_ping_info_free(pinfo); - rc2 = LNetEQFree(the_lnet.ln_ping_target_eq); - LASSERT(rc2 == 0); + lnet_ping_target_fini(); failed3: the_lnet.ln_refcount = 0; lnet_acceptor_stop(); -- 1.7.1 From jsimmons at infradead.org Fri Nov 20 23:35:47 2015 From: jsimmons at infradead.org (James Simmons) Date: Fri, 20 Nov 2015 18:35:47 -0500 Subject: [lustre-devel] [PATCH 11/40] staging: lustre: DLC Feature dynamic net config In-Reply-To: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> Message-ID: <1448062576-23757-12-git-send-email-jsimmons@infradead.org> From: Amir Shehata This is the third patch of a set of patches that enables DLC. This patch adds the following features to LNET. Currently these features are not driven by user space. - Adding/Deleting Networks dynamically Two new functions were added: - lnet_dyn_add_ni() add an NI. if the NI is already added then fail with appropriate error code - lnet_dyn_del_ni() delete an existing NI. If NI doesn't exist fail with appropriate failure code. These functions shall be called from IOCTL. Signed-off-by: Amir Shehata Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-2456 Reviewed-on: http://review.whamcloud.com/9832 Reviewed-by: James Simmons Reviewed-by: Doug Oucharek Reviewed-by: Liang Zhen Reviewed-by: Oleg Drokin --- .../staging/lustre/include/linux/lnet/lib-lnet.h | 3 +- drivers/staging/lustre/lnet/lnet/api-ni.c | 795 +++++++++++++------- drivers/staging/lustre/lnet/lnet/config.c | 2 +- 3 files changed, 517 insertions(+), 283 deletions(-) diff --git a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h index 60accdf..94d0dc5 100644 --- a/drivers/staging/lustre/include/linux/lnet/lib-lnet.h +++ b/drivers/staging/lustre/include/linux/lnet/lib-lnet.h @@ -679,14 +679,13 @@ void lnet_router_checker_stop(void); void lnet_router_ni_update_locked(lnet_peer_t *gw, __u32 net); void lnet_swap_pinginfo(lnet_ping_info_t *info); -int lnet_ping_target_init(void); -void lnet_ping_target_fini(void); int lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t *ids, int n_ids); int lnet_parse_ip2nets(char **networksp, char *ip2nets); int lnet_parse_routes(char *route_str, int *im_a_router); int lnet_parse_networks(struct list_head *nilist, char *networks); +int lnet_net_unique(__u32 net, struct list_head *nilist); int lnet_nid2peer_locked(lnet_peer_t **lpp, lnet_nid_t nid, int cpt); lnet_peer_t *lnet_find_peer_locked(struct lnet_peer_table *ptable, diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c index 0338537..9661f6a 100644 --- a/drivers/staging/lustre/lnet/lnet/api-ni.c +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c @@ -528,6 +528,11 @@ lnet_prepare(lnet_pid_t requested_pid) struct lnet_res_container **recs; int rc = 0; + if (requested_pid == LNET_PID_ANY) { + /* Don't instantiate LNET just for me */ + return -ENETDOWN; + } + LASSERT(the_lnet.ln_refcount == 0); the_lnet.ln_routing = 0; @@ -813,6 +818,229 @@ lnet_count_acceptor_nis(void) return count; } +static lnet_ping_info_t * +lnet_ping_info_create(int num_ni) +{ + lnet_ping_info_t *ping_info; + unsigned int infosz; + + infosz = offsetof(lnet_ping_info_t, pi_ni[num_ni]); + LIBCFS_ALLOC(ping_info, infosz); + if (!ping_info) { + CERROR("Can't allocate ping info[%d]\n", num_ni); + return NULL; + } + + ping_info->pi_nnis = num_ni; + ping_info->pi_pid = the_lnet.ln_pid; + ping_info->pi_magic = LNET_PROTO_PING_MAGIC; + ping_info->pi_features = LNET_PING_FEAT_NI_STATUS; + + return ping_info; +} + +static inline int +lnet_get_ni_count(void) +{ + struct lnet_ni *ni; + int count = 0; + + lnet_net_lock(0); + + list_for_each_entry(ni, &the_lnet.ln_nis, ni_list) + count++; + + lnet_net_unlock(0); + + return count; +} + +static inline void +lnet_ping_info_free(lnet_ping_info_t *pinfo) +{ + LIBCFS_FREE(pinfo, + offsetof(lnet_ping_info_t, + pi_ni[pinfo->pi_nnis])); +} + +static void +lnet_ping_info_destroy(void) +{ + struct lnet_ni *ni; + + lnet_net_lock(LNET_LOCK_EX); + + list_for_each_entry(ni, &the_lnet.ln_nis, ni_list) { + lnet_ni_lock(ni); + ni->ni_status = NULL; + lnet_ni_unlock(ni); + } + + lnet_ping_info_free(the_lnet.ln_ping_info); + the_lnet.ln_ping_info = NULL; + + lnet_net_unlock(LNET_LOCK_EX); +} + +static void +lnet_ping_event_handler(lnet_event_t *event) +{ + lnet_ping_info_t *pinfo = event->md.user_ptr; + + if (event->unlinked) + pinfo->pi_features = LNET_PING_FEAT_INVAL; +} + +static int +lnet_ping_info_setup(lnet_ping_info_t **ppinfo, lnet_handle_md_t *md_handle, + int ni_count, bool set_eq) +{ + lnet_process_id_t id = {LNET_NID_ANY, LNET_PID_ANY}; + lnet_handle_me_t me_handle; + lnet_md_t md = {0}; + int rc, rc2; + + if (set_eq) { + rc = LNetEQAlloc(0, lnet_ping_event_handler, + &the_lnet.ln_ping_target_eq); + if (rc != 0) { + CERROR("Can't allocate ping EQ: %d\n", rc); + return rc; + } + } + + *ppinfo = lnet_ping_info_create(ni_count); + if (!*ppinfo) { + rc = -ENOMEM; + goto failed_0; + } + + rc = LNetMEAttach(LNET_RESERVED_PORTAL, id, + LNET_PROTO_PING_MATCHBITS, 0, + LNET_UNLINK, LNET_INS_AFTER, + &me_handle); + if (rc != 0) { + CERROR("Can't create ping ME: %d\n", rc); + goto failed_1; + } + + /* initialize md content */ + md.start = *ppinfo; + md.length = offsetof(lnet_ping_info_t, + pi_ni[(*ppinfo)->pi_nnis]); + md.threshold = LNET_MD_THRESH_INF; + md.max_size = 0; + md.options = LNET_MD_OP_GET | LNET_MD_TRUNCATE | + LNET_MD_MANAGE_REMOTE; + md.user_ptr = NULL; + md.eq_handle = the_lnet.ln_ping_target_eq; + md.user_ptr = *ppinfo; + + rc = LNetMDAttach(me_handle, md, LNET_RETAIN, md_handle); + if (rc != 0) { + CERROR("Can't attach ping MD: %d\n", rc); + goto failed_2; + } + + return 0; + +failed_2: + rc2 = LNetMEUnlink(me_handle); + LASSERT(rc2 == 0); +failed_1: + lnet_ping_info_free(*ppinfo); + *ppinfo = NULL; +failed_0: + if (set_eq) + LNetEQFree(the_lnet.ln_ping_target_eq); + return rc; +} + +static void +lnet_ping_md_unlink(lnet_ping_info_t *pinfo, lnet_handle_md_t *md_handle) +{ + sigset_t blocked = cfs_block_allsigs(); + + LNetMDUnlink(*md_handle); + LNetInvalidateHandle(md_handle); + + /* NB md could be busy; this just starts the unlink */ + while (pinfo->pi_features != LNET_PING_FEAT_INVAL) { + CDEBUG(D_NET, "Still waiting for ping MD to unlink\n"); + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(cfs_time_seconds(1)); + } + + cfs_restore_sigs(blocked); +} + +static void +lnet_ping_info_install_locked(lnet_ping_info_t *ping_info) +{ + lnet_ni_status_t *ns; + lnet_ni_t *ni; + int i = 0; + + list_for_each_entry(ni, &the_lnet.ln_nis, ni_list) { + LASSERT(i < ping_info->pi_nnis); + + ns = &ping_info->pi_ni[i]; + + ns->ns_nid = ni->ni_nid; + + lnet_ni_lock(ni); + ns->ns_status = (ni->ni_status) ? + ni->ni_status->ns_status : LNET_NI_STATUS_UP; + ni->ni_status = ns; + lnet_ni_unlock(ni); + + i++; + } +} + +static void +lnet_ping_target_update(lnet_ping_info_t *pinfo, lnet_handle_md_t md_handle) +{ + lnet_ping_info_t *old_pinfo = NULL; + lnet_handle_md_t old_md; + + /* switch the NIs to point to the new ping info created */ + lnet_net_lock(LNET_LOCK_EX); + + if (!the_lnet.ln_routing) + pinfo->pi_features |= LNET_PING_FEAT_RTE_DISABLED; + lnet_ping_info_install_locked(pinfo); + + if (the_lnet.ln_ping_info) { + old_pinfo = the_lnet.ln_ping_info; + old_md = the_lnet.ln_ping_target_md; + } + the_lnet.ln_ping_target_md = md_handle; + the_lnet.ln_ping_info = pinfo; + + lnet_net_unlock(LNET_LOCK_EX); + + if (old_pinfo) { + /* unlink the old ping info */ + lnet_ping_md_unlink(old_pinfo, &old_md); + lnet_ping_info_free(old_pinfo); + } +} + +static void +lnet_ping_target_fini(void) +{ + int rc; + + lnet_ping_md_unlink(the_lnet.ln_ping_info, + &the_lnet.ln_ping_target_md); + + rc = LNetEQFree(the_lnet.ln_ping_target_eq); + LASSERT(rc == 0); + + lnet_ping_info_destroy(); +} + static int lnet_ni_tq_credits(lnet_ni_t *ni) { @@ -831,12 +1059,74 @@ lnet_ni_tq_credits(lnet_ni_t *ni) } static void -lnet_shutdown_lndnis(void) +lnet_clear_zombies_nis_locked(void) { int i; int islo; lnet_ni_t *ni; + /* + * Now wait for the NI's I just nuked to show up on ln_zombie_nis + * and shut them down in guaranteed thread context + */ + i = 2; + while (!list_empty(&the_lnet.ln_nis_zombie)) { + int *ref; + int j; + + ni = list_entry(the_lnet.ln_nis_zombie.next, + lnet_ni_t, ni_list); + list_del_init(&ni->ni_list); + cfs_percpt_for_each(ref, j, ni->ni_refs) { + if (*ref == 0) + continue; + /* still busy, add it back to zombie list */ + list_add(&ni->ni_list, &the_lnet.ln_nis_zombie); + break; + } + + if (!list_empty(&ni->ni_list)) { + lnet_net_unlock(LNET_LOCK_EX); + ++i; + if ((i & (-i)) == i) { + CDEBUG(D_WARNING, "Waiting for zombie LNI %s\n", + libcfs_nid2str(ni->ni_nid)); + } + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(cfs_time_seconds(1)); + lnet_net_lock(LNET_LOCK_EX); + continue; + } + + ni->ni_lnd->lnd_refcount--; + lnet_net_unlock(LNET_LOCK_EX); + + islo = ni->ni_lnd->lnd_type == LOLND; + + LASSERT(!in_interrupt()); + ni->ni_lnd->lnd_shutdown(ni); + + /* + * can't deref lnd anymore now; it might have unregistered + * itself... + */ + if (!islo) + CDEBUG(D_LNI, "Removed LNI %s\n", + libcfs_nid2str(ni->ni_nid)); + + lnet_ni_free(ni); + i = 2; + + lnet_net_lock(LNET_LOCK_EX); + } +} + +static void +lnet_shutdown_lndnis(void) +{ + lnet_ni_t *ni; + int i; + /* NB called holding the global mutex */ /* All quiet on the API front */ @@ -850,7 +1140,7 @@ lnet_shutdown_lndnis(void) /* Unlink NIs from the global table */ while (!list_empty(&the_lnet.ln_nis)) { ni = list_entry(the_lnet.ln_nis.next, - lnet_ni_t, ni_list); + lnet_ni_t, ni_list); /* move it to zombie list and nobody can find it anymore */ list_move(&ni->ni_list, &the_lnet.ln_nis_zombie); lnet_ni_decref_locked(ni, 0); /* drop ln_nis' ref */ @@ -885,89 +1175,90 @@ lnet_shutdown_lndnis(void) lnet_peer_tables_cleanup(NULL); lnet_net_lock(LNET_LOCK_EX); - /* Now wait for the NI's I just nuked to show up on ln_zombie_nis - * and shut them down in guaranteed thread context */ - i = 2; - while (!list_empty(&the_lnet.ln_nis_zombie)) { - int *ref; - int j; - ni = list_entry(the_lnet.ln_nis_zombie.next, - lnet_ni_t, ni_list); - list_del_init(&ni->ni_list); - cfs_percpt_for_each(ref, j, ni->ni_refs) { - if (*ref == 0) - continue; - /* still busy, add it back to zombie list */ - list_add(&ni->ni_list, &the_lnet.ln_nis_zombie); - break; - } + lnet_clear_zombies_nis_locked(); + the_lnet.ln_shutdown = 0; + lnet_net_unlock(LNET_LOCK_EX); +} - if (!list_empty(&ni->ni_list)) { - lnet_net_unlock(LNET_LOCK_EX); - ++i; - if ((i & (-i)) == i) { - CDEBUG(D_WARNING, "Waiting for zombie LNI %s\n", - libcfs_nid2str(ni->ni_nid)); - } - set_current_state(TASK_UNINTERRUPTIBLE); - schedule_timeout(cfs_time_seconds(1)); - lnet_net_lock(LNET_LOCK_EX); - continue; - } +int +lnet_shutdown_lndni(__u32 net) +{ + lnet_ping_info_t *pinfo; + lnet_handle_md_t md_handle; + lnet_ni_t *found_ni = NULL; + int ni_count; + int rc; - ni->ni_lnd->lnd_refcount--; - lnet_net_unlock(LNET_LOCK_EX); + if (LNET_NETTYP(net) == LOLND) + return -EINVAL; - islo = ni->ni_lnd->lnd_type == LOLND; + ni_count = lnet_get_ni_count(); - LASSERT(!in_interrupt()); - (ni->ni_lnd->lnd_shutdown)(ni); + /* create and link a new ping info, before removing the old one */ + rc = lnet_ping_info_setup(&pinfo, &md_handle, ni_count - 1, false); + if (rc != 0) + return rc; - /* can't deref lnd anymore now; it might have unregistered - * itself... */ + /* proceed with shutting down the NI */ + lnet_net_lock(LNET_LOCK_EX); - if (!islo) - CDEBUG(D_LNI, "Removed LNI %s\n", - libcfs_nid2str(ni->ni_nid)); + found_ni = lnet_net2ni_locked(net, 0); + if (!found_ni) { + lnet_net_unlock(LNET_LOCK_EX); + lnet_ping_md_unlink(pinfo, &md_handle); + lnet_ping_info_free(pinfo); + return -EINVAL; + } - lnet_ni_free(ni); - i = 2; + /* + * decrement the reference counter on found_ni which was + * incremented when we called lnet_net2ni_locked() + */ + lnet_ni_decref_locked(found_ni, 0); + /* Move ni to zombie list so nobody can find it anymore */ + list_move(&found_ni->ni_list, &the_lnet.ln_nis_zombie); - lnet_net_lock(LNET_LOCK_EX); + /* Drop the lock reference for the ln_nis ref. */ + lnet_ni_decref_locked(found_ni, 0); + + if (!list_empty(&found_ni->ni_cptlist)) { + list_del_init(&found_ni->ni_cptlist); + lnet_ni_decref_locked(found_ni, 0); } - the_lnet.ln_shutdown = 0; lnet_net_unlock(LNET_LOCK_EX); + + /* Do peer table cleanup for this ni */ + lnet_peer_tables_cleanup(found_ni); + + lnet_net_lock(LNET_LOCK_EX); + lnet_clear_zombies_nis_locked(); + lnet_net_unlock(LNET_LOCK_EX); + + lnet_ping_target_update(pinfo, md_handle); + + return 0; } static int -lnet_startup_lndnis(void) +lnet_startup_lndnis(struct list_head *nilist, __s32 peer_timeout, + __s32 peer_cr, __s32 peer_buf_cr, __s32 credits, + int *ni_count) { lnd_t *lnd; struct lnet_ni *ni; struct lnet_tx_queue *tq; - struct list_head nilist; int i; int rc = 0; __u32 lnd_type; - int nicount = 0; - char *nets = lnet_get_networks(); - - INIT_LIST_HEAD(&nilist); - - if (nets == NULL) - goto failed; - - rc = lnet_parse_networks(&nilist, nets); - if (rc != 0) - goto failed; - while (!list_empty(&nilist)) { - ni = list_entry(nilist.next, lnet_ni_t, ni_list); + while (!list_empty(nilist)) { + ni = list_entry(nilist->next, lnet_ni_t, ni_list); lnd_type = LNET_NETTYP(LNET_NIDNET(ni->ni_nid)); - LASSERT(libcfs_isknown_lnd(lnd_type)); + if (!libcfs_isknown_lnd(lnd_type)) + goto failed; if (lnd_type == CIBLND || lnd_type == OPENIBLND || @@ -978,6 +1269,24 @@ lnet_startup_lndnis(void) goto failed; } + /* Make sure this new NI is unique. */ + lnet_net_lock(LNET_LOCK_EX); + if (!lnet_net_unique(LNET_NIDNET(ni->ni_nid), + &the_lnet.ln_nis)) { + if (lnd_type == LOLND) { + lnet_net_unlock(LNET_LOCK_EX); + list_del(&ni->ni_list); + lnet_ni_free(ni); + continue; + } + + CERROR("Net %s is not unique\n", + libcfs_net2str(LNET_NIDNET(ni->ni_nid))); + lnet_net_unlock(LNET_LOCK_EX); + goto failed; + } + lnet_net_unlock(LNET_LOCK_EX); + mutex_lock(&the_lnet.ln_lnd_mutex); lnd = lnet_find_lnd_by_type(lnd_type); @@ -1016,6 +1325,25 @@ lnet_startup_lndnis(void) goto failed; } + /* + * If given some LND tunable parameters, parse those now to + * override the values in the NI structure. + */ + if (peer_buf_cr >= 0) + ni->ni_peerrtrcredits = peer_buf_cr; + if (peer_timeout >= 0) + ni->ni_peertimeout = peer_timeout; + /* + * TODO + * Note: For now, don't allow the user to change + * peertxcredits as this number is used in the + * IB LND to control queue depth. + * if (peer_cr != -1) + * ni->ni_peertxcredits = peer_cr; + */ + if (credits >= 0) + ni->ni_maxtxcredits = credits; + LASSERT(ni->ni_peertimeout <= 0 || lnd->lnd_query != NULL); list_del(&ni->ni_list); @@ -1032,6 +1360,14 @@ lnet_startup_lndnis(void) lnet_net_unlock(LNET_LOCK_EX); + /* increment the ni_count here to account for the LOLND as + * well. If we increment past this point then the number + * of count will be missing the LOLND, and then ping and + * will not report the LOLND + */ + if (ni_count) + (*ni_count)++; + if (lnd->lnd_type == LOLND) { lnet_ni_addref(ni); LASSERT(the_lnet.ln_loni == NULL); @@ -1058,29 +1394,16 @@ lnet_startup_lndnis(void) libcfs_nid2str(ni->ni_nid), ni->ni_peertxcredits, lnet_ni_tq_credits(ni) * LNET_CPT_NUMBER, ni->ni_peerrtrcredits, ni->ni_peertimeout); - - nicount++; - } - - if (the_lnet.ln_eq_waitni != NULL && nicount > 1) { - lnd_type = the_lnet.ln_eq_waitni->ni_lnd->lnd_type; - LCONSOLE_ERROR_MSG(0x109, "LND %s can only run single-network\n", - libcfs_lnd2str(lnd_type)); - goto failed; } return 0; - - failed: - lnet_shutdown_lndnis(); - - while (!list_empty(&nilist)) { - ni = list_entry(nilist.next, lnet_ni_t, ni_list); +failed: + while (!list_empty(nilist)) { + ni = list_entry(nilist->next, lnet_ni_t, ni_list); list_del(&ni->ni_list); lnet_ni_free(ni); } - - return -ENETDOWN; + return -EINVAL; } /** @@ -1194,6 +1517,15 @@ LNetNIInit(lnet_pid_t requested_pid) { int im_a_router = 0; int rc; + int ni_count = 0; + int lnd_type; + struct lnet_ni *ni; + lnet_ping_info_t *pinfo; + lnet_handle_md_t md_handle; + struct list_head net_head; + char *nets; + + INIT_LIST_HEAD(&net_head); mutex_lock(&the_lnet.ln_api_mutex); @@ -1202,23 +1534,31 @@ LNetNIInit(lnet_pid_t requested_pid) if (the_lnet.ln_refcount > 0) { rc = the_lnet.ln_refcount++; - goto out; + mutex_unlock(&the_lnet.ln_api_mutex); + return rc; } - if (requested_pid == LNET_PID_ANY) { - /* Don't instantiate LNET just for me */ - rc = -ENETDOWN; - goto failed0; - } + nets = lnet_get_networks(); rc = lnet_prepare(requested_pid); if (rc != 0) goto failed0; - rc = lnet_startup_lndnis(); + rc = lnet_parse_networks(&net_head, nets); + if (rc < 0) + goto failed1; + + rc = lnet_startup_lndnis(&net_head, -1, -1, -1, -1, &ni_count); if (rc != 0) goto failed1; + if (the_lnet.ln_eq_waitni && ni_count > 1) { + lnd_type = the_lnet.ln_eq_waitni->ni_lnd->lnd_type; + LCONSOLE_ERROR_MSG(0x109, "LND %s can only run single-network\n", + libcfs_lnd2str(lnd_type)); + goto failed2; + } + rc = lnet_parse_routes(lnet_get_routes(), &im_a_router); if (rc != 0) goto failed2; @@ -1238,24 +1578,30 @@ LNetNIInit(lnet_pid_t requested_pid) the_lnet.ln_refcount = 1; /* Now I may use my own API functions... */ - /* NB router checker needs the_lnet.ln_ping_info in - * lnet_router_checker -> lnet_update_ni_status_locked */ - rc = lnet_ping_target_init(); + rc = lnet_ping_info_setup(&pinfo, &md_handle, ni_count, true); if (rc != 0) goto failed3; + lnet_ping_target_update(pinfo, md_handle); + rc = lnet_router_checker_start(); if (rc != 0) goto failed4; lnet_router_debugfs_init(); - goto out; + + mutex_unlock(&the_lnet.ln_api_mutex); + + return 0; failed4: - lnet_ping_target_fini(); - failed3: the_lnet.ln_refcount = 0; + lnet_ping_md_unlink(pinfo, &md_handle); + lnet_ping_info_free(pinfo); + failed3: lnet_acceptor_stop(); + rc = LNetEQFree(the_lnet.ln_ping_target_eq); + LASSERT(rc == 0); failed2: lnet_destroy_routes(); lnet_shutdown_lndnis(); @@ -1263,8 +1609,12 @@ LNetNIInit(lnet_pid_t requested_pid) lnet_unprepare(); failed0: LASSERT(rc < 0); - out: mutex_unlock(&the_lnet.ln_api_mutex); + while (!list_empty(&net_head)) { + ni = list_entry(net_head.next, struct lnet_ni, ni_list); + list_del_init(&ni->ni_list); + lnet_ni_free(ni); + } return rc; } EXPORT_SYMBOL(LNetNIInit); @@ -1309,6 +1659,71 @@ LNetNIFini(void) } EXPORT_SYMBOL(LNetNIFini); +int +lnet_dyn_add_ni(lnet_pid_t requested_pid, char *nets, + __s32 peer_timeout, __s32 peer_cr, __s32 peer_buf_cr, + __s32 credits) +{ + lnet_ping_info_t *pinfo; + lnet_handle_md_t md_handle; + struct lnet_ni *ni; + struct list_head net_head; + int rc; + + INIT_LIST_HEAD(&net_head); + + /* Create a ni structure for the network string */ + rc = lnet_parse_networks(&net_head, nets); + if (rc < 0) + return rc; + + mutex_lock(&the_lnet.ln_api_mutex); + + if (rc > 1) { + rc = -EINVAL; /* only add one interface per call */ + goto failed0; + } + + rc = lnet_ping_info_setup(&pinfo, &md_handle, 1 + lnet_get_ni_count(), + false); + if (rc != 0) + goto failed0; + + rc = lnet_startup_lndnis(&net_head, peer_timeout, peer_cr, + peer_buf_cr, credits, NULL); + if (rc != 0) + goto failed1; + + lnet_ping_target_update(pinfo, md_handle); + mutex_unlock(&the_lnet.ln_api_mutex); + + return 0; + +failed1: + lnet_ping_md_unlink(pinfo, &md_handle); + lnet_ping_info_free(pinfo); +failed0: + mutex_unlock(&the_lnet.ln_api_mutex); + while (!list_empty(&net_head)) { + ni = list_entry(net_head.next, struct lnet_ni, ni_list); + list_del_init(&ni->ni_list); + lnet_ni_free(ni); + } + return rc; +} + +int +lnet_dyn_del_ni(__u32 net) +{ + int rc; + + mutex_lock(&the_lnet.ln_api_mutex); + rc = lnet_shutdown_lndni(net); + mutex_unlock(&the_lnet.ln_api_mutex); + + return rc; +} + /** * This is an ugly hack to export IOC_LIBCFS_DEBUG_PEER and * IOC_LIBCFS_PORTALS_COMPATIBILITY commands to users, by tweaking the LNet @@ -1332,7 +1747,6 @@ LNetCtl(unsigned int cmd, void *arg) unsigned long secs_passed; LASSERT(the_lnet.ln_init); - LASSERT(the_lnet.ln_refcount > 0); switch (cmd) { case IOC_LIBCFS_GET_NI: @@ -1344,12 +1758,17 @@ LNetCtl(unsigned int cmd, void *arg) return lnet_fail_nid(data->ioc_nid, data->ioc_count); case IOC_LIBCFS_ADD_ROUTE: + mutex_lock(&the_lnet.ln_api_mutex); rc = lnet_add_route(data->ioc_net, data->ioc_count, data->ioc_nid, data->ioc_priority); + mutex_unlock(&the_lnet.ln_api_mutex); return (rc != 0) ? rc : lnet_check_routes(); case IOC_LIBCFS_DEL_ROUTE: - return lnet_del_route(data->ioc_net, data->ioc_nid); + mutex_lock(&the_lnet.ln_api_mutex); + rc = lnet_del_route(data->ioc_net, data->ioc_nid); + mutex_unlock(&the_lnet.ln_api_mutex); + return rc; case IOC_LIBCFS_GET_ROUTE: return lnet_get_route(data->ioc_count, @@ -1485,192 +1904,6 @@ LNetSnprintHandle(char *str, int len, lnet_handle_any_t h) } EXPORT_SYMBOL(LNetSnprintHandle); -static int -lnet_create_ping_info(void) -{ - int i; - int n; - int rc; - unsigned int infosz; - lnet_ni_t *ni; - lnet_process_id_t id; - lnet_ping_info_t *pinfo; - - for (n = 0; ; n++) { - rc = LNetGetId(n, &id); - if (rc == -ENOENT) - break; - - LASSERT(rc == 0); - } - - infosz = offsetof(lnet_ping_info_t, pi_ni[n]); - LIBCFS_ALLOC(pinfo, infosz); - if (pinfo == NULL) { - CERROR("Can't allocate ping info[%d]\n", n); - return -ENOMEM; - } - - pinfo->pi_nnis = n; - pinfo->pi_pid = the_lnet.ln_pid; - pinfo->pi_magic = LNET_PROTO_PING_MAGIC; - pinfo->pi_features = LNET_PING_FEAT_NI_STATUS; - if (!the_lnet.ln_routing) - pinfo->pi_features |= LNET_PING_FEAT_RTE_DISABLED; - - for (i = 0; i < n; i++) { - lnet_ni_status_t *ns = &pinfo->pi_ni[i]; - - rc = LNetGetId(i, &id); - LASSERT(rc == 0); - - ns->ns_nid = id.nid; - ns->ns_status = LNET_NI_STATUS_UP; - - lnet_net_lock(0); - - ni = lnet_nid2ni_locked(id.nid, 0); - LASSERT(ni != NULL); - - lnet_ni_lock(ni); - LASSERT(ni->ni_status == NULL); - ni->ni_status = ns; - lnet_ni_unlock(ni); - - lnet_ni_decref_locked(ni, 0); - lnet_net_unlock(0); - } - - the_lnet.ln_ping_info = pinfo; - return 0; -} - -static void -lnet_destroy_ping_info(void) -{ - struct lnet_ni *ni; - - lnet_net_lock(0); - - list_for_each_entry(ni, &the_lnet.ln_nis, ni_list) { - lnet_ni_lock(ni); - ni->ni_status = NULL; - lnet_ni_unlock(ni); - } - - lnet_net_unlock(0); - - LIBCFS_FREE(the_lnet.ln_ping_info, - offsetof(lnet_ping_info_t, - pi_ni[the_lnet.ln_ping_info->pi_nnis])); - the_lnet.ln_ping_info = NULL; -} - -int -lnet_ping_target_init(void) -{ - lnet_md_t md = { NULL }; - lnet_handle_me_t meh; - lnet_process_id_t id; - int rc; - int rc2; - int infosz; - - rc = lnet_create_ping_info(); - if (rc != 0) - return rc; - - /* We can have a tiny EQ since we only need to see the unlink event on - * teardown, which by definition is the last one! */ - rc = LNetEQAlloc(2, LNET_EQ_HANDLER_NONE, &the_lnet.ln_ping_target_eq); - if (rc != 0) { - CERROR("Can't allocate ping EQ: %d\n", rc); - goto failed_0; - } - - memset(&id, 0, sizeof(lnet_process_id_t)); - id.nid = LNET_NID_ANY; - id.pid = LNET_PID_ANY; - - rc = LNetMEAttach(LNET_RESERVED_PORTAL, id, - LNET_PROTO_PING_MATCHBITS, 0, - LNET_UNLINK, LNET_INS_AFTER, - &meh); - if (rc != 0) { - CERROR("Can't create ping ME: %d\n", rc); - goto failed_1; - } - - /* initialize md content */ - infosz = offsetof(lnet_ping_info_t, - pi_ni[the_lnet.ln_ping_info->pi_nnis]); - md.start = the_lnet.ln_ping_info; - md.length = infosz; - md.threshold = LNET_MD_THRESH_INF; - md.max_size = 0; - md.options = LNET_MD_OP_GET | LNET_MD_TRUNCATE | - LNET_MD_MANAGE_REMOTE; - md.user_ptr = NULL; - md.eq_handle = the_lnet.ln_ping_target_eq; - - rc = LNetMDAttach(meh, md, - LNET_RETAIN, - &the_lnet.ln_ping_target_md); - if (rc != 0) { - CERROR("Can't attach ping MD: %d\n", rc); - goto failed_2; - } - - return 0; - - failed_2: - rc2 = LNetMEUnlink(meh); - LASSERT(rc2 == 0); - failed_1: - rc2 = LNetEQFree(the_lnet.ln_ping_target_eq); - LASSERT(rc2 == 0); - failed_0: - lnet_destroy_ping_info(); - return rc; -} - -void -lnet_ping_target_fini(void) -{ - lnet_event_t event; - int rc; - int which; - int timeout_ms = 1000; - sigset_t blocked = cfs_block_allsigs(); - - LNetMDUnlink(the_lnet.ln_ping_target_md); - /* NB md could be busy; this just starts the unlink */ - - for (;;) { - rc = LNetEQPoll(&the_lnet.ln_ping_target_eq, 1, - timeout_ms, &event, &which); - - /* I expect overflow... */ - LASSERT(rc >= 0 || rc == -EOVERFLOW); - - if (rc == 0) { - /* timed out: provide a diagnostic */ - CWARN("Still waiting for ping MD to unlink\n"); - timeout_ms *= 2; - continue; - } - - /* Got a valid event */ - if (event.unlinked) - break; - } - - rc = LNetEQFree(the_lnet.ln_ping_target_eq); - LASSERT(rc == 0); - lnet_destroy_ping_info(); - cfs_restore_sigs(blocked); -} - int lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t *ids, int n_ids) { @@ -1682,7 +1915,7 @@ lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t *ids, int n_id int unlinked = 0; int replied = 0; const int a_long_time = 60000; /* mS */ - int infosz = offsetof(lnet_ping_info_t, pi_ni[n_ids]); + int infosz; lnet_ping_info_t *info; lnet_process_id_t tmpid; int i; @@ -1691,6 +1924,8 @@ lnet_ping(lnet_process_id_t id, int timeout_ms, lnet_process_id_t *ids, int n_id int rc2; sigset_t blocked; + infosz = offsetof(lnet_ping_info_t, pi_ni[n_ids]); + if (n_ids <= 0 || id.nid == LNET_NID_ANY || timeout_ms > 500000 || /* arbitrary limit! */ diff --git a/drivers/staging/lustre/lnet/lnet/config.c b/drivers/staging/lustre/lnet/lnet/config.c index 7bb140b..1c7ad7c 100644 --- a/drivers/staging/lustre/lnet/lnet/config.c +++ b/drivers/staging/lustre/lnet/lnet/config.c @@ -77,7 +77,7 @@ lnet_issep(char c) } } -static int +int lnet_net_unique(__u32 net, struct list_head *nilist) { struct list_head *tmp; -- 1.7.1 From pauldaviesc at gmail.com Sat Nov 21 08:26:30 2015 From: pauldaviesc at gmail.com (Paul Davies C) Date: Sat, 21 Nov 2015 13:56:30 +0530 Subject: [lustre-devel] [PATCH] staging: lustre: lov: Fix sparse warning Message-ID: <56502ab9.8e4b620a.55593.5357@mx.google.com> This patch fixes the following warnings:- drivers/staging/lustre/lustre/lov/lov_object.c:926:22: warning: symbol 'lov_lsm_get' was not declared. Should it be static? drivers/staging/lustre/lustre/lov/lov_object.c:942:6: warning: symbol 'lov_lsm_put' was not declared. Should it be static? Signed-off-by: Paul Davies C --- drivers/staging/lustre/lustre/lov/lov_object.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c index c7ff817..a667336 100644 --- a/drivers/staging/lustre/lustre/lov/lov_object.c +++ b/drivers/staging/lustre/lustre/lov/lov_object.c @@ -923,7 +923,7 @@ static struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov) return lsm; } -struct lov_stripe_md *lov_lsm_get(struct cl_object *clobj) +static struct lov_stripe_md *lov_lsm_get(struct cl_object *clobj) { struct lu_object *luobj; struct lov_stripe_md *lsm = NULL; @@ -939,7 +939,7 @@ struct lov_stripe_md *lov_lsm_get(struct cl_object *clobj) } EXPORT_SYMBOL(lov_lsm_get); -void lov_lsm_put(struct cl_object *unused, struct lov_stripe_md *lsm) +static void lov_lsm_put(struct cl_object *unused, struct lov_stripe_md *lsm) { if (lsm != NULL) lov_free_memmd(&lsm); -- 1.9.1 From oleg.drokin at intel.com Sat Nov 21 15:09:22 2015 From: oleg.drokin at intel.com (Drokin, Oleg) Date: Sat, 21 Nov 2015 15:09:22 +0000 Subject: [lustre-devel] [PATCH] staging: lustre: lov: Fix sparse warning In-Reply-To: <56502ab9.8e4b620a.55593.5357@mx.google.com> References: <56502ab9.8e4b620a.55593.5357@mx.google.com> Message-ID: <6F4A320D-0C7C-4F7F-B3AD-D241A22F6F51@intel.com> Hello! On Nov 21, 2015, at 3:26 AM, Paul Davies C wrote: > This patch fixes the following warnings:- > > drivers/staging/lustre/lustre/lov/lov_object.c:926:22: warning: symbol 'lov_lsm_get' was not declared. Should it be static? > drivers/staging/lustre/lustre/lov/lov_object.c:942:6: warning: symbol 'lov_lsm_put' was not declared. Should it be static? > > Signed-off-by: Paul Davies C > --- > drivers/staging/lustre/lustre/lov/lov_object.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/lustre/lustre/lov/lov_object.c b/drivers/staging/lustre/lustre/lov/lov_object.c > index c7ff817..a667336 100644 > --- a/drivers/staging/lustre/lustre/lov/lov_object.c > +++ b/drivers/staging/lustre/lustre/lov/lov_object.c > @@ -923,7 +923,7 @@ static struct lov_stripe_md *lov_lsm_addref(struct lov_object *lov) > return lsm; > } > > -struct lov_stripe_md *lov_lsm_get(struct cl_object *clobj) > +static struct lov_stripe_md *lov_lsm_get(struct cl_object *clobj) > { > struct lu_object *luobj; > struct lov_stripe_md *lsm = NULL; > @@ -939,7 +939,7 @@ struct lov_stripe_md *lov_lsm_get(struct cl_object *clobj) > } > EXPORT_SYMBOL(lov_lsm_get); You did not compile-tested this, did you? This symbol is still used in lustre/lclient/lcommon_cl.c but also leaving EXPORT_SYMBOL intact for a static symbol? > > -void lov_lsm_put(struct cl_object *unused, struct lov_stripe_md *lsm) > +static void lov_lsm_put(struct cl_object *unused, struct lov_stripe_md *lsm) > { > if (lsm != NULL) > lov_free_memmd(&lsm); > -- > 1.9.1 > From dan.carpenter at oracle.com Sat Nov 21 18:45:36 2015 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Sat, 21 Nov 2015 21:45:36 +0300 Subject: [lustre-devel] [PATCH 06/40] staging: lustre: remove uses of IS_ERR_VALUE() In-Reply-To: <1448062576-23757-7-git-send-email-jsimmons@infradead.org> References: <1448062576-23757-1-git-send-email-jsimmons@infradead.org> <1448062576-23757-7-git-send-email-jsimmons@infradead.org> Message-ID: <20151121184536.GY18797@mwanda> On Fri, Nov 20, 2015 at 06:35:42PM -0500, James Simmons wrote: > @@ -1577,15 +1578,20 @@ static int mdc_ioc_changelog_send(struct obd_device *obd, > * New thread because we should return to user app before > * writing into our pipe > */ > - rc = PTR_ERR(kthread_run(mdc_changelog_send_thread, cs, > - "mdc_clg_send_thread")); > - if (!IS_ERR_VALUE(rc)) { > - CDEBUG(D_CHANGELOG, "start changelog thread\n"); > - return 0; > + task = kthread_run(mdc_changelog_send_thread, cs, > + "mdc_clg_send_thread"); > + if (IS_ERR(task)) { > + rc = PTR_ERR(task); > + CERROR("%s: can't start changelog thread: rc = %d\n", > + obd->obd_name, rc); > + kfree(cs); > + } else { > + rc = 0; > + CDEBUG(D_CHANGELOG, "%s: started changelog thread\n", > + obd->obd_name); > } > > CERROR("Failed to start changelog thread: %d\n", rc); > - kfree(cs); > return rc; > } > This will print an error when it succeeds. It better to keep the error path and the success path as separate as possible. For the normal case, the success path is at indent level 1 and the fail path is at indent level 2. Like this: ret = one(); if (ret) return ret; ret = two(); if (ret) return ret; return 0; When it's written that way it is: success; if (ret) fail_path; success; if (ret) fail_path; success; The current code looks like: success; if (ret) { fail; } else { success; } mixed; You see what I mean? Ideally the function should look like a list of directives in a row at indent level 1 with only minimal indenting for errors. regards, dan carpenter From mahfouz.saif.elyazal at gmail.com Mon Nov 23 21:42:34 2015 From: mahfouz.saif.elyazal at gmail.com (Aya Mahfouz) Date: Mon, 23 Nov 2015 23:42:34 +0200 Subject: [lustre-devel] [PATCH] staging: lustre: ptlrpc: constify ptlrpc_sec_cops structs Message-ID: <20151123214234.GA9568@waves> Constifies ptlrpc_sec_cops structures in the lustre driver since they are not modified after their initialization. Detected and found using Coccinelle. Suggested-by: Julia Lawall Signed-off-by: Aya Mahfouz --- drivers/staging/lustre/lustre/ptlrpc/sec.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_null.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_plain.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec.c b/drivers/staging/lustre/lustre/ptlrpc/sec.c index 39f5261..f959897 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec.c @@ -1580,7 +1580,7 @@ int sptlrpc_cli_enlarge_reqbuf(struct ptlrpc_request *req, int segment, int newsize) { struct ptlrpc_cli_ctx *ctx = req->rq_cli_ctx; - struct ptlrpc_sec_cops *cops; + const struct ptlrpc_sec_cops *cops; struct lustre_msg *msg = req->rq_reqmsg; LASSERT(ctx); diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c index ebfa609..ffdad15 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c @@ -378,7 +378,7 @@ static struct ptlrpc_ctx_ops null_ctx_ops = { .verify = null_ctx_verify, }; -static struct ptlrpc_sec_cops null_sec_cops = { +static const struct ptlrpc_sec_cops null_sec_cops = { .create_sec = null_create_sec, .destroy_sec = null_destroy_sec, .lookup_ctx = null_lookup_ctx, diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c b/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c index f448b45..71351de 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c @@ -956,7 +956,7 @@ static struct ptlrpc_ctx_ops plain_ctx_ops = { .unwrap_bulk = plain_cli_unwrap_bulk, }; -static struct ptlrpc_sec_cops plain_sec_cops = { +static const struct ptlrpc_sec_cops plain_sec_cops = { .create_sec = plain_create_sec, .destroy_sec = plain_destroy_sec, .kill_sec = plain_kill_sec, -- 2.4.3 -- Kind Regards, Aya Saif El-yazal Mahfouz From lkp at intel.com Mon Nov 23 22:10:08 2015 From: lkp at intel.com (kbuild test robot) Date: Tue, 24 Nov 2015 06:10:08 +0800 Subject: [lustre-devel] [PATCH] staging: lustre: ptlrpc: constify ptlrpc_sec_cops structs In-Reply-To: <20151123214234.GA9568@waves> Message-ID: <201511240637.yUtwbW4T%fengguang.wu@intel.com> Hi Aya, [auto build test WARNING on staging/staging-testing] [also build test WARNING on v4.4-rc2 next-20151123] url: https://github.com/0day-ci/linux/commits/Aya-Mahfouz/staging-lustre-ptlrpc-constify-ptlrpc_sec_cops-structs/20151124-054437 config: tile-allyesconfig (attached as .config) reproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=tile All warnings (new ones prefixed by >>): >> drivers/staging/lustre/lustre/ptlrpc/sec_null.c:404:2: warning: initialization discards 'const' qualifier from pointer target type [enabled by default] vim +/const +404 drivers/staging/lustre/lustre/ptlrpc/sec_null.c d7e09d039 Peng Tao 2013-05-02 388 .free_reqbuf = null_free_reqbuf, d7e09d039 Peng Tao 2013-05-02 389 .free_repbuf = null_free_repbuf, d7e09d039 Peng Tao 2013-05-02 390 .enlarge_reqbuf = null_enlarge_reqbuf, d7e09d039 Peng Tao 2013-05-02 391 }; d7e09d039 Peng Tao 2013-05-02 392 d7e09d039 Peng Tao 2013-05-02 393 static struct ptlrpc_sec_sops null_sec_sops = { d7e09d039 Peng Tao 2013-05-02 394 .accept = null_accept, d7e09d039 Peng Tao 2013-05-02 395 .alloc_rs = null_alloc_rs, d7e09d039 Peng Tao 2013-05-02 396 .authorize = null_authorize, d7e09d039 Peng Tao 2013-05-02 397 .free_rs = null_free_rs, d7e09d039 Peng Tao 2013-05-02 398 }; d7e09d039 Peng Tao 2013-05-02 399 d7e09d039 Peng Tao 2013-05-02 400 static struct ptlrpc_sec_policy null_policy = { d7e09d039 Peng Tao 2013-05-02 401 .sp_owner = THIS_MODULE, d7e09d039 Peng Tao 2013-05-02 402 .sp_name = "sec.null", d7e09d039 Peng Tao 2013-05-02 403 .sp_policy = SPTLRPC_POLICY_NULL, d7e09d039 Peng Tao 2013-05-02 @404 .sp_cops = &null_sec_cops, d7e09d039 Peng Tao 2013-05-02 405 .sp_sops = &null_sec_sops, d7e09d039 Peng Tao 2013-05-02 406 }; d7e09d039 Peng Tao 2013-05-02 407 d7e09d039 Peng Tao 2013-05-02 408 static void null_init_internal(void) d7e09d039 Peng Tao 2013-05-02 409 { d7e09d039 Peng Tao 2013-05-02 410 static HLIST_HEAD(__list); d7e09d039 Peng Tao 2013-05-02 411 d7e09d039 Peng Tao 2013-05-02 412 null_sec.ps_policy = &null_policy; :::::: The code at line 404 was first introduced by commit :::::: d7e09d0397e84eefbabfd9cb353221f3c6448d83 staging: add Lustre file system client support :::::: TO: Peng Tao :::::: CC: Greg Kroah-Hartman --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation -------------- next part -------------- A non-text attachment was scrubbed... Name: .config.gz Type: application/octet-stream Size: 42380 bytes Desc: not available URL: From andreas.dilger at intel.com Mon Nov 23 23:37:19 2015 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Mon, 23 Nov 2015 23:37:19 +0000 Subject: [lustre-devel] Future of Lustre in staging In-Reply-To: References: <564F0754.10500@gmail.com> Message-ID: On 2015/11/20, 06:30, "Denis Kirjanov" wrote: >On 11/20/15, Xose Vazquez Perez wrote: >> Hi, >> >> From https://lwn.net/Articles/662979/ >> >> --cut-- >> Christoph complained a bit about the staging tree. He said that it >> breaks allmodconfig builds, but that problem was evidently fixed a while >> ago. He also dislikes the Lustre filesystem, which has been in staging >> for some time now; Greg agreed and said that he would like to delete it. >> It was generally agreed that the work being done on Lustre is not >> substantial enough to justify its continued presence. Christoph also >> said that the use of the staging tree for code that is about to be >> deleted could be improved; there are, he said, people doing white-space >> fixes on doomed code. >> --end-- >> >> Could anyone clarify it? > >AFAIK, Intel is going to work more harder on Lustre code, so the best >option would be to wait a bit. >Agreed, checkpatch fixes are just a mess.. I think it is important to note that it isn't just Intel working on this code, but also ORNL, Cray, Indiana University, and others. As for build breakage pf Lustre in staging, more often as not that is due to patches landing outside of staging that cause Lustre builds to break. That isn't really something that we can control while Lustre is in the staging branch if that isn't required for normal builds. The zero-day patch bot has been good at catching those issues, and we've been good at submitting fixes quickly, so I don't think it is a huge problem. Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel High Performance Data Division From gregkh at linuxfoundation.org Wed Nov 25 16:39:01 2015 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Wed, 25 Nov 2015 08:39:01 -0800 Subject: [lustre-devel] [PATCH 3/3] staging: lustre: Less function calls in class_register_type() after error detection In-Reply-To: <563B4991.90005@users.sourceforge.net> References: <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <563B473C.5090508@users.sourceforge.net> <563B4991.90005@users.sourceforge.net> Message-ID: <20151125163901.GA7368@kroah.com> On Thu, Nov 05, 2015 at 01:20:33PM +0100, SF Markus Elfring wrote: > From: Markus Elfring > Date: Thu, 5 Nov 2015 12:48:58 +0100 > > The functions "kfree" and "kobject_put" were called in a few cases by the > function "class_register_type" during error handling even if the passed > variable contained a null pointer. > > This implementation detail could be improved by the adjustment of > jump targets. > > Signed-off-by: Markus Elfring > --- > drivers/staging/lustre/lustre/obdclass/genops.c | 26 +++++++++++++++---------- > 1 file changed, 16 insertions(+), 10 deletions(-) Does not apply to my staging-next branch :( From elfring at users.sourceforge.net Thu Nov 26 07:08:28 2015 From: elfring at users.sourceforge.net (SF Markus Elfring) Date: Thu, 26 Nov 2015 08:08:28 +0100 Subject: [lustre-devel] [PATCH 3/3] staging: lustre: Less function calls in class_register_type() after error detection In-Reply-To: <20151125163901.GA7368@kroah.com> References: <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <563B473C.5090508@users.sourceforge.net> <563B4991.90005@users.sourceforge.net> <20151125163901.GA7368@kroah.com> Message-ID: <5656AFEC.8030709@users.sourceforge.net> Am 25.11.2015 um 17:39 schrieb Greg Kroah-Hartman: > On Thu, Nov 05, 2015 at 01:20:33PM +0100, SF Markus Elfring wrote: >> From: Markus Elfring >> Date: Thu, 5 Nov 2015 12:48:58 +0100 >> >> The functions "kfree" and "kobject_put" were called in a few cases by the >> function "class_register_type" during error handling even if the passed >> variable contained a null pointer. >> >> This implementation detail could be improved by the adjustment of >> jump targets. >> >> Signed-off-by: Markus Elfring >> --- >> drivers/staging/lustre/lustre/obdclass/genops.c | 26 +++++++++++++++---------- >> 1 file changed, 16 insertions(+), 10 deletions(-) > > Does not apply to my staging-next branch :( I get also a result like the following together with the software "Linux next-20151126". ;-) elfring at Sonne:~/Projekte/Linux/next-patched> LANG=C git apply ~/Projekte/Bau/Linux/scripts/Coccinelle/deletions1/next/20151102/Flicken/0003-staging-lustre-Less-function-calls-in-class_register.patch error: patch failed: drivers/staging/lustre/lustre/obdclass/genops.c:214 error: drivers/staging/lustre/lustre/obdclass/genops.c: patch does not apply Do you try this update suggestion out without integrating the corresponding previous update suggestion "Delete unnecessary checks before two function calls" where I proposed to remove extra checks before a few calls of the function "kobject_put" (which seems to matter for the patch hunk in the shown error message)? https://lkml.org/lkml/2015/11/5/276 https://www.mail-archive.com/linux-kernel at vger.kernel.org/msg1013635.html Would you like to reject the first update step from this patch series so that I need to adapt my approach to your software design decision? Regards, Markus From gregkh at linuxfoundation.org Thu Nov 26 16:53:31 2015 From: gregkh at linuxfoundation.org (Greg Kroah-Hartman) Date: Thu, 26 Nov 2015 08:53:31 -0800 Subject: [lustre-devel] [PATCH 3/3] staging: lustre: Less function calls in class_register_type() after error detection In-Reply-To: <5656AFEC.8030709@users.sourceforge.net> References: <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <563B473C.5090508@users.sourceforge.net> <563B4991.90005@users.sourceforge.net> <20151125163901.GA7368@kroah.com> <5656AFEC.8030709@users.sourceforge.net> Message-ID: <20151126165331.GA7882@kroah.com> On Thu, Nov 26, 2015 at 08:08:28AM +0100, SF Markus Elfring wrote: > Am 25.11.2015 um 17:39 schrieb Greg Kroah-Hartman: > > On Thu, Nov 05, 2015 at 01:20:33PM +0100, SF Markus Elfring wrote: > >> From: Markus Elfring > >> Date: Thu, 5 Nov 2015 12:48:58 +0100 > >> > >> The functions "kfree" and "kobject_put" were called in a few cases by the > >> function "class_register_type" during error handling even if the passed > >> variable contained a null pointer. > >> > >> This implementation detail could be improved by the adjustment of > >> jump targets. > >> > >> Signed-off-by: Markus Elfring > >> --- > >> drivers/staging/lustre/lustre/obdclass/genops.c | 26 +++++++++++++++---------- > >> 1 file changed, 16 insertions(+), 10 deletions(-) > > > > Does not apply to my staging-next branch :( > > I get also a result like the following together with the software "Linux next-20151126". ;-) > > elfring at Sonne:~/Projekte/Linux/next-patched> LANG=C git apply ~/Projekte/Bau/Linux/scripts/Coccinelle/deletions1/next/20151102/Flicken/0003-staging-lustre-Less-function-calls-in-class_register.patch > error: patch failed: drivers/staging/lustre/lustre/obdclass/genops.c:214 > error: drivers/staging/lustre/lustre/obdclass/genops.c: patch does not apply > > > Do you try this update suggestion out without integrating the corresponding previous > update suggestion "Delete unnecessary checks before two function calls" > where I proposed to remove extra checks before a few calls of the function "kobject_put" > (which seems to matter for the patch hunk in the shown error message)? > https://lkml.org/lkml/2015/11/5/276 > https://www.mail-archive.com/linux-kernel at vger.kernel.org/msg1013635.html I guess so, I don't remember, I don't see any patches from you earlier in my "todo" mbox. > Would you like to reject the first update step from this patch series > so that I need to adapt my approach to your software design decision? I have no idea what you are talking about. I have no recolection of previous patches or conversations about your patches. greg k-h From elfring at users.sourceforge.net Thu Nov 26 19:02:21 2015 From: elfring at users.sourceforge.net (SF Markus Elfring) Date: Thu, 26 Nov 2015 20:02:21 +0100 Subject: [lustre-devel] [PATCH 3/3] staging: lustre: Less function calls in class_register_type() after error detection In-Reply-To: <20151126165331.GA7882@kroah.com> References: <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <563B473C.5090508@users.sourceforge.net> <563B4991.90005@users.sourceforge.net> <20151125163901.GA7368@kroah.com> <5656AFEC.8030709@users.sourceforge.net> <20151126165331.GA7882@kroah.com> Message-ID: <5657573D.4080905@users.sourceforge.net> >> Do you try this update suggestion out without integrating the corresponding previous >> update suggestion "Delete unnecessary checks before two function calls" >> where I proposed to remove extra checks before a few calls of the function "kobject_put" >> (which seems to matter for the patch hunk in the shown error message)? >> https://lkml.org/lkml/2015/11/5/276 >> https://www.mail-archive.com/linux-kernel at vger.kernel.org/msg1013635.html > > I guess so, I don't remember, I don't see any patches from you earlier > in my "todo" mbox. I am still waiting for further constructive feedback on a bunch of my update suggestions which are derived from static source code analysis. It can be the usual challenge to get a bit more attention for them. Other software improvements will result in bigger effects than the source code fine-tuning I propose, won't it? I would like to acknowledge that changes like the following from this patch series can still be applied together for the software "Linux next-20151126". * 0001-staging-lustre-Delete-unnecessary-checks-before-two.patch * 0003-staging-lustre-Less-function-calls-in-class_register.patch >> Would you like to reject the first update step from this patch series >> so that I need to adapt my approach to your software design decision? > > I have no idea what you are talking about. I have no recolection of > previous patches or conversations about your patches. * Dan Carpenter expressed his software design concerns around hidden sanity checks a few times. How do you think about to give the proposed changes another chance? * Positive feedback is occasionally increasing by specific subsystem supporters and maintainers. How will our collaboration evolve further? Do you want that I resend any mails/patches from my "waiting queue"? Regards, Markus From dan.carpenter at oracle.com Thu Nov 26 20:01:30 2015 From: dan.carpenter at oracle.com (Dan Carpenter) Date: Thu, 26 Nov 2015 23:01:30 +0300 Subject: [lustre-devel] [PATCH 3/3] staging: lustre: Less function calls in class_register_type() after error detection In-Reply-To: <5657573D.4080905@users.sourceforge.net> References: <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <563B473C.5090508@users.sourceforge.net> <563B4991.90005@users.sourceforge.net> <20151125163901.GA7368@kroah.com> <5656AFEC.8030709@users.sourceforge.net> <20151126165331.GA7882@kroah.com> <5657573D.4080905@users.sourceforge.net> Message-ID: <20151126200130.GI7289@mwanda> These patches are often correct in the same way a stopped clock is correct twice a day, but I reject the motivation/approach/patch description. Just because there is a sanity check does not mean we should use it (ie, do an insane thing). It hurts readability to hide the NULL check. On the other hand, half the time the NULL checks are superflous because the pointer is never NULL. The other half of the time the NULL checks are there because the code uses one err style error handling. Also the error handling code should mirror the allocation code so I feel like it should be: if (some_feature) foo = allocate(); ret = frob(); if (ret) goto free_foo; free_foo: if (some_feature) // <--- as opposed to if (foo) { free(foo); So anyway I often don't like the original code, but the new code is even worse and I have never heard a good motivation for these patches besides that they were generated using a cool tool. It's not a good reason. Other maintainers are accepting these patches so you are free to send them there. regards, dan carpenter From andreas.dilger at intel.com Fri Nov 27 04:31:39 2015 From: andreas.dilger at intel.com (Dilger, Andreas) Date: Fri, 27 Nov 2015 04:31:39 +0000 Subject: [lustre-devel] [PATCH v2] staging: lustre: remove IOC_LIBCFS_PING_TEST ioctl Message-ID: On 2015/11/08, 09:34, "James Simmons" 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 >--- > .../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 From mahfouz.saif.elyazal at gmail.com Fri Nov 27 20:41:23 2015 From: mahfouz.saif.elyazal at gmail.com (Aya Mahfouz) Date: Fri, 27 Nov 2015 22:41:23 +0200 Subject: [lustre-devel] [PATCH v2] staging: lustre: ptlrpc: constify ptlrpc_sec_cops structs Message-ID: <20151127204123.GA8719@waves> Constifies ptlrpc_sec_cops structures in the lustre driver since they are not modified after their initialization. Detected and found using Coccinelle. Suggested-by: Julia Lawall Signed-off-by: Aya Mahfouz --- Changelog: v2: added const to a ptlrpc_sec_cops structure in the definition of ptlrpc_sec_policy drivers/staging/lustre/lustre/include/lustre_sec.h | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_null.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_plain.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/lustre_sec.h b/drivers/staging/lustre/lustre/include/lustre_sec.h index dd1033b..de35e2f 100644 --- a/drivers/staging/lustre/lustre/include/lustre_sec.h +++ b/drivers/staging/lustre/lustre/include/lustre_sec.h @@ -779,7 +779,7 @@ struct ptlrpc_sec_policy { struct module *sp_owner; char *sp_name; __u16 sp_policy; /* policy number */ - struct ptlrpc_sec_cops *sp_cops; /* client ops */ + const struct ptlrpc_sec_cops *sp_cops; /* client ops */ struct ptlrpc_sec_sops *sp_sops; /* server ops */ }; diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec.c b/drivers/staging/lustre/lustre/ptlrpc/sec.c index 39f5261..f959897 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec.c @@ -1580,7 +1580,7 @@ int sptlrpc_cli_enlarge_reqbuf(struct ptlrpc_request *req, int segment, int newsize) { struct ptlrpc_cli_ctx *ctx = req->rq_cli_ctx; - struct ptlrpc_sec_cops *cops; + const struct ptlrpc_sec_cops *cops; struct lustre_msg *msg = req->rq_reqmsg; LASSERT(ctx); diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c index ebfa609..ffdad15 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_null.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_null.c @@ -378,7 +378,7 @@ static struct ptlrpc_ctx_ops null_ctx_ops = { .verify = null_ctx_verify, }; -static struct ptlrpc_sec_cops null_sec_cops = { +static const struct ptlrpc_sec_cops null_sec_cops = { .create_sec = null_create_sec, .destroy_sec = null_destroy_sec, .lookup_ctx = null_lookup_ctx, diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c b/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c index f448b45..71351de 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_plain.c @@ -956,7 +956,7 @@ static struct ptlrpc_ctx_ops plain_ctx_ops = { .unwrap_bulk = plain_cli_unwrap_bulk, }; -static struct ptlrpc_sec_cops plain_sec_cops = { +static const struct ptlrpc_sec_cops plain_sec_cops = { .create_sec = plain_create_sec, .destroy_sec = plain_destroy_sec, .kill_sec = plain_kill_sec, -- 2.4.3 -- Kind Regards, Aya Saif El-yazal Mahfouz