Re: [HPDD-discuss] [PATCH] staging: lustre: fix sparse warnings related to lock context imbalance
by Andreas Dilger
On Nov 28, 2014, at 11:50 AM, Greg KH <gregkh(a)linuxfoundation.org> wrote:
> On Thu, Nov 27, 2014 at 07:34:10PM +0100, Loïc Pefferkorn wrote:
>> Hello Greg,
>>
>> After some investigation, I think that removing these wrappers is not going to improve the code readability:
>>
>> On Wed, Nov 26, 2014 at 12:54:43PM -0800, Greg KH wrote:
>>> On Wed, Nov 26, 2014 at 05:15:48PM +0100, Loic Pefferkorn wrote:
>>>> Add __acquires() and __releases() function annotations, to fix sparse warnings related to lock context imbalance.
>>>>
>>>> diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c b/drivers/staging/lustre/lustre/libcfs/hash.c
>>>> index 32da783..7c6e2a3 100644
>>>> --- a/drivers/staging/lustre/lustre/libcfs/hash.c
>>>> +++ b/drivers/staging/lustre/lustre/libcfs/hash.c
>>>> @@ -126,18 +126,21 @@ cfs_hash_nl_unlock(union cfs_hash_lock *lock, int exclusive) {}
>>>>
>>>> static inline void
>>>> cfs_hash_spin_lock(union cfs_hash_lock *lock, int exclusive)
>>>> + __acquires(&lock->spin)
>>>> {
>>>> spin_lock(&lock->spin);
>>>> }
>>>>
>>>> static inline void
>>>> cfs_hash_spin_unlock(union cfs_hash_lock *lock, int exclusive)
>>>> + __releases(&lock->spin)
>>>> {
>>>> spin_unlock(&lock->spin);
>>>> }
>>>
>>> Ugh, how horrid, please just delete these functions and push down the
>>> spin_lock/unlock calls down into the places these are called.
>>
>> cfs_hash_spin_lock() and cfs_hash_spin_unlock() are referenced by function pointers later in the same file:
>>
>> 165 /** no bucket lock, one spinlock to protect everything */
>> 166 static cfs_hash_lock_ops_t cfs_hash_nbl_lops = {
>> 167 .hs_lock = cfs_hash_spin_lock,
>> 168 .hs_unlock = cfs_hash_spin_unlock,
>> 169 .hs_bkt_lock = cfs_hash_nl_lock,
>> 170 .hs_bkt_unlock = cfs_hash_nl_unlock,
>> 171 };
>> 172
>> 173 /** spin bucket lock, rehash is enabled */
>> 174 static cfs_hash_lock_ops_t cfs_hash_bkt_spin_lops = {
>> 175 .hs_lock = cfs_hash_rw_lock,
>> 176 .hs_unlock = cfs_hash_rw_unlock,
>> 177 .hs_bkt_lock = cfs_hash_spin_lock,
>> 178 .hs_bkt_unlock = cfs_hash_spin_unlock,
>> 179 };
>
> That's even worse than I imagined. Putting sparse markings on these
> function calls is just papering over nonsense. Please work on
> unwinding the mess so that you don't need callbacks for locks,
> that is an abstraction that isn't needed.
Greg,
in this case these abstractions are not old layering. This is part of
scalable hashing code that we use all over Lustre, since it needs to
handle thousands/millions of clients/connections/files/locks/RPCs
or whatever in a lot of places. Having a single interface to define
and use these hash functions simplifies the code and avoids bugs,
like list_* functions do everywhere else in the kernel.
Depending on how the hash table is declared, it may have read/write
locks or normal spinlocks. The hash table size may be static, or it
may grow when the buckets get too full (since the numbers of items
being hashed may differ by many orders of magnitude on different filesystems) so the actual locking functions used depend on how the
hash table is set up.
I don't think it is possible to unwind the locking of cfs_hash_* code
since they are accessed via methods depending on the hash.
Cheers, Andreas
>>>> static inline void
>>>> cfs_hash_rw_lock(union cfs_hash_lock *lock, int exclusive)
>>>> + __acquires(&lock->rw)
>>>> {
>>>> if (!exclusive)
>>>> read_lock(&lock->rw);
>>>> @@ -147,6 +150,7 @@ cfs_hash_rw_lock(union cfs_hash_lock *lock, int exclusive)
>>>>
>>>> static inline void
>>>> cfs_hash_rw_unlock(union cfs_hash_lock *lock, int exclusive)
>>>> + __releases(&lock->rw)
>>>> {
>>>> if (!exclusive)
>>>> read_unlock(&lock->rw);
>>>
>>>
>>> Same for these.
>>
>> Likewise for cfs_hash_rw_lock() and cfs_hash_rw_unlock():
>>
>> 173 /** spin bucket lock, rehash is enabled */
>> 174 static cfs_hash_lock_ops_t cfs_hash_bkt_spin_lops = {
>> 175 .hs_lock = cfs_hash_rw_lock,
>> 176 .hs_unlock = cfs_hash_rw_unlock,
>> 177 .hs_bkt_lock = cfs_hash_spin_lock,
>> 178 .hs_bkt_unlock = cfs_hash_spin_unlock,
>> 179 };
>> 180
>> 181 /** rw bucket lock, rehash is enabled */
>> 182 static cfs_hash_lock_ops_t cfs_hash_bkt_rw_lops = {
>> 183 .hs_lock = cfs_hash_rw_lock,
>> 184 .hs_unlock = cfs_hash_rw_unlock,
>> 185 .hs_bkt_lock = cfs_hash_rw_lock,
>> 186 .hs_bkt_unlock = cfs_hash_rw_unlock,
>> 187 };
>
> Same here, ick ick ick.
>
>>>> diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
>>>> index 2c199c7..1e529fc 100644
>>>> --- a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
>>>> +++ b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
>>>> @@ -91,6 +91,7 @@ EXPORT_SYMBOL(cfs_percpt_lock_alloc);
>>>> */
>>>> void
>>>> cfs_percpt_lock(struct cfs_percpt_lock *pcl, int index)
>>>> + __acquires(pcl->pcl_locks[index])
>>>> {
>>>> int ncpt = cfs_cpt_number(pcl->pcl_cptab);
>>>> int i;
>>>> @@ -125,6 +126,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[index])
>>>> {
>>>> int ncpt = cfs_cpt_number(pcl->pcl_cptab);
>>>> int i;
>>>> diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
>>>> index 976c61e..257669b 100644
>>>> --- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
>>>> +++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
>>>> @@ -151,6 +151,7 @@ cfs_trace_buf_type_t cfs_trace_buf_idx_get(void)
>>>> * for details.
>>>> */
>>>> int cfs_trace_lock_tcd(struct cfs_trace_cpu_data *tcd, int walking)
>>>> + __acquires(&tcd->tc_lock)
>>>> {
>>>> __LASSERT(tcd->tcd_type < CFS_TCD_TYPE_MAX);
>>>> if (tcd->tcd_type == CFS_TCD_TYPE_IRQ)
>>>> @@ -165,6 +166,7 @@ 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)
>>>> + __releases(&tcd->tcd_lock)
>>>> {
>>>> __LASSERT(tcd->tcd_type < CFS_TCD_TYPE_MAX);
>>>> if (tcd->tcd_type == CFS_TCD_TYPE_IRQ)
>>>> diff --git a/drivers/staging/lustre/lustre/obdclass/cl_object.c b/drivers/staging/lustre/lustre/obdclass/cl_object.c
>>>> index ce96bd2..8577f97 100644
>>>> --- a/drivers/staging/lustre/lustre/obdclass/cl_object.c
>>>> +++ b/drivers/staging/lustre/lustre/obdclass/cl_object.c
>>>> @@ -193,6 +193,7 @@ static spinlock_t *cl_object_attr_guard(struct cl_object *o)
>>>> * cl_object_attr_get(), cl_object_attr_set().
>>>> */
>>>> void cl_object_attr_lock(struct cl_object *o)
>>>> + __acquires(cl_object_attr_guard(o))
>>>> {
>>>> spin_lock(cl_object_attr_guard(o));
>>>> }
>>>> @@ -202,6 +203,7 @@ EXPORT_SYMBOL(cl_object_attr_lock);
>>>> * Releases data-attributes lock, acquired by cl_object_attr_lock().
>>>> */
>>>> void cl_object_attr_unlock(struct cl_object *o)
>>>> + __releases(cl_object_attr_guard(o))
>>>> {
>>>> spin_unlock(cl_object_attr_guard(o));
>>>> }
>>>
>>> Same thing here.
>>
>> These ones are easy to replace, but the naming scheme of all functions in cl_object.c is consistent,
>> from my point of view it ease code reading where they are called, for example in lustre/lustre/osc/osc_request.c:
>>
>> before:
>>
>> 1827 if (valid != 0) {
>> 1828 cl_object_attr_lock(obj);
>> 1829 cl_object_attr_set(env, obj, attr, valid);
>> 1830 cl_object_attr_unlock(obj);
>>
>> after:
>>
>> 1827 if (valid != 0) {
>> 1828 spin_lock(cl_object_attr_guard(obj));
>> 1829 cl_object_attr_set(env, obj, attr, valid);
>> 1830 spin_unlock(cl_object_attr_guard(obj));
>>
>>
>> But I'm here for learning, and I would be grateful to have your opinion.
>
> Don't hide "implementation of locks" in functions like this, it only
> causes problems. This code has layers of layers of layers of
> abstractions due to it wanting to be originally ported to other
> operating systems and lots of different kernel versions of Linux itself.
> Unwinding and removing those layers is a good thing to do, don't paper
> over the nonsense by putting sparse markings on pointless functions.
>
> thanks,
>
> greg k-h
Cheers, Andreas
7 years, 4 months
Open Participation in OpenSFS Board Meetings
by OpenSFS Administration
Fellow OpenSFS participants,
OpenSFS prides itself on being deeply committed to the philosophy of open
source. We bring together a wide range of organizations and individuals to
solve problems that move open source file systems forward. In the spirit of
open source, we want to provide greater visibility into OpenSFS inner
workings as well.
As we announced a few weeks ago, the weekly OpenSFS Board meetings will be
open to all OpenSFS participants. These meetings are held weekly and include
discussions on Lustre contract funding, communications strategy, community
building initiatives, financial updates, and more.
As with any organization, from time to time the Board may need to meet in
closed session regarding sensitive matters, including those pertaining to
litigation, employment, contract negotiation, highly confidential
information or as advised by counsel. However, we expect that such instances
will be infrequent, and we look forward to having open Board meetings with
broad participation as much as possible.
By allowing participants from the OpenSFS community to join the meetings, we
look forward to providing insight and transparency to the decisions
occurring at the OpenSFS Board level. If you are interested in joining the
meetings, please add the following details to your calendars:
Meeting day: Tuesday
Meeting frequency: weekly
Time: 8-9am Pacific
Dial in: 866-857-0578
Passcode: 8953335
The meeting information is also available on the OpenSFS web site at
http://opensfs.org/about/board-meetings-and-activities/
Additionally, we will continue to distribute minutes from the Board meetings
to the OpenSFS participants mailing list. To subscribe to the participants
mailing list, please visit
http://lists.opensfs.org/listinfo.cgi/participants-opensfs.org
Our priorities continue to focus on our commitment to the Lustre community.
Fostering broader community participation is key. We look forward to your
ongoing participation in OpenSFS.
Best regards,
OpenSFS Board of Directors
Charlie Carroll, Cray
Steve Simms, Indiana University
Sarp Oral, ORNL
Meghan McClelland, Seagate Technology
7 years, 4 months
[PATCH] staging: lustre: ptlrpc: fix lproc_ptlrpc static declarations
by Jon Bernard
This patch fixes the following sparse warnings:
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:51:3:warning:
symbol 'll_rpc_opcode_table' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:142:3: warning:
symbol 'll_eopcode_table' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:178:12: warning:
symbol 'll_eopcode2str' was not declared. Should it be static?
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c:731:1: warning:
symbol 'ptlrpc_lprocfs_svc_req_history_seek' was not declared. Should it be static?
Signed-off-by: Jon Bernard <jbernard(a)tuxion.com>
---
drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
index 90448e9..0e2071b 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
@@ -45,7 +45,7 @@
#include "ptlrpc_internal.h"
-struct ll_rpc_opcode {
+static struct ll_rpc_opcode {
__u32 opcode;
const char *opname;
} ll_rpc_opcode_table[LUSTRE_MAX_OPCODES] = {
@@ -136,7 +136,7 @@ struct ll_rpc_opcode {
{ UPDATE_OBJ, "update_obj" },
};
-struct ll_eopcode {
+static struct ll_eopcode {
__u32 opcode;
const char *opname;
} ll_eopcode_table[EXTRA_LAST_OPC] = {
@@ -175,11 +175,12 @@ const char *ll_opcode2str(__u32 opcode)
return ll_rpc_opcode_table[offset].opname;
}
-const char *ll_eopcode2str(__u32 opcode)
+static const char *ll_eopcode2str(__u32 opcode)
{
LASSERT(ll_eopcode_table[opcode].opcode == opcode);
return ll_eopcode_table[opcode].opname;
}
+
#if defined (CONFIG_PROC_FS)
static void ptlrpc_lprocfs_register(struct proc_dir_entry *root, char *dir,
char *name,
@@ -727,7 +728,7 @@ struct ptlrpc_srh_iterator {
struct ptlrpc_request *srhi_req;
};
-int
+static int
ptlrpc_lprocfs_svc_req_history_seek(struct ptlrpc_service_part *svcpt,
struct ptlrpc_srh_iterator *srhi,
__u64 seq)
--
1.9.1
7 years, 4 months
[PATCH v2] staging: lustre: fix sparse warnings related to lock context imbalance
by Loic Pefferkorn
Applies against next-20150120.
Add __acquires() and __releases() function annotations, to fix sparse warnings related to lock context imbalance.
This patch fixes the following warnings:
drivers/staging/lustre//lustre/libcfs/linux/linux-tracefile.c:153:5: warning: context imbalance in 'cfs_trace_lock_tcd' - wrong count at exit
drivers/staging/lustre//lustre/libcfs/linux/linux-tracefile.c:171:39: warning: context imbalance in 'cfs_trace_unlock_tcd' - unexpected unlock
drivers/staging/lustre//lustre/libcfs/hash.c:128:1: warning: context imbalance in 'cfs_hash_spin_lock' - wrong count at exit
drivers/staging/lustre//lustre/libcfs/hash.c:134:1: warning: context imbalance in 'cfs_hash_spin_unlock' - unexpected unlock
drivers/staging/lustre//lustre/libcfs/hash.c:142:9: warning: context imbalance in 'cfs_hash_rw_lock' - wrong count at exit
include/linux/rwlock_api_smp.h:219:9: warning: context imbalance in 'cfs_hash_rw_unlock' - unexpected unlock
drivers/staging/lustre//lustre/obdclass/cl_object.c:195:6: warning: context imbalance in 'cl_object_attr_lock' - wrong count at exit
drivers/staging/lustre//lustre/obdclass/cl_object.c:204:6: warning: context imbalance in 'cl_object_attr_unlock' - unexpected unlock
Signed-off-by: Loic Pefferkorn <loic(a)loicp.eu>
---
drivers/staging/lustre/lustre/libcfs/hash.c | 4 ++++
drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c | 2 ++
drivers/staging/lustre/lustre/obdclass/cl_object.c | 2 ++
3 files changed, 8 insertions(+)
diff --git a/drivers/staging/lustre/lustre/libcfs/hash.c b/drivers/staging/lustre/lustre/libcfs/hash.c
index 2d1e672..d89f81a 100644
--- a/drivers/staging/lustre/lustre/libcfs/hash.c
+++ b/drivers/staging/lustre/lustre/libcfs/hash.c
@@ -126,18 +126,21 @@ cfs_hash_nl_unlock(union cfs_hash_lock *lock, int exclusive) {}
static inline void
cfs_hash_spin_lock(union cfs_hash_lock *lock, int exclusive)
+ __acquires(&lock->spin)
{
spin_lock(&lock->spin);
}
static inline void
cfs_hash_spin_unlock(union cfs_hash_lock *lock, int exclusive)
+ __releases(&lock->spin)
{
spin_unlock(&lock->spin);
}
static inline void
cfs_hash_rw_lock(union cfs_hash_lock *lock, int exclusive)
+ __acquires(&lock->rw)
{
if (!exclusive)
read_lock(&lock->rw);
@@ -147,6 +150,7 @@ cfs_hash_rw_lock(union cfs_hash_lock *lock, int exclusive)
static inline void
cfs_hash_rw_unlock(union cfs_hash_lock *lock, int exclusive)
+ __releases(&lock->rw)
{
if (!exclusive)
read_unlock(&lock->rw);
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
index fdc7189..c8e2930 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-tracefile.c
@@ -151,6 +151,7 @@ cfs_trace_buf_type_t cfs_trace_buf_idx_get(void)
* for details.
*/
int cfs_trace_lock_tcd(struct cfs_trace_cpu_data *tcd, int walking)
+ __acquires(&tcd->tc_lock)
{
__LASSERT(tcd->tcd_type < CFS_TCD_TYPE_MAX);
if (tcd->tcd_type == CFS_TCD_TYPE_IRQ)
@@ -165,6 +166,7 @@ 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)
+ __releases(&tcd->tcd_lock)
{
__LASSERT(tcd->tcd_type < CFS_TCD_TYPE_MAX);
if (tcd->tcd_type == CFS_TCD_TYPE_IRQ)
diff --git a/drivers/staging/lustre/lustre/obdclass/cl_object.c b/drivers/staging/lustre/lustre/obdclass/cl_object.c
index c40bb6c..f13d1fb 100644
--- a/drivers/staging/lustre/lustre/obdclass/cl_object.c
+++ b/drivers/staging/lustre/lustre/obdclass/cl_object.c
@@ -193,6 +193,7 @@ static spinlock_t *cl_object_attr_guard(struct cl_object *o)
* cl_object_attr_get(), cl_object_attr_set().
*/
void cl_object_attr_lock(struct cl_object *o)
+ __acquires(cl_object_attr_guard(o))
{
spin_lock(cl_object_attr_guard(o));
}
@@ -202,6 +203,7 @@ EXPORT_SYMBOL(cl_object_attr_lock);
* Releases data-attributes lock, acquired by cl_object_attr_lock().
*/
void cl_object_attr_unlock(struct cl_object *o)
+ __releases(cl_object_attr_guard(o))
{
spin_unlock(cl_object_attr_guard(o));
}
--
2.2.1
7 years, 4 months
[PATCH v3] staging: lustre: fix sparse warning on LPROC_SEQ_FOPS macros
by Tristan Lelong
This patch fix a sparse warning in lustre sources
warning: incorrect type in argument 1 (different address spaces)
expected void [noderef] <asn:1>*to
got char *<noident>
This is done by adding the missing __user attribute on userland pointers inside the LPROC_SEQ_FOPS like macros:
- LPROC_SEQ_FOPS
- LPROC_SEQ_FOPS_RW_TYPE
- LPROC_SEQ_FOPS_WR_ONLY
- LDLM_POOL_PROC_WRITER
The patch also updates all the functions that are used by this macro:
- lprocfs_wr_*
- *_seq_write
as well as some helpers used by the previously modified functions (otherwise fixing the sparse warning add some new ones):
- lprocfs_write_frac_helper
- lprocfs_write_helper
- lprocfs_write_u64_helper
The patch also fixes one __user pointer direct dereference by strncmp in function fld_proc_hash_seq_write.
Signed-off-by: Tristan Lelong <tristan(a)lelong.xyz>
---
Changes in v2:
Use dynamic allocation for 'name' variable instead of having it on the stack, per Greg K-H suggestion.
Changes in v3:
Rename added variable from 'name' to 'fh_name'.
Revert to a stack declaration of 'fh_name' since it is not 80 bytes but only 8, per Andreas Dilger comment.
---
drivers/staging/lustre/lustre/fld/lproc_fld.c | 14 ++++--
.../staging/lustre/lustre/include/lprocfs_status.h | 44 +++++++++--------
drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 5 +-
drivers/staging/lustre/lustre/ldlm/ldlm_pool.c | 4 +-
drivers/staging/lustre/lustre/ldlm/ldlm_resource.c | 7 +--
drivers/staging/lustre/lustre/lov/lproc_lov.c | 20 +++++---
drivers/staging/lustre/lustre/mdc/lproc_mdc.c | 7 +--
.../lustre/lustre/obdclass/linux/linux-module.c | 5 +-
.../lustre/lustre/obdclass/lprocfs_status.c | 2 +-
drivers/staging/lustre/lustre/osc/lproc_osc.c | 57 +++++++++++++---------
.../staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c | 25 +++++-----
11 files changed, 114 insertions(+), 76 deletions(-)
diff --git a/drivers/staging/lustre/lustre/fld/lproc_fld.c b/drivers/staging/lustre/lustre/fld/lproc_fld.c
index 95e7de1..9b26bb5 100644
--- a/drivers/staging/lustre/lustre/fld/lproc_fld.c
+++ b/drivers/staging/lustre/lustre/fld/lproc_fld.c
@@ -87,13 +87,21 @@ fld_proc_hash_seq_show(struct seq_file *m, void *unused)
}
static ssize_t
-fld_proc_hash_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+fld_proc_hash_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{
struct lu_client_fld *fld;
struct lu_fld_hash *hash = NULL;
+ char fh_name[8];
int i;
+ if (count > sizeof(fh_name))
+ return -ENAMETOOLONG;
+
+ if (copy_from_user(fh_name, buffer, count) != 0)
+ return -EFAULT;
+
fld = ((struct seq_file *)file->private_data)->private;
LASSERT(fld != NULL);
@@ -101,7 +109,7 @@ fld_proc_hash_seq_write(struct file *file, const char *buffer,
if (count != strlen(fld_hash[i].fh_name))
continue;
- if (!strncmp(fld_hash[i].fh_name, buffer, count)) {
+ if (!strncmp(fld_hash[i].fh_name, fh_name, count)) {
hash = &fld_hash[i];
break;
}
diff --git a/drivers/staging/lustre/lustre/include/lprocfs_status.h b/drivers/staging/lustre/lustre/include/lprocfs_status.h
index cfe503b..8a25cf6 100644
--- a/drivers/staging/lustre/lustre/include/lprocfs_status.h
+++ b/drivers/staging/lustre/lustre/include/lprocfs_status.h
@@ -627,16 +627,16 @@ struct adaptive_timeout;
extern int lprocfs_at_hist_helper(struct seq_file *m,
struct adaptive_timeout *at);
extern int lprocfs_rd_timeouts(struct seq_file *m, void *data);
-extern int lprocfs_wr_timeouts(struct file *file, const char *buffer,
+extern int lprocfs_wr_timeouts(struct file *file, const char __user *buffer,
unsigned long count, void *data);
-extern int lprocfs_wr_evict_client(struct file *file, const char *buffer,
+extern int lprocfs_wr_evict_client(struct file *file, const char __user *buffer,
size_t count, loff_t *off);
-extern int lprocfs_wr_ping(struct file *file, const char *buffer,
+extern int lprocfs_wr_ping(struct file *file, const char __user *buffer,
size_t count, loff_t *off);
-extern int lprocfs_wr_import(struct file *file, const char *buffer,
+extern int lprocfs_wr_import(struct file *file, const char __user *buffer,
size_t count, loff_t *off);
extern int lprocfs_rd_pinger_recov(struct seq_file *m, void *n);
-extern int lprocfs_wr_pinger_recov(struct file *file, const char *buffer,
+extern int lprocfs_wr_pinger_recov(struct file *file, const char __user *buffer,
size_t count, loff_t *off);
/* Statfs helpers */
@@ -650,8 +650,8 @@ extern int lprocfs_rd_filesfree(struct seq_file *m, void *data);
extern int lprocfs_write_helper(const char __user *buffer, unsigned long count,
int *val);
extern int lprocfs_seq_read_frac_helper(struct seq_file *m, long val, int mult);
-extern int lprocfs_write_u64_helper(const char *buffer, unsigned long count,
- __u64 *val);
+extern int lprocfs_write_u64_helper(const char __user *buffer,
+ unsigned long count, __u64 *val);
extern int lprocfs_write_frac_u64_helper(const char *buffer,
unsigned long count,
__u64 *val, int mult);
@@ -716,7 +716,8 @@ static struct file_operations name##_fops = { \
return lprocfs_rd_##type(m, m->private); \
} \
static ssize_t name##_##type##_seq_write(struct file *file, \
- const char *buffer, size_t count, loff_t *off) \
+ const char __user *buffer, size_t count, \
+ loff_t *off) \
{ \
struct seq_file *seq = file->private_data; \
return lprocfs_wr_##type(file, buffer, \
@@ -726,7 +727,8 @@ static struct file_operations name##_fops = { \
#define LPROC_SEQ_FOPS_WR_ONLY(name, type) \
static ssize_t name##_##type##_write(struct file *file, \
- const char *buffer, size_t count, loff_t *off) \
+ const char __user *buffer, size_t count, \
+ loff_t *off) \
{ \
return lprocfs_wr_##type(file, buffer, count, off); \
} \
@@ -939,20 +941,24 @@ static inline int lprocfs_at_hist_helper(struct seq_file *m,
static inline int lprocfs_rd_timeouts(struct seq_file *m, void *data)
{ return 0; }
static inline int lprocfs_wr_timeouts(struct file *file,
- const char *buffer,
- unsigned long count, void *data)
+ const char __user *buffer,
+ unsigned long count, void *data)
{ return 0; }
-static inline int lprocfs_wr_evict_client(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static inline int lprocfs_wr_evict_client(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{ return 0; }
-static inline int lprocfs_wr_ping(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static inline int lprocfs_wr_ping(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{ return 0; }
-static inline int lprocfs_wr_import(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static inline int lprocfs_wr_import(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{ return 0; }
-static inline int lprocfs_wr_pinger_recov(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static inline int lprocfs_wr_pinger_recov(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{ return 0; }
/* Statfs helpers */
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
index 6c6c57c..20e64cd 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
@@ -249,8 +249,9 @@ typedef enum ldlm_policy_res ldlm_policy_res_t;
struct __##var##__dummy_read {; } /* semicolon catcher */
#define LDLM_POOL_PROC_WRITER(var, type) \
- static int lprocfs_wr_##var(struct file *file, const char *buffer, \
- unsigned long count, void *data) \
+ static int lprocfs_wr_##var(struct file *file, \
+ const char __user *buffer, \
+ unsigned long count, void *data) \
{ \
struct ldlm_pool *pl = data; \
type tmp; \
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
index 4c838f6..142b3dd 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
@@ -697,8 +697,8 @@ LPROC_SEQ_FOPS_RO(lprocfs_grant_plan);
LDLM_POOL_PROC_READER_SEQ_SHOW(recalc_period, int);
LDLM_POOL_PROC_WRITER(recalc_period, int);
static ssize_t lprocfs_recalc_period_seq_write(struct file *file,
- const char *buf, size_t len,
- loff_t *off)
+ const char __user *buf,
+ size_t len, loff_t *off)
{
struct seq_file *seq = file->private_data;
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index 1f150e4..c6f62a9 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -72,7 +72,7 @@ extern unsigned int ldlm_cancel_unused_locks_before_replay;
unsigned int ldlm_dump_granted_max = 256;
#if defined(CONFIG_PROC_FS)
-static ssize_t lprocfs_wr_dump_ns(struct file *file, const char *buffer,
+static ssize_t lprocfs_wr_dump_ns(struct file *file, const char __user *buffer,
size_t count, loff_t *off)
{
ldlm_dump_all_namespaces(LDLM_NAMESPACE_SERVER, D_DLMTRACE);
@@ -287,8 +287,9 @@ static int lprocfs_elc_seq_show(struct seq_file *m, void *v)
return lprocfs_rd_uint(m, &supp);
}
-static ssize_t lprocfs_elc_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static ssize_t lprocfs_elc_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{
struct ldlm_namespace *ns = ((struct seq_file *)file->private_data)->private;
unsigned int supp = -1;
diff --git a/drivers/staging/lustre/lustre/lov/lproc_lov.c b/drivers/staging/lustre/lustre/lov/lproc_lov.c
index c993f25..c99f2f4 100644
--- a/drivers/staging/lustre/lustre/lov/lproc_lov.c
+++ b/drivers/staging/lustre/lustre/lov/lproc_lov.c
@@ -51,8 +51,9 @@ static int lov_stripesize_seq_show(struct seq_file *m, void *v)
return seq_printf(m, "%llu\n", desc->ld_default_stripe_size);
}
-static ssize_t lov_stripesize_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static ssize_t lov_stripesize_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{
struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
struct lov_desc *desc;
@@ -81,8 +82,9 @@ static int lov_stripeoffset_seq_show(struct seq_file *m, void *v)
return seq_printf(m, "%llu\n", desc->ld_default_stripe_offset);
}
-static ssize_t lov_stripeoffset_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static ssize_t lov_stripeoffset_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{
struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
struct lov_desc *desc;
@@ -110,8 +112,9 @@ static int lov_stripetype_seq_show(struct seq_file *m, void *v)
return seq_printf(m, "%u\n", desc->ld_pattern);
}
-static ssize_t lov_stripetype_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static ssize_t lov_stripetype_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{
struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
struct lov_desc *desc;
@@ -140,8 +143,9 @@ static int lov_stripecount_seq_show(struct seq_file *m, void *v)
(__s16)(desc->ld_default_stripe_count + 1) - 1);
}
-static ssize_t lov_stripecount_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static ssize_t lov_stripecount_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{
struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
struct lov_desc *desc;
diff --git a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
index 16341c8..c420219 100644
--- a/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
+++ b/drivers/staging/lustre/lustre/mdc/lproc_mdc.c
@@ -52,7 +52,7 @@ static int mdc_max_rpcs_in_flight_seq_show(struct seq_file *m, void *v)
}
static ssize_t mdc_max_rpcs_in_flight_seq_write(struct file *file,
- const char *buffer,
+ const char __user *buffer,
size_t count,
loff_t *off)
{
@@ -82,8 +82,9 @@ static int mdc_kuc_open(struct inode *inode, struct file *file)
}
/* temporary for testing */
-static ssize_t mdc_kuc_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+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;
diff --git a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
index 66ceab2..b5007b8 100644
--- a/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
+++ b/drivers/staging/lustre/lustre/obdclass/linux/linux-module.c
@@ -272,8 +272,9 @@ static int obd_proc_jobid_var_seq_show(struct seq_file *m, void *v)
return seq_printf(m, "%s\n", obd_jobid_var);
}
-static ssize_t obd_proc_jobid_var_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static ssize_t obd_proc_jobid_var_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{
if (!count || count > JOBSTATS_JOBID_VAR_MAX_LEN)
return -EINVAL;
diff --git a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
index 3b7dfc3..f78a241 100644
--- a/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
+++ b/drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
@@ -1849,7 +1849,7 @@ int lprocfs_seq_read_frac_helper(struct seq_file *m, long val, int mult)
}
EXPORT_SYMBOL(lprocfs_seq_read_frac_helper);
-int lprocfs_write_u64_helper(const char *buffer, unsigned long count,
+int lprocfs_write_u64_helper(const char __user *buffer, unsigned long count,
__u64 *val)
{
return lprocfs_write_frac_u64_helper(buffer, count, val, 1);
diff --git a/drivers/staging/lustre/lustre/osc/lproc_osc.c b/drivers/staging/lustre/lustre/osc/lproc_osc.c
index 9f719bc..8e22e45 100644
--- a/drivers/staging/lustre/lustre/osc/lproc_osc.c
+++ b/drivers/staging/lustre/lustre/osc/lproc_osc.c
@@ -53,8 +53,9 @@ static int osc_active_seq_show(struct seq_file *m, void *v)
return rc;
}
-static ssize_t osc_active_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static ssize_t osc_active_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{
struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
int val, rc;
@@ -88,7 +89,8 @@ static int osc_max_rpcs_in_flight_seq_show(struct seq_file *m, void *v)
}
static ssize_t osc_max_rpcs_in_flight_seq_write(struct file *file,
- const char *buffer, size_t count, loff_t *off)
+ const char __user *buffer,
+ size_t count, loff_t *off)
{
struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
struct client_obd *cli = &dev->u.cli;
@@ -130,8 +132,9 @@ static int osc_max_dirty_mb_seq_show(struct seq_file *m, void *v)
return lprocfs_seq_read_frac_helper(m, val, mult);
}
-static ssize_t osc_max_dirty_mb_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static ssize_t osc_max_dirty_mb_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{
struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
struct client_obd *cli = &dev->u.cli;
@@ -233,8 +236,9 @@ static int osc_cur_grant_bytes_seq_show(struct seq_file *m, void *v)
return rc;
}
-static ssize_t osc_cur_grant_bytes_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static ssize_t osc_cur_grant_bytes_seq_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 client_obd *cli = &obd->u.cli;
@@ -290,7 +294,8 @@ static int osc_grant_shrink_interval_seq_show(struct seq_file *m, void *v)
}
static ssize_t osc_grant_shrink_interval_seq_write(struct file *file,
- const char *buffer, size_t count, loff_t *off)
+ const char __user *buffer,
+ size_t count, loff_t *off)
{
struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
int val, rc;
@@ -322,8 +327,9 @@ static int osc_checksum_seq_show(struct seq_file *m, void *v)
obd->u.cli.cl_checksum ? 1 : 0);
}
-static ssize_t osc_checksum_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static ssize_t osc_checksum_seq_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;
int val, rc;
@@ -362,7 +368,8 @@ static int osc_checksum_type_seq_show(struct seq_file *m, void *v)
return 0;
}
-static ssize_t osc_checksum_type_seq_write(struct file *file, const char *buffer,
+static ssize_t osc_checksum_type_seq_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;
@@ -401,8 +408,9 @@ static int osc_resend_count_seq_show(struct seq_file *m, void *v)
return seq_printf(m, "%u\n", atomic_read(&obd->u.cli.cl_resends));
}
-static ssize_t osc_resend_count_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static ssize_t osc_resend_count_seq_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;
int val, rc;
@@ -428,8 +436,9 @@ static int osc_contention_seconds_seq_show(struct seq_file *m, void *v)
return seq_printf(m, "%u\n", od->od_contention_time);
}
-static ssize_t osc_contention_seconds_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static ssize_t osc_contention_seconds_seq_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 osc_device *od = obd2osc_dev(obd);
@@ -447,8 +456,9 @@ static int osc_lockless_truncate_seq_show(struct seq_file *m, void *v)
return seq_printf(m, "%u\n", od->od_lockless_truncate);
}
-static ssize_t osc_lockless_truncate_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+static ssize_t osc_lockless_truncate_seq_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 osc_device *od = obd2osc_dev(obd);
@@ -472,7 +482,8 @@ static int osc_obd_max_pages_per_rpc_seq_show(struct seq_file *m, void *v)
}
static ssize_t osc_obd_max_pages_per_rpc_seq_write(struct file *file,
- const char *buffer, size_t count, loff_t *off)
+ const char __user *buffer,
+ size_t count, loff_t *off)
{
struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
struct client_obd *cli = &dev->u.cli;
@@ -664,8 +675,9 @@ static int osc_rpc_stats_seq_show(struct seq_file *seq, void *v)
}
#undef pct
-static ssize_t osc_rpc_stats_seq_write(struct file *file, const char *buf,
- size_t len, loff_t *off)
+static ssize_t osc_rpc_stats_seq_write(struct file *file,
+ const char __user *buf,
+ size_t len, loff_t *off)
{
struct seq_file *seq = file->private_data;
struct obd_device *dev = seq->private;
@@ -702,8 +714,9 @@ static int osc_stats_seq_show(struct seq_file *seq, void *v)
return 0;
}
-static ssize_t osc_stats_seq_write(struct file *file, const char *buf,
- size_t len, loff_t *off)
+static ssize_t osc_stats_seq_write(struct file *file,
+ const char __user *buf,
+ size_t len, loff_t *off)
{
struct seq_file *seq = file->private_data;
struct obd_device *dev = seq->private;
diff --git a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
index 4011e00..7b22afd 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
@@ -284,8 +284,9 @@ ptlrpc_lprocfs_req_history_max_seq_show(struct seq_file *m, void *n)
}
static ssize_t
-ptlrpc_lprocfs_req_history_max_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+ptlrpc_lprocfs_req_history_max_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{
struct ptlrpc_service *svc = ((struct seq_file *)file->private_data)->private;
int bufpages;
@@ -329,8 +330,9 @@ ptlrpc_lprocfs_threads_min_seq_show(struct seq_file *m, void *n)
}
static ssize_t
-ptlrpc_lprocfs_threads_min_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+ptlrpc_lprocfs_threads_min_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{
struct ptlrpc_service *svc = ((struct seq_file *)file->private_data)->private;
int val;
@@ -381,8 +383,9 @@ ptlrpc_lprocfs_threads_max_seq_show(struct seq_file *m, void *n)
}
static ssize_t
-ptlrpc_lprocfs_threads_max_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+ptlrpc_lprocfs_threads_max_seq_write(struct file *file,
+ const char __user *buffer,
+ size_t count, loff_t *off)
{
struct ptlrpc_service *svc = ((struct seq_file *)file->private_data)->private;
int val;
@@ -1025,7 +1028,7 @@ static int ptlrpc_lprocfs_hp_ratio_seq_show(struct seq_file *m, void *v)
}
static ssize_t ptlrpc_lprocfs_hp_ratio_seq_write(struct file *file,
- const char *buffer,
+ const char __user *buffer,
size_t count,
loff_t *off)
{
@@ -1175,7 +1178,7 @@ EXPORT_SYMBOL(ptlrpc_lprocfs_unregister_obd);
#define BUFLEN (UUID_MAX + 5)
-int lprocfs_wr_evict_client(struct file *file, const char *buffer,
+int lprocfs_wr_evict_client(struct file *file, const char __user *buffer,
size_t count, loff_t *off)
{
struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
@@ -1223,7 +1226,7 @@ EXPORT_SYMBOL(lprocfs_wr_evict_client);
#undef BUFLEN
-int lprocfs_wr_ping(struct file *file, const char *buffer,
+int lprocfs_wr_ping(struct file *file, const char __user *buffer,
size_t count, loff_t *off)
{
struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
@@ -1251,7 +1254,7 @@ EXPORT_SYMBOL(lprocfs_wr_ping);
* The connection UUID is a node's primary NID. For example,
* "echo connection=192.168.0.1@tcp0::instance > .../import".
*/
-int lprocfs_wr_import(struct file *file, const char *buffer,
+int lprocfs_wr_import(struct file *file, const char __user *buffer,
size_t count, loff_t *off)
{
struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
@@ -1329,7 +1332,7 @@ int lprocfs_rd_pinger_recov(struct seq_file *m, void *n)
}
EXPORT_SYMBOL(lprocfs_rd_pinger_recov);
-int lprocfs_wr_pinger_recov(struct file *file, const char *buffer,
+int lprocfs_wr_pinger_recov(struct file *file, const char __user *buffer,
size_t count, loff_t *off)
{
struct obd_device *obd = ((struct seq_file *)file->private_data)->private;
--
2.1.1
7 years, 4 months
Re: [HPDD-discuss] build from source
by Dilger, Andreas
The lustre.org site is sadly out of date. Hopefully that will be fixed soon, but for now it probably isn't a good place to go for information about Lustre.
The HPDD and OpenSFS sites have more current information.
That said, you should first ask yourself whether you actually need to build Lustre or just use existing packages. It is a lot easier to use existing packages. If you are just testing on your laptop, you can test in a VM and use a pre-built kernel most easily.
Note that there is no Lustre server support for 3.17 kernels yet, so you can't use that combination today.
For clients you do not need to patch the kernel, but for servers you either need to use ldiskfs with a kernel that has patches for it, or use ZFS. You don't strictly need to patch even the server kernel anymore, but you will miss some performance improvements.
Cheers, Andreas
houssen <houssen(a)ipgp.fr> wrote on January 18, 2015 at 09:13:24 MST:
> Hello,
>
> I'm totally new to Lustre.
>
> First when I googled "lustre parallel file system", I hit this : http://wiki.lustre.org/index.php/Building_and_Installing_Lustre_from_Sour....
> Here it's said that to build lustre from source, I need basically to :
> 1. download a specific kernel lustre is optimized for (or probably validated with)
> 2. patch the kernel source code with quilt
> 3. compile and install the patched kernel
> 4. compile and install lustre-1.8
>
> After more googling, I got directed to : https://downloads.hpdd.intel.com/public/lustre/latest-maintenance-release....
> Here the install process seems to be as basic as "rpmbuild --rebuild lustre-2.5.x.src.rpm" according to https://wiki.hpdd.intel.com/display/PUB/Rebuilding+the+Lustre-client+rpms... (one may build a specific kernel with "rpmbuild --rebuild kernel-xxx.src.rpm", and then, build lustre with this specific kernel adding --define options when rpmbuild'ing lustre)
>
> Does this means the kernel patching (quilt) is no more necessary for lustre-2.5.x ? (or the kernel available for download on https://downloads.hpdd.intel.com/public/lustre/latest-maintenance-release is already patched ?)
> Is it recommended to build lustre-2.5.x with a 2.6.32 kernel ? Or not to build lustre with a specific kernel ?
> Final question that is not clear to me, does lustre must be configured with a --with-mpi-io and / or --with-hdf5 option to "account for" the existing MPI-IO / HDF5 install ? (my final aim is to benchmark big files writting using MPI-IO / HDF5 on a lustre FS)
>
> Franck
>
> PS : I run Fedora 21 (kernel 3-17-8) on a laptop
> _______________________________________________
> lwg mailing list
> lwg(a)lists.opensfs.org
> http://lists.opensfs.org/listinfo.cgi/lwg-opensfs.org
7 years, 4 months
[PATCH 0/6] staging: lustre: declare internal symbols as static
by Luca Ceresoli
Hi,
this small patch series fixes dozens of sparse warnings like:
warning: symbol '...' was not declared. Should it be static?
I previously sent it as one larger patch [1], but Greg couldn't apply it to his
staging-next because other patches had fixed some of the same issues in the
meantime. So, to reduce the probability of further conflicts, I'm resending
that patch as a set of smaller ones.
FWIW, this patchset applies on current master (v3.19-rc5), next (next-20150116),
staging-next (v3.19-rc2-138-gef4c653) and staging-testing
(v3.19-rc2-369-g06d30f0).
Luca
[1] http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2015-Ja...
Luca Ceresoli (6):
staging: lustre: mdc: declare internal symbols as static
staging: lustre: lmv: declare internal symbols as static
staging: lustre: libcfs: declare internal symbols as static
staging: lustre: llite: declare internal symbols as static
staging: lustre: fld: declare internal symbols as static
staging: lustre: lnet: declare internal symbols as static
drivers/staging/lustre/lnet/lnet/module.c | 2 +-
drivers/staging/lustre/lnet/selftest/conctl.c | 2 +-
drivers/staging/lustre/lnet/selftest/conrpc.c | 2 +-
drivers/staging/lustre/lnet/selftest/console.c | 2 +-
drivers/staging/lustre/lustre/fld/fld_cache.c | 6 +-
drivers/staging/lustre/lustre/fld/lproc_fld.c | 2 +-
drivers/staging/lustre/lustre/libcfs/debug.c | 8 +-
.../lustre/lustre/libcfs/linux/linux-curproc.c | 2 +-
.../lustre/lustre/libcfs/linux/linux-proc.c | 24 +++---
.../lustre/lustre/libcfs/linux/linux-tcpip.c | 2 +-
drivers/staging/lustre/lustre/libcfs/tracefile.c | 2 +-
drivers/staging/lustre/lustre/llite/dir.c | 4 +-
drivers/staging/lustre/lustre/llite/file.c | 3 +-
drivers/staging/lustre/lustre/lmv/lmv_obd.c | 87 +++++++++++-----------
drivers/staging/lustre/lustre/lmv/lproc_lmv.c | 4 +-
drivers/staging/lustre/lustre/mdc/mdc_request.c | 54 +++++++-------
16 files changed, 107 insertions(+), 99 deletions(-)
--
1.9.1
7 years, 4 months
[PATCH 1/2] staging/lustre: remove unused function
by Luca Ceresoli
Signed-off-by: Luca Ceresoli <luca(a)lucaceresoli.net>
Cc: Peng Tao <bergwolf(a)gmail.com>
Cc: HPDD-discuss(a)lists.01.org
Cc: devel(a)driverdev.osuosl.org
Cc: linux-kernel(a)vger.kernel.org
---
drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c b/drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c
index d71ad5e..9515347 100644
--- a/drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c
+++ b/drivers/staging/lustre/lustre/libcfs/linux/linux-curproc.c
@@ -88,11 +88,6 @@ void cfs_kernel_cap_pack(kernel_cap_t kcap, cfs_cap_t *cap)
*cap = kcap.cap[0];
}
-void cfs_kernel_cap_unpack(kernel_cap_t *kcap, cfs_cap_t cap)
-{
- kcap->cap[0] = cap;
-}
-
cfs_cap_t cfs_curproc_cap_pack(void)
{
cfs_cap_t cap;
--
1.9.1
7 years, 4 months
[PATCH] staging: lustre: remove kmalloc from fld_proc_hash_seq_write
by Tristan Lelong
This patch simplifies the fld_proc_hash_seq_write function
by removing the dynamic memory allocation.
The longest fh_name used so far in lustre is 4 characters.
We use a 8 bytes variable to be on the safe side.
Signed-off-by: Tristan Lelong <tristan(a)lelong.xyz>
---
Hi Greg,
This patch is a rework of "staging: lustre: fix sparse warning on LPROC_SEQ_FOPS macros" v3.
It applies on top of your latest staging-testing branch.
Regards
---
drivers/staging/lustre/lustre/fld/lproc_fld.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/lustre/lustre/fld/lproc_fld.c b/drivers/staging/lustre/lustre/fld/lproc_fld.c
index 74b4db9..9b26bb5 100644
--- a/drivers/staging/lustre/lustre/fld/lproc_fld.c
+++ b/drivers/staging/lustre/lustre/fld/lproc_fld.c
@@ -93,17 +93,13 @@ fld_proc_hash_seq_write(struct file *file,
{
struct lu_client_fld *fld;
struct lu_fld_hash *hash = NULL;
- char *name;
+ char fh_name[8];
int i;
- if (count > 80)
+ if (count > sizeof(fh_name))
return -ENAMETOOLONG;
- name = kmalloc(count, GFP_KERNEL);
- if (!name)
- return -ENOMEM;
-
- if (copy_from_user(name, buffer, count) != 0)
+ if (copy_from_user(fh_name, buffer, count) != 0)
return -EFAULT;
fld = ((struct seq_file *)file->private_data)->private;
@@ -113,7 +109,7 @@ fld_proc_hash_seq_write(struct file *file,
if (count != strlen(fld_hash[i].fh_name))
continue;
- if (!strncmp(fld_hash[i].fh_name, name, count)) {
+ if (!strncmp(fld_hash[i].fh_name, fh_name, count)) {
hash = &fld_hash[i];
break;
}
@@ -128,7 +124,6 @@ fld_proc_hash_seq_write(struct file *file,
fld->lcf_name, hash->fh_name);
}
- kfree(name);
return count;
}
--
2.1.3
7 years, 4 months
[PATCH] staging: lustre: Fix spacing error in libcfs_string.c
by Nickolaus Woodruff
This patch fixes the following checkpatch.pl error in libcfs_string.c:
ERROR: spaces required around that '='
Signed-off-by: Nickolaus Woodruff <nickolauswoodruff(a)gmail.com>
---
drivers/staging/lustre/lustre/libcfs/libcfs_string.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
index fb88733..e67a18d 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_string.c
@@ -132,7 +132,7 @@ char *cfs_firststr(char *str, size_t size)
++end;
}
- *end= '\0';
+ *end = '\0';
out:
return str;
}
--
1.9.1
7 years, 4 months