* [PATCH 1/4] staging: lustre: fix coding style issues
@ 2014-09-08 22:04 Hugues
2014-09-08 22:06 ` [PATCH 2/4] " Hugues
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Hugues @ 2014-09-08 22:04 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 76 bytes --]
Fix coding style issues:
* limit the length of changed lines to 80 columns.
[-- Attachment #2: 0001-staging-lustre-fix-coding-style-issues.patch --]
[-- Type: text/x-patch, Size: 6991 bytes --]
>From a244d32aa34d0b13ac40dd014b88d0ff5ed10817 Mon Sep 17 00:00:00 2001
From: Hugues Morisset <morisset.hugues@gmail.com>
Date: Mon, 8 Sep 2014 21:23:28 +0200
Subject: [PATCH 1/4] staging: lustre: fix coding style issues
Signed-off-by: Hugues Morisset <morisset.hugues@gmail.com>
---
drivers/staging/lustre/lustre/include/obd.h | 46 ++++++++++++++++-------------
1 file changed, 25 insertions(+), 21 deletions(-)
diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h
index 9f13878..b0afbb2 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -101,7 +101,8 @@ struct lov_stripe_md {
__u32 lw_magic;
__u32 lw_stripe_size; /* size of the stripe */
__u32 lw_pattern; /* striping pattern (RAID0, RAID1) */
- __u16 lw_stripe_count; /* number of objects being striped over */
+ __u16 lw_stripe_count;
+ /* number of objects being striped over */
__u16 lw_layout_gen; /* generation of the layout */
char lw_pool_name[LOV_MAXPOOLNAME]; /* pool name */
} lsm_wire;
@@ -336,10 +337,10 @@ struct client_obd {
* grant before trying to dirty a page and unreserve the rest.
* See osc_{reserve|unreserve}_grant for details. */
long cl_reserved_grant;
- struct list_head cl_cache_waiters; /* waiting for cache/grant */
- unsigned long cl_next_shrink_grant; /* jiffies */
- struct list_head cl_grant_shrink_list; /* Timeout event list */
- int cl_grant_shrink_interval; /* seconds */
+ struct list_head cl_cache_waiters; /* waiting for cache/grant */
+ unsigned long cl_next_shrink_grant; /* jiffies */
+ struct list_head cl_grant_shrink_list; /* Timeout event list */
+ int cl_grant_shrink_interval; /* seconds */
/* A chunk is an optimal size used by osc_extent to determine
* the extent size. A chunk is max(PAGE_CACHE_SIZE, OST block size) */
@@ -389,12 +390,12 @@ struct client_obd {
/* lru for osc caching pages */
struct cl_client_cache *cl_cache;
- struct list_head cl_lru_osc; /* member of cl_cache->ccc_lru */
+ struct list_head cl_lru_osc; /* member of cl_cache->ccc_lru */
atomic_t *cl_lru_left;
atomic_t cl_lru_busy;
atomic_t cl_lru_shrinkers;
atomic_t cl_lru_in_list;
- struct list_head cl_lru_list; /* lru page list */
+ struct list_head cl_lru_list; /* lru page list */
client_obd_lock_t cl_lru_list_lock; /* page list protector */
/* number of in flight destroy rpcs is limited to max_rpcs_in_flight */
@@ -500,9 +501,9 @@ struct lov_statfs_data {
};
/* Stripe placement optimization */
struct lov_qos {
- struct list_head lq_oss_list; /* list of OSSs that targets use */
+ struct list_head lq_oss_list; /* list of OSSs that targets use */
struct rw_semaphore lq_rw_sem;
- __u32 lq_active_oss_count;
+ __u32 lq_active_oss_count;
unsigned int lq_prio_free; /* priority for free space */
unsigned int lq_threshold_rr;/* priority for rr */
struct lov_qos_rr lq_rr; /* round robin qos data */
@@ -545,8 +546,8 @@ struct pool_desc {
struct hlist_node pool_hash; /* access by poolname */
struct list_head pool_list; /* serial access */
struct proc_dir_entry *pool_proc_entry; /* file in /proc */
- struct obd_device *pool_lobd; /* obd of the lov/lod to which
- * this pool belongs */
+ struct obd_device *pool_lobd; /* obd of the lov/lod to which
+ * this pool belongs */
};
struct lov_obd {
@@ -564,7 +565,7 @@ struct lov_obd {
int lov_connects;
int lov_pool_count;
struct cfs_hash *lov_pools_hash_body; /* used for key access */
- struct list_head lov_pool_list; /* used for sequential access */
+ struct list_head lov_pool_list; /* used for sequential access */
struct proc_dir_entry *lov_pool_proc_entry;
enum lustre_sec_part lov_sp_me;
@@ -639,7 +640,8 @@ struct niobuf_local {
#define LUSTRE_LWP_NAME "lwp"
/* obd device type names */
- /* FIXME all the references to LUSTRE_MDS_NAME should be swapped with LUSTRE_MDT_NAME */
+ /* FIXME all the references to LUSTRE_MDS_NAME
+ should be swapped with LUSTRE_MDT_NAME */
#define LUSTRE_MDS_NAME "mds"
#define LUSTRE_MDT_NAME "mdt"
#define LUSTRE_MDC_NAME "mdc"
@@ -708,7 +710,7 @@ struct obd_trans_info {
unsigned long oti_sync_write:1;
/* initial thread handling transaction */
- struct ptlrpc_thread * oti_thread;
+ struct ptlrpc_thread *oti_thread;
__u32 oti_conn_cnt;
/** VBR: versions */
__u64 oti_pre_version;
@@ -733,6 +735,7 @@ static inline void oti_init(struct obd_trans_info *oti,
if (req->rq_reqmsg != NULL &&
lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY) {
__u64 *pre_version = lustre_msg_get_versions(req->rq_reqmsg);
+
oti->oti_pre_version = pre_version ? pre_version[0] : 0;
oti->oti_transno = lustre_msg_get_transno(req->rq_reqmsg);
}
@@ -847,14 +850,15 @@ struct obd_device {
obd_recovering:1, /* there are recoverable clients */
obd_abort_recovery:1,/* recovery expired */
obd_version_recov:1, /* obd uses version checking */
- obd_replayable:1, /* recovery is enabled; inform clients */
- obd_no_transno:1, /* no committed-transno notification */
+ obd_replayable:1, /* recovery is enabled;
+ inform clients */
+ obd_no_transno:1, /* no committed-transno notification */
obd_no_recov:1, /* fail instead of retry messages */
obd_stopping:1, /* started cleanup */
obd_starting:1, /* started setup */
obd_force:1, /* cleanup with > 0 obd refcount */
obd_fail:1, /* cleanup with failover */
- obd_async_recov:1, /* allow asynchronous orphan cleanup */
+ obd_async_recov:1, /* allow asynchronous orphan cleanup */
obd_no_conn:1, /* deny new connections */
obd_inactive:1, /* device active/inactive
* (for /proc/status only!!) */
@@ -909,9 +913,9 @@ struct obd_device {
int obd_requests_queued_for_recovery;
wait_queue_head_t obd_next_transno_waitq;
/* protected by obd_recovery_task_lock */
- struct timer_list obd_recovery_timer;
- time_t obd_recovery_start; /* seconds */
- time_t obd_recovery_end; /* seconds, for lprocfs_status */
+ struct timer_list obd_recovery_timer;
+ time_t obd_recovery_start; /* seconds */
+ time_t obd_recovery_end; /* seconds, for lprocfs_status */
int obd_recovery_time_hard;
int obd_recovery_timeout;
int obd_recovery_ir_factor;
@@ -947,7 +951,7 @@ struct obd_device {
struct lprocfs_stats *obd_svc_stats;
atomic_t obd_evict_inprogress;
wait_queue_head_t obd_evict_inprogress_waitq;
- struct list_head obd_evict_list; /* protected with pet_lock */
+ struct list_head obd_evict_list; /* protected with pet_lock */
/**
* Ldlm pool part. Save last calculated SLV and Limit.
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/4] staging: lustre: fix coding style issues
2014-09-08 22:04 [PATCH 1/4] staging: lustre: fix coding style issues Hugues
@ 2014-09-08 22:06 ` Hugues
2014-09-08 22:07 ` [PATCH 3/4] " Hugues
2014-09-08 22:13 ` [PATCH 1/4] staging: lustre: fix coding style issues Greg KH
2014-09-08 22:21 ` Dan Carpenter
2 siblings, 1 reply; 9+ messages in thread
From: Hugues @ 2014-09-08 22:06 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 57 bytes --]
Fix coding style issues:
* Remove inappropriate typedefs
[-- Attachment #2: 0002-staging-lustre-fix-coding-style-issues.patch --]
[-- Type: text/x-patch, Size: 3436 bytes --]
>From a2c6d82141849cd102b5805941351a6b20df0e8a Mon Sep 17 00:00:00 2001
From: Hugues Morisset <morisset.hugues@gmail.com>
Date: Mon, 8 Sep 2014 21:36:10 +0200
Subject: [PATCH 2/4] staging: lustre: fix coding style issues
Signed-off-by: Hugues Morisset <morisset.hugues@gmail.com>
---
drivers/staging/lustre/lustre/include/obd.h | 10 +++-------
drivers/staging/lustre/lustre/lmv/lmv_obd.c | 2 +-
drivers/staging/lustre/lustre/lmv/lproc_lmv.c | 6 +++---
3 files changed, 7 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h
index b0afbb2..5f1d8c7 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -590,13 +590,11 @@ enum placement_policy {
PLACEMENT_MAX_POLICY
};
-typedef enum placement_policy placement_policy_t;
-
struct lmv_obd {
int refcount;
struct lu_client_fld lmv_fld;
spinlock_t lmv_lock;
- placement_policy_t lmv_placement;
+ enum placement_policy lmv_placement;
struct lmv_desc desc;
struct obd_uuid cluuid;
struct obd_export *exp;
@@ -1118,16 +1116,14 @@ enum op_cli_flags {
struct md_enqueue_info;
/* metadata stat-ahead */
-typedef int (* md_enqueue_cb_t)(struct ptlrpc_request *req,
- struct md_enqueue_info *minfo,
- int rc);
struct md_enqueue_info {
struct md_op_data mi_data;
struct lookup_intent mi_it;
struct lustre_handle mi_lockh;
struct inode *mi_dir;
- md_enqueue_cb_t mi_cb;
+ int (*mi_cb)(struct ptlrpc_request *req,
+ struct md_enqueue_info *minfo, int rc);
__u64 mi_cbdata;
unsigned int mi_generation;
};
diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index dfb10d6..1a58212 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -1189,7 +1189,7 @@ static int lmv_nid_policy(struct lmv_obd *lmv)
}
static int lmv_choose_mds(struct lmv_obd *lmv, struct md_op_data *op_data,
- placement_policy_t placement)
+ enum placement_policy placement)
{
switch (placement) {
case PLACEMENT_CHAR_POLICY:
diff --git a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c
index a7814f1..1170020 100644
--- a/drivers/staging/lustre/lustre/lmv/lproc_lmv.c
+++ b/drivers/staging/lustre/lustre/lmv/lproc_lmv.c
@@ -58,7 +58,7 @@ static const char *placement_name[] = {
[PLACEMENT_INVAL_POLICY] = "INVAL"
};
-static placement_policy_t placement_name2policy(char *name, int len)
+static enum placement_policy placement_name2policy(char *name, int len)
{
int i;
@@ -69,7 +69,7 @@ static placement_policy_t placement_name2policy(char *name, int len)
return PLACEMENT_INVAL_POLICY;
}
-static const char *placement_policy2name(placement_policy_t placement)
+static const char *placement_policy2name(enum placement_policy placement)
{
LASSERT(placement < PLACEMENT_MAX_POLICY);
return placement_name[placement];
@@ -94,7 +94,7 @@ static ssize_t lmv_placement_seq_write(struct file *file,
struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
char dummy[MAX_POLICY_STRING_SIZE + 1];
int len = count;
- placement_policy_t policy;
+ enum placement_policy policy;
struct lmv_obd *lmv;
if (copy_from_user(dummy, buffer, MAX_POLICY_STRING_SIZE))
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/4] staging: lustre: fix coding style issues
2014-09-08 22:06 ` [PATCH 2/4] " Hugues
@ 2014-09-08 22:07 ` Hugues
2014-09-08 22:09 ` Hugues
2014-09-08 22:12 ` [PATCH 4/4] staging: lustre: Fix potential buffer underflow Hugues
0 siblings, 2 replies; 9+ messages in thread
From: Hugues @ 2014-09-08 22:07 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-kernel
Fix coding style issues:
* Remove extra space in function's pointers
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 3/4] staging: lustre: fix coding style issues
2014-09-08 22:07 ` [PATCH 3/4] " Hugues
@ 2014-09-08 22:09 ` Hugues
2014-09-08 22:12 ` [PATCH 4/4] staging: lustre: Fix potential buffer underflow Hugues
1 sibling, 0 replies; 9+ messages in thread
From: Hugues @ 2014-09-08 22:09 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 147 bytes --]
On 09/09/2014 12:07 AM, Hugues wrote:
> Fix coding style issues:
> * Remove extra space in function's pointers
>
Sorry, I forgot the attachment.
[-- Attachment #2: 0003-staging-lustre-fix-coding-style-issues.patch --]
[-- Type: text/x-patch, Size: 2181 bytes --]
>From d4ec8f9a9452102f0b044758bf407782665baa68 Mon Sep 17 00:00:00 2001
From: Hugues Morisset <morisset.hugues@gmail.com>
Date: Mon, 8 Sep 2014 21:39:27 +0200
Subject: [PATCH 3/4] staging: lustre: fix coding style issues
Signed-off-by: Hugues Morisset <morisset.hugues@gmail.com>
---
drivers/staging/lustre/lustre/include/obd.h | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h
index 5f1d8c7..409eae6 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -1141,7 +1141,7 @@ struct obd_ops {
struct ptlrpc_request_set *set);
int (*o_attach)(struct obd_device *dev, u32 len, void *data);
int (*o_detach)(struct obd_device *dev);
- int (*o_setup) (struct obd_device *dev, struct lustre_cfg *cfg);
+ int (*o_setup)(struct obd_device *dev, struct lustre_cfg *cfg);
int (*o_precleanup)(struct obd_device *dev,
enum obd_cleanup_stage cleanup_stage);
int (*o_cleanup)(struct obd_device *dev);
@@ -1276,7 +1276,7 @@ struct obd_ops {
enum obd_notify_event ev, void *data);
int (*o_health_check)(const struct lu_env *env, struct obd_device *);
- struct obd_uuid *(*o_get_uuid) (struct obd_export *exp);
+ struct obd_uuid *(*o_get_uuid)(struct obd_export *exp);
/* quota methods */
int (*o_quotacheck)(struct obd_device *, struct obd_export *,
@@ -1448,9 +1448,9 @@ struct lsm_operations {
u64 *);
void (*lsm_stripe_by_offset)(struct lov_stripe_md *, int *, u64 *,
u64 *);
- int (*lsm_lmm_verify) (struct lov_mds_md *lmm, int lmm_bytes,
+ int (*lsm_lmm_verify)(struct lov_mds_md *lmm, int lmm_bytes,
__u16 *stripe_count);
- int (*lsm_unpackmd) (struct lov_obd *lov, struct lov_stripe_md *lsm,
+ int (*lsm_unpackmd)(struct lov_obd *lov, struct lov_stripe_md *lsm,
struct lov_mds_md *lmm);
};
@@ -1481,6 +1481,7 @@ static inline struct lustre_capa *oinfo_capa(struct obd_info *oinfo)
static inline struct md_open_data *obd_mod_alloc(void)
{
struct md_open_data *mod;
+
OBD_ALLOC_PTR(mod);
if (mod == NULL)
return NULL;
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/4] staging: lustre: Fix potential buffer underflow
2014-09-08 22:07 ` [PATCH 3/4] " Hugues
2014-09-08 22:09 ` Hugues
@ 2014-09-08 22:12 ` Hugues
2014-09-08 22:38 ` Dan Carpenter
1 sibling, 1 reply; 9+ messages in thread
From: Hugues @ 2014-09-08 22:12 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 176 bytes --]
Fix potential buffer underflow
When the string 'name' start with a '-' ptr == name and so --ptr will
underflow, this patch corrected this by checking ptr before decrementing.
[-- Attachment #2: 0004-staging-lustre-Fix-potential-buffer-underflow.patch --]
[-- Type: text/x-patch, Size: 926 bytes --]
>From 5786040323bd1dc3149fb4afbea9f01e2bf4cfdf Mon Sep 17 00:00:00 2001
From: Hugues Morisset <morisset.hugues@gmail.com>
Date: Mon, 8 Sep 2014 22:59:04 +0200
Subject: [PATCH 4/4] staging: lustre: Fix potential buffer underflow
Signed-off-by: Hugues Morisset <morisset.hugues@gmail.com>
---
drivers/staging/lustre/lustre/include/obd.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h
index 409eae6..bb67e40 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -677,7 +677,12 @@ static inline int is_osp_on_mdt(char *name)
if (strncmp(ptr + 1, "MDT", 3) != 0)
return 0;
- while (*(--ptr) != '-' && ptr != name);
+ if (ptr == name)
+ return 0;
+
+ --ptr;
+ while (ptr != '-' && ptr != name)
+ --ptr;
if (ptr == name)
return 0;
--
2.1.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 4/4] staging: lustre: Fix potential buffer underflow
2014-09-08 22:12 ` [PATCH 4/4] staging: lustre: Fix potential buffer underflow Hugues
@ 2014-09-08 22:38 ` Dan Carpenter
2014-09-08 23:31 ` Drokin, Oleg
0 siblings, 1 reply; 9+ messages in thread
From: Dan Carpenter @ 2014-09-08 22:38 UTC (permalink / raw)
To: Hugues, Oleg Drokin; +Cc: gregkh, devel, linux-kernel, Andreas Dilger
On Tue, Sep 09, 2014 at 12:12:01AM +0200, Hugues wrote:
> Fix potential buffer underflow
>
> When the string 'name' start with a '-' ptr == name and so --ptr will
> underflow, this patch corrected this by checking ptr before decrementing.
Good eye. Please fix up the changelog and send it inline etc and
resend. I've added Oleg and Andreas to the CC list so that this doesn't
get lost.
regards,
dan carpenter
> >From 5786040323bd1dc3149fb4afbea9f01e2bf4cfdf Mon Sep 17 00:00:00 2001
> From: Hugues Morisset <morisset.hugues@gmail.com>
> Date: Mon, 8 Sep 2014 22:59:04 +0200
> Subject: [PATCH 4/4] staging: lustre: Fix potential buffer underflow
>
> Signed-off-by: Hugues Morisset <morisset.hugues@gmail.com>
> ---
> drivers/staging/lustre/lustre/include/obd.h | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h
> index 409eae6..bb67e40 100644
> --- a/drivers/staging/lustre/lustre/include/obd.h
> +++ b/drivers/staging/lustre/lustre/include/obd.h
> @@ -677,7 +677,12 @@ static inline int is_osp_on_mdt(char *name)
> if (strncmp(ptr + 1, "MDT", 3) != 0)
> return 0;
>
> - while (*(--ptr) != '-' && ptr != name);
> + if (ptr == name)
> + return 0;
> +
> + --ptr;
> + while (ptr != '-' && ptr != name)
> + --ptr;
>
> if (ptr == name)
> return 0;
> --
> 2.1.0
>
> _______________________________________________
> devel mailing list
> devel@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 4/4] staging: lustre: Fix potential buffer underflow
2014-09-08 22:38 ` Dan Carpenter
@ 2014-09-08 23:31 ` Drokin, Oleg
0 siblings, 0 replies; 9+ messages in thread
From: Drokin, Oleg @ 2014-09-08 23:31 UTC (permalink / raw)
To: Dan Carpenter
Cc: Hugues, <gregkh@linuxfoundation.org>,
<devel@driverdev.osuosl.org>,
<linux-kernel@vger.kernel.org>,
Dilger, Andreas
Thanks!
Actually, I do't think this function is useful on the client.
>From the name of it, it would have been used in the server code, but even there it was recently removed as I now see.
I'll submit a removal patch.
On Sep 8, 2014, at 6:38 PM, Dan Carpenter wrote:
> On Tue, Sep 09, 2014 at 12:12:01AM +0200, Hugues wrote:
>> Fix potential buffer underflow
>>
>> When the string 'name' start with a '-' ptr == name and so --ptr will
>> underflow, this patch corrected this by checking ptr before decrementing.
>
> Good eye. Please fix up the changelog and send it inline etc and
> resend. I've added Oleg and Andreas to the CC list so that this doesn't
> get lost.
>
> regards,
> dan carpenter
>
>>> From 5786040323bd1dc3149fb4afbea9f01e2bf4cfdf Mon Sep 17 00:00:00 2001
>> From: Hugues Morisset <morisset.hugues@gmail.com>
>> Date: Mon, 8 Sep 2014 22:59:04 +0200
>> Subject: [PATCH 4/4] staging: lustre: Fix potential buffer underflow
>>
>> Signed-off-by: Hugues Morisset <morisset.hugues@gmail.com>
>> ---
>> drivers/staging/lustre/lustre/include/obd.h | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/lustre/lustre/include/obd.h b/drivers/staging/lustre/lustre/include/obd.h
>> index 409eae6..bb67e40 100644
>> --- a/drivers/staging/lustre/lustre/include/obd.h
>> +++ b/drivers/staging/lustre/lustre/include/obd.h
>> @@ -677,7 +677,12 @@ static inline int is_osp_on_mdt(char *name)
>> if (strncmp(ptr + 1, "MDT", 3) != 0)
>> return 0;
>>
>> - while (*(--ptr) != '-' && ptr != name);
>> + if (ptr == name)
>> + return 0;
>> +
>> + --ptr;
>> + while (ptr != '-' && ptr != name)
>> + --ptr;
>>
>> if (ptr == name)
>> return 0;
>> --
>> 2.1.0
>>
>
>> _______________________________________________
>> devel mailing list
>> devel@linuxdriverproject.org
>> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/4] staging: lustre: fix coding style issues
2014-09-08 22:04 [PATCH 1/4] staging: lustre: fix coding style issues Hugues
2014-09-08 22:06 ` [PATCH 2/4] " Hugues
@ 2014-09-08 22:13 ` Greg KH
2014-09-08 22:21 ` Dan Carpenter
2 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2014-09-08 22:13 UTC (permalink / raw)
To: Hugues; +Cc: devel, linux-kernel
On Tue, Sep 09, 2014 at 12:04:43AM +0200, Hugues wrote:
> Fix coding style issues:
> * limit the length of changed lines to 80 columns.
Why isn't this in the body of the changelog?
> >From a244d32aa34d0b13ac40dd014b88d0ff5ed10817 Mon Sep 17 00:00:00 2001
> From: Hugues Morisset <morisset.hugues@gmail.com>
> Date: Mon, 8 Sep 2014 21:23:28 +0200
> Subject: [PATCH 1/4] staging: lustre: fix coding style issues
>
> Signed-off-by: Hugues Morisset <morisset.hugues@gmail.com>
> ---
> drivers/staging/lustre/lustre/include/obd.h | 46 ++++++++++++++++-------------
> 1 file changed, 25 insertions(+), 21 deletions(-)
I can't take patches in attachments, please put them in-line and use git
send-email to send them properly.
Please fix up and resend this whole series.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 1/4] staging: lustre: fix coding style issues
2014-09-08 22:04 [PATCH 1/4] staging: lustre: fix coding style issues Hugues
2014-09-08 22:06 ` [PATCH 2/4] " Hugues
2014-09-08 22:13 ` [PATCH 1/4] staging: lustre: fix coding style issues Greg KH
@ 2014-09-08 22:21 ` Dan Carpenter
2 siblings, 0 replies; 9+ messages in thread
From: Dan Carpenter @ 2014-09-08 22:21 UTC (permalink / raw)
To: Hugues; +Cc: gregkh, devel, linux-kernel
Fix your email "From" header to say your full name instead of just
From: Hugues <morisset.hugues@gmail.com>
All the subjects are the same so redo these patches. Also don't pick
the most vague subject you can think of. Mention "long lines", for
example.
On Tue, Sep 09, 2014 at 12:04:43AM +0200, Hugues wrote:
> Fix coding style issues:
> * limit the length of changed lines to 80 columns.
Send the patch inline and not as an attachment.
Most of these changes are improvements, but I have some additional
comments inline.
> --- a/drivers/staging/lustre/lustre/include/obd.h
> +++ b/drivers/staging/lustre/lustre/include/obd.h
> @@ -101,7 +101,8 @@ struct lov_stripe_md {
> __u32 lw_magic;
> __u32 lw_stripe_size; /* size of the stripe */
> __u32 lw_pattern; /* striping pattern (RAID0, RAID1) */
> - __u16 lw_stripe_count; /* number of objects being striped over */
> + __u16 lw_stripe_count;
> + /* number of objects being striped over */
The comment goes on the line before the data so now it looks like it
goes with lw_layout_gen.
> __u16 lw_layout_gen; /* generation of the layout */
> char lw_pool_name[LOV_MAXPOOLNAME]; /* pool name */
> @@ -639,7 +640,8 @@ struct niobuf_local {
> #define LUSTRE_LWP_NAME "lwp"
>
> /* obd device type names */
> - /* FIXME all the references to LUSTRE_MDS_NAME should be swapped with LUSTRE_MDT_NAME */
> + /* FIXME all the references to LUSTRE_MDS_NAME
> + should be swapped with LUSTRE_MDT_NAME */
This comment is not in kernel style. Read Documentation/CodingStyle
> @@ -733,6 +735,7 @@ static inline void oti_init(struct obd_trans_info *oti,
> if (req->rq_reqmsg != NULL &&
> lustre_msg_get_flags(req->rq_reqmsg) & MSG_REPLAY) {
> __u64 *pre_version = lustre_msg_get_versions(req->rq_reqmsg);
> +
> oti->oti_pre_version = pre_version ? pre_version[0] : 0;
This is unrelated to long lines.
> oti->oti_transno = lustre_msg_get_transno(req->rq_reqmsg);
> }
> @@ -847,14 +850,15 @@ struct obd_device {
> obd_recovering:1, /* there are recoverable clients */
> obd_abort_recovery:1,/* recovery expired */
> obd_version_recov:1, /* obd uses version checking */
> - obd_replayable:1, /* recovery is enabled; inform clients */
> - obd_no_transno:1, /* no committed-transno notification */
> + obd_replayable:1, /* recovery is enabled;
> + inform clients */
> + obd_no_transno:1, /* no committed-transno notification */
Sometimes the code looks better if you just go past the 80 character
limit. The columns line up nicer. Remember, checkpatch.pl serves you;
you are not the servant to it.
> @@ -909,9 +913,9 @@ struct obd_device {
> int obd_requests_queued_for_recovery;
> wait_queue_head_t obd_next_transno_waitq;
> /* protected by obd_recovery_task_lock */
> - struct timer_list obd_recovery_timer;
> - time_t obd_recovery_start; /* seconds */
> - time_t obd_recovery_end; /* seconds, for lprocfs_status */
> + struct timer_list obd_recovery_timer;
> + time_t obd_recovery_start; /* seconds */
> + time_t obd_recovery_end; /* seconds, for lprocfs_status */
Random alignment.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2014-09-08 23:32 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-08 22:04 [PATCH 1/4] staging: lustre: fix coding style issues Hugues
2014-09-08 22:06 ` [PATCH 2/4] " Hugues
2014-09-08 22:07 ` [PATCH 3/4] " Hugues
2014-09-08 22:09 ` Hugues
2014-09-08 22:12 ` [PATCH 4/4] staging: lustre: Fix potential buffer underflow Hugues
2014-09-08 22:38 ` Dan Carpenter
2014-09-08 23:31 ` Drokin, Oleg
2014-09-08 22:13 ` [PATCH 1/4] staging: lustre: fix coding style issues Greg KH
2014-09-08 22:21 ` Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.