[PATCH 09/14] staging/lustre/ptlrpc: Suppress error for flock requests

2016-11-02 Thread Oleg Drokin
From: Patrick Farrell 

-EAGAIN is a normal return when requesting POSIX flocks.
We can't recognize exactly that case here, but it's the
only case that should result in -EAGAIN on LDLM_ENQUEUE, so
don't print to console in that case.

Signed-off-by: Patrick Farrell 
Reviewed-on: http://review.whamcloud.com/22856
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8658
Reviewed-by: Andreas Dilger 
Reviewed-by: Bob Glossman 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ptlrpc/client.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/client.c 
b/drivers/staging/lustre/lustre/ptlrpc/client.c
index 7cbfb4c..bb7ae4e 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/client.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/client.c
@@ -1191,7 +1191,9 @@ static int ptlrpc_check_status(struct ptlrpc_request *req)
lnet_nid_t nid = imp->imp_connection->c_peer.nid;
__u32 opc = lustre_msg_get_opc(req->rq_reqmsg);
 
-   if (ptlrpc_console_allow(req))
+   /* -EAGAIN is normal when using POSIX flocks */
+   if (ptlrpc_console_allow(req) &&
+   !(opc == LDLM_ENQUEUE && err == -EAGAIN))
LCONSOLE_ERROR_MSG(0x011, "%s: operation %s to node %s 
failed: rc = %d\n",
   imp->imp_obd->obd_name,
   ll_opcode2str(opc),
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 13/14] staging/lustre/llite: do not clear uptodate bit in page delete

2016-11-02 Thread Oleg Drokin
From: Jinshan Xiong 

Otherwise, if the race between page fault and truncate occurs, it
will cause the page fault routine to return an EIO error.

In filemap_fault() {
page_not_uptodate:
...
ClearPageError(page);
error = mapping->a_ops->readpage(file, page);
if (!error) {
wait_on_page_locked(page);
if (!PageUptodate(page))
error = -EIO;
}
...
}

However, I tend to think this is a defect in kernel implementation,
because it assumes PageUptodate shouldn't be cleared but file read
routine doesn't make the same assumption.

Signed-off-by: Jinshan Xiong 
Reviewed-on: http://review.whamcloud.com/22827
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8633
Reviewed-by: Li Dongyang 
Reviewed-by: Bobi Jam 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/vvp_page.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/vvp_page.c 
b/drivers/staging/lustre/lustre/llite/vvp_page.c
index 25490a5..23d6630 100644
--- a/drivers/staging/lustre/lustre/llite/vvp_page.c
+++ b/drivers/staging/lustre/lustre/llite/vvp_page.c
@@ -166,7 +166,6 @@ static void vvp_page_delete(const struct lu_env *env,
refc = atomic_dec_return(&page->cp_ref);
LASSERTF(refc >= 1, "page = %p, refc = %d\n", page, refc);
 
-   ClearPageUptodate(vmpage);
ClearPagePrivate(vmpage);
vmpage->private = 0;
/*
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 14/14] staging/lustre: Get rid of LIBLUSTRE_CLIENT and its users

2016-11-02 Thread Oleg Drokin
This define only made sense in a userspace library client, not in the kernel.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_lib.h |  2 --
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  | 15 +--
 2 files changed, 1 insertion(+), 16 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_lib.h 
b/drivers/staging/lustre/lustre/include/lustre_lib.h
index 6b23191..27f3148 100644
--- a/drivers/staging/lustre/lustre/include/lustre_lib.h
+++ b/drivers/staging/lustre/lustre/include/lustre_lib.h
@@ -350,8 +350,6 @@ do {
   \
l_wait_event_exclusive_head(wq, condition, &lwi);   \
 })
 
-#define LIBLUSTRE_CLIENT (0)
-
 /** @} lib */
 
 #endif /* _LUSTRE_LIB_H */
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
index c5d00d1..6a96f2c 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
@@ -475,12 +475,7 @@ int ldlm_cli_enqueue_fini(struct obd_export *exp, struct 
ptlrpc_request *req,
   "client-side enqueue, new policy data");
}
 
-   if ((*flags) & LDLM_FL_AST_SENT ||
-   /* Cancel extent locks as soon as possible on a liblustre client,
-* because it cannot handle asynchronous ASTs robustly (see
-* bug 7311).
-*/
-   (LIBLUSTRE_CLIENT && type == LDLM_EXTENT)) {
+   if ((*flags) & LDLM_FL_AST_SENT) {
lock_res_and_lock(lock);
lock->l_flags |= LDLM_FL_CBPENDING |  LDLM_FL_BL_AST;
unlock_res_and_lock(lock);
@@ -775,14 +770,6 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct 
ptlrpc_request **reqp,
body->lock_flags = ldlm_flags_to_wire(*flags);
body->lock_handle[0] = *lockh;
 
-   /*
-* Liblustre client doesn't get extent locks, except for O_APPEND case
-* where [0, OBD_OBJECT_EOF] lock is taken, or truncate, where
-* [i_size, OBD_OBJECT_EOF] lock is taken.
-*/
-   LASSERT(ergo(LIBLUSTRE_CLIENT, einfo->ei_type != LDLM_EXTENT ||
-policy->l_extent.end == OBD_OBJECT_EOF));
-
if (async) {
LASSERT(reqp);
return 0;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 11/14] staging/lustre/ptlrpc: Correctly calculate hrp->hrp_nthrs

2016-11-02 Thread Oleg Drokin
From: Amir Shehata 

cpu_pattern can specify exactly 1 cpu in a partition:
"0[0]". That means CPT0 will have CPU 0. CPU 0 can have
hyperthreading enabled. This combination would result in

weight = cfs_cpu_ht_nsiblings(0);
hrp->hrp_nthrs = cfs_cpt_weight(ptlrpc_hr.hr_cpt_table, i);
hrp->hrp_nthrs /= weight;

evaluating to 0. Where
cfs_cpt_weight(ptlrpc_hr.hr_cpt_table, i) == 1
weight == 2

Therefore, if hrp_nthrs becomes zero, just set it to 1.

Signed-off-by: Amir Shehata 
Reviewed-on: http://review.whamcloud.com/19106
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8492
Reviewed-by: Liang Zhen 
Reviewed-by: Doug Oucharek 
Reviewed-by: James Simmons 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ptlrpc/service.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c 
b/drivers/staging/lustre/lustre/ptlrpc/service.c
index 72f3930..fc754e7 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/service.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/service.c
@@ -2541,8 +2541,9 @@ int ptlrpc_hr_init(void)
 
hrp->hrp_nthrs = cfs_cpt_weight(ptlrpc_hr.hr_cpt_table, i);
hrp->hrp_nthrs /= weight;
+   if (hrp->hrp_nthrs == 0)
+   hrp->hrp_nthrs = 1;
 
-   LASSERT(hrp->hrp_nthrs > 0);
hrp->hrp_thrs =
kzalloc_node(hrp->hrp_nthrs * sizeof(*hrt), GFP_NOFS,
 cfs_cpt_spread_node(ptlrpc_hr.hr_cpt_table,
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 12/14] staging/lustre/llite: update ras window correctly

2016-11-02 Thread Oleg Drokin
From: Bobi Jam 

When stride-RA hit case miss, we only reset normal sequential
read-ahead window, but not reset the stride IO to avoid the overhead
of re-detecting stride IO. While when the normal RA window is set
to not insect with the stride-RA window, when we try to increase
the stride-RA window length later, the presumption does not hold.

This patch resets the stride IO as well in this case.

Signed-off-by: Bobi Jam 
Reviewed-on: http://review.whamcloud.com/23032
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8683
Reviewed-by: wangdi 
Reviewed-by: Jinshan Xiong 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/rw.c | 15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/rw.c 
b/drivers/staging/lustre/lustre/llite/rw.c
index d2515a8..e34017d 100644
--- a/drivers/staging/lustre/lustre/llite/rw.c
+++ b/drivers/staging/lustre/lustre/llite/rw.c
@@ -809,13 +809,20 @@ static void ras_update(struct ll_sb_info *sbi, struct 
inode *inode,
if (ra_miss) {
if (index_in_stride_window(ras, index) &&
stride_io_mode(ras)) {
-   /*If stride-RA hit cache miss, the stride dector
-*will not be reset to avoid the overhead of
-*redetecting read-ahead mode
-*/
if (index != ras->ras_last_readpage + 1)
ras->ras_consecutive_pages = 0;
ras_reset(inode, ras, index);
+
+   /* If stride-RA hit cache miss, the stride
+* detector will not be reset to avoid the
+* overhead of redetecting read-ahead mode,
+* but on the condition that the stride window
+* is still intersect with normal sequential
+* read-ahead window.
+*/
+   if (ras->ras_window_start <
+   ras->ras_stride_offset)
+   ras_stride_reset(ras);
RAS_CDEBUG(ras);
} else {
/* Reset both stride window and normal RA
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 10/14] staging/lustre/llite: protect from accessing NULL lli_clob

2016-11-02 Thread Oleg Drokin
From: Bobi Jam 

Need to check file's lli_clob object before calling
lov_read_and_clear_async_rc().

Signed-off-by: Bobi Jam 
Reviewed-by: Jinshan Xiong 
Reviewed-by: Oleg Drokin 
Reviewed-on: http://review.whamcloud.com/23031
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8682
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/file.c | 8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/file.c 
b/drivers/staging/lustre/lustre/llite/file.c
index c1c7551..7886840 100644
--- a/drivers/staging/lustre/lustre/llite/file.c
+++ b/drivers/staging/lustre/lustre/llite/file.c
@@ -2328,9 +2328,11 @@ int ll_fsync(struct file *file, loff_t start, loff_t 
end, int datasync)
lli->lli_async_rc = 0;
if (rc == 0)
rc = err;
-   err = lov_read_and_clear_async_rc(lli->lli_clob);
-   if (rc == 0)
-   rc = err;
+   if (lli->lli_clob) {
+   err = lov_read_and_clear_async_rc(lli->lli_clob);
+   if (rc == 0)
+   rc = err;
+   }
}
 
err = md_sync(ll_i2sbi(inode)->ll_md_exp, ll_inode2fid(inode), &req);
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 08/14] staging/lustre/ldlm: engage ELC for all ldlm enqueue req

2016-11-02 Thread Oleg Drokin
From: Hongchao Zhang 

If there is no request passed into ldlm_cli_enqueue, the enqueue
request will not engage ELC to drop unneeded locks. currently,
this kind of request is mainly related to EXTENT locks enqueue
requests (except for glimpse EXTENT lock for it has an intent).

Signed-off-by: Hongchao Zhang 
Reviewed-on: http://review.whamcloud.com/21739
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8209
Reviewed-by: Andreas Dilger 
Reviewed-by: Vitaly Fertman 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 21 -
 1 file changed, 4 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
index 1b9ae77..c5d00d1 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
@@ -748,17 +748,14 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct 
ptlrpc_request **reqp,
lock->l_last_activity = ktime_get_real_seconds();
 
/* lock not sent to server yet */
-
if (!reqp || !*reqp) {
-   req = ptlrpc_request_alloc_pack(class_exp2cliimp(exp),
-   &RQF_LDLM_ENQUEUE,
-   LUSTRE_DLM_VERSION,
-   LDLM_ENQUEUE);
-   if (!req) {
+   req = ldlm_enqueue_pack(exp, lvb_len);
+   if (IS_ERR(req)) {
failed_lock_cleanup(ns, lock, einfo->ei_mode);
LDLM_LOCK_RELEASE(lock);
-   return -ENOMEM;
+   return PTR_ERR(req);
}
+
req_passed_in = 0;
if (reqp)
*reqp = req;
@@ -778,16 +775,6 @@ int ldlm_cli_enqueue(struct obd_export *exp, struct 
ptlrpc_request **reqp,
body->lock_flags = ldlm_flags_to_wire(*flags);
body->lock_handle[0] = *lockh;
 
-   /* Continue as normal. */
-   if (!req_passed_in) {
-   if (lvb_len > 0)
-   req_capsule_extend(&req->rq_pill,
-  &RQF_LDLM_ENQUEUE_LVB);
-   req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER,
-lvb_len);
-   ptlrpc_request_set_replen(req);
-   }
-
/*
 * Liblustre client doesn't get extent locks, except for O_APPEND case
 * where [0, OBD_OBJECT_EOF] lock is taken, or truncate, where
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 07/14] staging/lustre/ldlm: Reinstate ldlm_enqueue_pack()

2016-11-02 Thread Oleg Drokin
The function becomes used again with the next patch, so bring it back
from dead, only this time make it static.

Reverts: bf2a033360f7 ("staging/lustre/ldlm: Remove unused ldlm_enqueue_pack()")
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 21 +
 1 file changed, 21 insertions(+)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
index 6e704c7..1b9ae77 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
@@ -657,6 +657,27 @@ int ldlm_prep_enqueue_req(struct obd_export *exp, struct 
ptlrpc_request *req,
 }
 EXPORT_SYMBOL(ldlm_prep_enqueue_req);
 
+static struct ptlrpc_request *ldlm_enqueue_pack(struct obd_export *exp,
+   int lvb_len)
+{
+   struct ptlrpc_request *req;
+   int rc;
+
+   req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_LDLM_ENQUEUE);
+   if (!req)
+   return ERR_PTR(-ENOMEM);
+
+   rc = ldlm_prep_enqueue_req(exp, req, NULL, 0);
+   if (rc) {
+   ptlrpc_request_free(req);
+   return ERR_PTR(rc);
+   }
+
+   req_capsule_set_size(&req->rq_pill, &RMF_DLM_LVB, RCL_SERVER, lvb_len);
+   ptlrpc_request_set_replen(req);
+   return req;
+}
+
 /**
  * Client-side lock enqueue.
  *
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 05/14] staging/lustre: Get rid of cl_env hash table

2016-11-02 Thread Oleg Drokin
From: Jinshan Xiong 

cl_env hash table is under heavy contention when there are lots of
processes doing IO at the same time;
reduce lock contention by replacing cl_env cache with percpu array;
remove cl_env_nested_get() and cl_env_nested_put();
remove cl_env_reenter() and cl_env_reexit();

Signed-off-by: Jinshan Xiong 
Reviewed-on: http://review.whamcloud.com/20254
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4257
Reviewed-by: Andreas Dilger 
Reviewed-by: Bobi Jam 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/cl_object.h  |  22 --
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c |   9 -
 drivers/staging/lustre/lustre/llite/file.c |  18 +-
 drivers/staging/lustre/lustre/llite/lcommon_cl.c   |  11 +-
 drivers/staging/lustre/lustre/llite/lcommon_misc.c |   8 +-
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |  59 ++--
 drivers/staging/lustre/lustre/llite/rw.c   |   6 +-
 drivers/staging/lustre/lustre/llite/rw26.c |  16 +-
 drivers/staging/lustre/lustre/lov/lov_io.c |   5 -
 drivers/staging/lustre/lustre/lov/lov_object.c |   7 +-
 .../staging/lustre/lustre/obdclass/cl_internal.h   |  23 --
 drivers/staging/lustre/lustre/obdclass/cl_io.c |   1 -
 drivers/staging/lustre/lustre/obdclass/cl_object.c | 389 -
 drivers/staging/lustre/lustre/obdclass/lu_object.c |   4 -
 .../staging/lustre/lustre/obdecho/echo_client.c|  14 +-
 drivers/staging/lustre/lustre/osc/osc_cache.c  |   6 +-
 drivers/staging/lustre/lustre/osc/osc_lock.c   | 116 +++---
 drivers/staging/lustre/lustre/osc/osc_page.c   |   6 +-
 18 files changed, 183 insertions(+), 537 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/cl_object.h 
b/drivers/staging/lustre/lustre/include/cl_object.h
index 514d650..3fe26e7 100644
--- a/drivers/staging/lustre/lustre/include/cl_object.h
+++ b/drivers/staging/lustre/lustre/include/cl_object.h
@@ -2640,35 +2640,13 @@ void cl_sync_io_end(const struct lu_env *env, struct 
cl_sync_io *anchor);
  * - allocation and destruction of environment is amortized by caching no
  * longer used environments instead of destroying them;
  *
- * - there is a notion of "current" environment, attached to the kernel
- * data structure representing current thread Top-level lustre code
- * allocates an environment and makes it current, then calls into
- * non-lustre code, that in turn calls lustre back. Low-level lustre
- * code thus called can fetch environment created by the top-level code
- * and reuse it, avoiding additional environment allocation.
- *   Right now, three interfaces can attach the cl_env to running thread:
- *   - cl_env_get
- *   - cl_env_implant
- *   - cl_env_reexit(cl_env_reenter had to be called priorly)
- *
  * \see lu_env, lu_context, lu_context_key
  * @{
  */
 
-struct cl_env_nest {
-   int   cen_refcheck;
-   void *cen_cookie;
-};
-
 struct lu_env *cl_env_get(int *refcheck);
 struct lu_env *cl_env_alloc(int *refcheck, __u32 tags);
-struct lu_env *cl_env_nested_get(struct cl_env_nest *nest);
 void cl_env_put(struct lu_env *env, int *refcheck);
-void cl_env_nested_put(struct cl_env_nest *nest, struct lu_env *env);
-void *cl_env_reenter(void);
-void cl_env_reexit(void *cookie);
-void cl_env_implant(struct lu_env *env, int *refcheck);
-void cl_env_unplant(struct lu_env *env, int *refcheck);
 unsigned int cl_env_cache_purge(unsigned int nr);
 struct lu_env *cl_env_percpu_get(void);
 void cl_env_percpu_put(struct lu_env *env);
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
index b29c9561..19831c5 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_pool.c
@@ -794,7 +794,6 @@ static unsigned long ldlm_pools_count(ldlm_side_t client, 
gfp_t gfp_mask)
int nr_ns;
struct ldlm_namespace *ns;
struct ldlm_namespace *ns_old = NULL; /* loop detection */
-   void *cookie;
 
if (client == LDLM_NAMESPACE_CLIENT && !(gfp_mask & __GFP_FS))
return 0;
@@ -802,8 +801,6 @@ static unsigned long ldlm_pools_count(ldlm_side_t client, 
gfp_t gfp_mask)
CDEBUG(D_DLMTRACE, "Request to count %s locks from all pools\n",
   client == LDLM_NAMESPACE_CLIENT ? "client" : "server");
 
-   cookie = cl_env_reenter();
-
/*
 * Find out how many resources we may release.
 */
@@ -812,7 +809,6 @@ static unsigned long ldlm_pools_count(ldlm_side_t client, 
gfp_t gfp_mask)
mutex_lock(ldlm_namespace_lock(client));
if (list_empty(ldlm_namespace_list(client))) {
mutex_unlock(ldlm_namespace_lock(client));
-   cl_env_reexit(cookie);
return 0;
}
ns = ldlm_namespace_first_locked(client);
@@ -838,7 +834,6 @@ static unsigned long ldlm_pools_coun

[PATCH 06/14] staging/lustre/llite: drop_caches hangs in cl_inode_fini()

2016-11-02 Thread Oleg Drokin
From: Andrew Perepechko 

This patch releases cl_pages on error in ll_write_begin()
to avoid memory and object reference leaks. Also, it
reuses per-cpu lu_env in ll_invalidatepage() in the same
way as done in ll_releasepage().

Signed-off-by: Andrew Perepechko 
Seagate-bug-id: MRP-3504
Reviewed-on: http://review.whamcloud.com/22745
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8509
Reviewed-by: Jinshan Xiong 
Reviewed-by: Bobi Jam 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/rw26.c | 36 --
 1 file changed, 19 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/rw26.c 
b/drivers/staging/lustre/lustre/llite/rw26.c
index 1a08a9d..ca45b44 100644
--- a/drivers/staging/lustre/lustre/llite/rw26.c
+++ b/drivers/staging/lustre/lustre/llite/rw26.c
@@ -71,8 +71,6 @@ static void ll_invalidatepage(struct page *vmpage, unsigned 
int offset,
struct cl_page   *page;
struct cl_object *obj;
 
-   int refcheck;
-
LASSERT(PageLocked(vmpage));
LASSERT(!PageWriteback(vmpage));
 
@@ -82,21 +80,21 @@ static void ll_invalidatepage(struct page *vmpage, unsigned 
int offset,
 * happening with locked page too
 */
if (offset == 0 && length == PAGE_SIZE) {
-   env = cl_env_get(&refcheck);
-   if (!IS_ERR(env)) {
-   inode = vmpage->mapping->host;
-   obj = ll_i2info(inode)->lli_clob;
-   if (obj) {
-   page = cl_vmpage_page(vmpage, obj);
-   if (page) {
-   cl_page_delete(env, page);
-   cl_page_put(env, page);
-   }
-   } else {
-   LASSERT(vmpage->private == 0);
+   /* See the comment in ll_releasepage() */
+   env = cl_env_percpu_get();
+   LASSERT(!IS_ERR(env));
+   inode = vmpage->mapping->host;
+   obj = ll_i2info(inode)->lli_clob;
+   if (obj) {
+   page = cl_vmpage_page(vmpage, obj);
+   if (page) {
+   cl_page_delete(env, page);
+   cl_page_put(env, page);
}
-   cl_env_put(env, &refcheck);
+   } else {
+   LASSERT(vmpage->private == 0);
}
+   cl_env_percpu_put(env);
}
 }
 
@@ -466,9 +464,9 @@ static int ll_write_begin(struct file *file, struct 
address_space *mapping,
  struct page **pagep, void **fsdata)
 {
struct ll_cl_context *lcc;
-   const struct lu_env  *env;
+   const struct lu_env *env = NULL;
struct cl_io   *io;
-   struct cl_page *page;
+   struct cl_page *page = NULL;
struct cl_object *clob = ll_i2info(mapping->host)->lli_clob;
pgoff_t index = pos >> PAGE_SHIFT;
struct page *vmpage = NULL;
@@ -556,6 +554,10 @@ static int ll_write_begin(struct file *file, struct 
address_space *mapping,
unlock_page(vmpage);
put_page(vmpage);
}
+   if (!IS_ERR_OR_NULL(page)) {
+   lu_ref_del(&page->cp_reference, "cl_io", io);
+   cl_page_put(env, page);
+   }
} else {
*pagep = vmpage;
*fsdata = lcc;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 03/14] staging/lustre: conflicting PW & PR extent locks on a client

2016-11-02 Thread Oleg Drokin
From: Andriy Skulysh 

PW lock isn't replayed once a lock is marked
LDLM_FL_CANCELING and glimpse lock doesn't wait for
conflicting locks on the client. So the server will
grant a PR lock in response to the glimpse lock request,
which conflicts with the PW lock in LDLM_FL_CANCELING
state on the client.

Lock in LDLM_FL_CANCELING state may still have pending IO,
so it should be replayed until LDLM_FL_BL_DONE is set to
avoid granted conflicting lock by a server.

Seagate-bug-id: MRP-3311
Signed-off-by: Andriy Skulysh 
Reviewed-on: http://review.whamcloud.com/20345
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8175
Reviewed-by: Jinshan Xiong 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/obd_support.h |  3 +++
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c| 20 
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c   |  4 ++--
 drivers/staging/lustre/lustre/osc/osc_request.c |  1 +
 4 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/obd_support.h 
b/drivers/staging/lustre/lustre/include/obd_support.h
index 7f3f8cd..aaedec7 100644
--- a/drivers/staging/lustre/lustre/include/obd_support.h
+++ b/drivers/staging/lustre/lustre/include/obd_support.h
@@ -321,6 +321,8 @@ extern char obd_jobid_var[];
 #define OBD_FAIL_LDLM_CP_CB_WAIT4   0x322
 #define OBD_FAIL_LDLM_CP_CB_WAIT5   0x323
 
+#define OBD_FAIL_LDLM_GRANT_CHECK0x32a
+
 /* LOCKLESS IO */
 #define OBD_FAIL_LDLM_SET_CONTENTION 0x385
 
@@ -343,6 +345,7 @@ extern char obd_jobid_var[];
 #define OBD_FAIL_OSC_CP_ENQ_RACE0x410
 #define OBD_FAIL_OSC_NO_GRANT  0x411
 #define OBD_FAIL_OSC_DELAY_SETTIME  0x412
+#define OBD_FAIL_OSC_DELAY_IO   0x414
 
 #define OBD_FAIL_PTLRPC  0x500
 #define OBD_FAIL_PTLRPC_ACK  0x501
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
index ecf472e..a7b34e4 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
@@ -193,6 +193,26 @@ void ldlm_extent_add_lock(struct ldlm_resource *res,
 * add the locks into grant list, for debug purpose, ..
 */
ldlm_resource_add_lock(res, &res->lr_granted, lock);
+
+   if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_GRANT_CHECK)) {
+   struct ldlm_lock *lck;
+
+   list_for_each_entry_reverse(lck, &res->lr_granted,
+   l_res_link) {
+   if (lck == lock)
+   continue;
+   if (lockmode_compat(lck->l_granted_mode,
+   lock->l_granted_mode))
+   continue;
+   if (ldlm_extent_overlap(&lck->l_req_extent,
+   &lock->l_req_extent)) {
+   CDEBUG(D_ERROR, "granting conflicting lock %p 
%p\n",
+  lck, lock);
+   ldlm_resource_dump(D_ERROR, res);
+   LBUG();
+   }
+   }
+   }
 }
 
 /** Remove cancelled lock from resource interval tree. */
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
index 43856ff..6e704c7 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
@@ -1846,7 +1846,7 @@ static int ldlm_chain_lock_for_replay(struct ldlm_lock 
*lock, void *closure)
 * bug 17614: locks being actively cancelled. Get a reference
 * on a lock so that it does not disappear under us (e.g. due to cancel)
 */
-   if (!(lock->l_flags & (LDLM_FL_FAILED | LDLM_FL_CANCELING))) {
+   if (!(lock->l_flags & (LDLM_FL_FAILED | LDLM_FL_BL_DONE))) {
list_add(&lock->l_pending_chain, list);
LDLM_LOCK_GET(lock);
}
@@ -1915,7 +1915,7 @@ static int replay_one_lock(struct obd_import *imp, struct 
ldlm_lock *lock)
int flags;
 
/* Bug 11974: Do not replay a lock which is actively being canceled */
-   if (ldlm_is_canceling(lock)) {
+   if (ldlm_is_bl_done(lock)) {
LDLM_DEBUG(lock, "Not replaying canceled lock:");
return 0;
}
diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c 
b/drivers/staging/lustre/lustre/osc/osc_request.c
index 091558e..8023561 100644
--- a/drivers/staging/lustre/lustre/osc/osc_request.c
+++ b/drivers/staging/lustre/lustre/osc/osc_request.c
@@ -1823,6 +1823,7 @@ int osc_build_rpc(const struct lu_env *env, struct 
client_obd *cli,
DEBUG_REQ(D_INODE, req, "%d pages, aa %p. now %ur/%dw in flight",
  page_count, aa, cli->cl_r_in_flight,
  cli->cl_w_in_flight);
+   OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY

[PATCH 02/14] staging/lustre/ldlm: fix export reference problem

2016-11-02 Thread Oleg Drokin
From: Hongchao Zhang 

1, in client_import_del_conn, the export returned from
   class_conn2export is not released after using it.

2, in ptlrpc_connect_interpret, the export is not released
   if the connect_flags isn't compatible.

Signed-off-by: Hongchao Zhang 
Reviewed-on: http://review.whamcloud.com/22031
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8500
Reviewed-by: James Simmons 
Reviewed-by: Bobi Jam 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c |  3 +++
 drivers/staging/lustre/lustre/ptlrpc/import.c | 19 ++-
 2 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c 
b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
index 4f9480e..06d3cc6 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lib.c
@@ -170,6 +170,9 @@ int client_import_del_conn(struct obd_import *imp, struct 
obd_uuid *uuid)
ptlrpc_connection_put(dlmexp->exp_connection);
dlmexp->exp_connection = NULL;
}
+
+   if (dlmexp)
+   class_export_put(dlmexp);
}
 
list_del(&imp_conn->oic_item);
diff --git a/drivers/staging/lustre/lustre/ptlrpc/import.c 
b/drivers/staging/lustre/lustre/ptlrpc/import.c
index 46ba5a4..05fd92d 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/import.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/import.c
@@ -972,6 +972,16 @@ static int ptlrpc_connect_interpret(const struct lu_env 
*env,
 
spin_unlock(&imp->imp_lock);
 
+   if (!exp) {
+   /* This could happen if export is cleaned during the
+* connect attempt
+*/
+   CERROR("%s: missing export after connect\n",
+  imp->imp_obd->obd_name);
+   rc = -ENODEV;
+   goto out;
+   }
+
/* check that server granted subset of flags we asked for. */
if ((ocd->ocd_connect_flags & imp->imp_connect_flags_orig) !=
ocd->ocd_connect_flags) {
@@ -982,15 +992,6 @@ static int ptlrpc_connect_interpret(const struct lu_env 
*env,
goto out;
}
 
-   if (!exp) {
-   /* This could happen if export is cleaned during the
-* connect attempt
-*/
-   CERROR("%s: missing export after connect\n",
-  imp->imp_obd->obd_name);
-   rc = -ENODEV;
-   goto out;
-   }
old_connect_flags = exp_connect_flags(exp);
exp->exp_connect_data = *ocd;
imp->imp_obd->obd_self_export->exp_connect_data = *ocd;
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 04/14] staging/lustre/llite: clear inode timestamps after losing UPDATE lock

2016-11-02 Thread Oleg Drokin
From: Niu Yawei 

Otherwise, those leftovers would interfere with new timestamps
especially when the timestamps are set back in time on the other
clients.

Signed-off-by: Jinshan Xiong 
Signed-off-by: Niu Yawei 
Reviewed-on: http://review.whamcloud.com/22623
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-8446
Reviewed-by: Bobi Jam 
Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/llite/namei.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/drivers/staging/lustre/lustre/llite/namei.c 
b/drivers/staging/lustre/lustre/llite/namei.c
index 74d9b73..c268f32 100644
--- a/drivers/staging/lustre/lustre/llite/namei.c
+++ b/drivers/staging/lustre/lustre/llite/namei.c
@@ -251,6 +251,16 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct 
ldlm_lock_desc *desc,
   PFID(ll_inode2fid(inode)), rc);
}
 
+   if (bits & MDS_INODELOCK_UPDATE) {
+   struct ll_inode_info *lli = ll_i2info(inode);
+
+   spin_lock(&lli->lli_lock);
+   LTIME_S(inode->i_mtime) = 0;
+   LTIME_S(inode->i_atime) = 0;
+   LTIME_S(inode->i_ctime) = 0;
+   spin_unlock(&lli->lli_lock);
+   }
+
if ((bits & MDS_INODELOCK_UPDATE) && S_ISDIR(inode->i_mode)) {
struct ll_inode_info *lli = ll_i2info(inode);
 
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 01/14] staging/lustre/ldlm: Drop unused blocking_refs flock field

2016-11-02 Thread Oleg Drokin
blocking_refs is only used on the server, so drop it on the client.

Signed-off-by: Oleg Drokin 
---
 drivers/staging/lustre/lustre/include/lustre_dlm.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h 
b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 1c6b7b8..f770b86 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -550,8 +550,6 @@ struct ldlm_flock {
__u64 owner;
__u64 blocking_owner;
struct obd_export *blocking_export;
-   /* Protected by the hash lock */
-   __u32 blocking_refs;
__u32 pid;
 };
 
-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 00/14] Lustre fixes

2016-11-02 Thread Oleg Drokin
This batch of patches represents mostly recent fixes,
also a couple of cleanups and a couple of changes that fixes depend on.

Amir Shehata (1):
  staging/lustre/ptlrpc: Correctly calculate hrp->hrp_nthrs

Andrew Perepechko (1):
  staging/lustre/llite: drop_caches hangs in cl_inode_fini()

Andriy Skulysh (1):
  staging/lustre: conflicting PW & PR extent locks on a client

Bobi Jam (2):
  staging/lustre/llite: protect from accessing NULL lli_clob
  staging/lustre/llite: update ras window correctly

Hongchao Zhang (2):
  staging/lustre/ldlm: fix export reference problem
  staging/lustre/ldlm: engage ELC for all ldlm enqueue req

Jinshan Xiong (2):
  staging/lustre: Get rid of cl_env hash table
  staging/lustre/llite: do not clear uptodate bit in page delete

Niu Yawei (1):
  staging/lustre/llite: clear inode timestamps after losing UPDATE lock

Oleg Drokin (3):
  staging/lustre/ldlm: Drop unused blocking_refs flock field
  staging/lustre/ldlm: Reinstate ldlm_enqueue_pack()
  staging/lustre: Get rid of LIBLUSTRE_CLIENT and its users

Patrick Farrell (1):
  staging/lustre/ptlrpc: Suppress error for flock requests

 drivers/staging/lustre/lustre/include/cl_object.h  |  22 --
 drivers/staging/lustre/lustre/include/lustre_dlm.h |   2 -
 drivers/staging/lustre/lustre/include/lustre_lib.h |   2 -
 .../staging/lustre/lustre/include/obd_support.h|   3 +
 drivers/staging/lustre/lustre/ldlm/ldlm_extent.c   |  20 ++
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c  |   3 +
 drivers/staging/lustre/lustre/ldlm/ldlm_pool.c |   9 -
 drivers/staging/lustre/lustre/ldlm/ldlm_request.c  |  61 ++--
 drivers/staging/lustre/lustre/llite/file.c |  26 +-
 drivers/staging/lustre/lustre/llite/lcommon_cl.c   |  11 +-
 drivers/staging/lustre/lustre/llite/lcommon_misc.c |   8 +-
 drivers/staging/lustre/lustre/llite/llite_mmap.c   |  59 ++--
 drivers/staging/lustre/lustre/llite/namei.c|  10 +
 drivers/staging/lustre/lustre/llite/rw.c   |  21 +-
 drivers/staging/lustre/lustre/llite/rw26.c |  52 +--
 drivers/staging/lustre/lustre/llite/vvp_page.c |   1 -
 drivers/staging/lustre/lustre/lov/lov_io.c |   5 -
 drivers/staging/lustre/lustre/lov/lov_object.c |   7 +-
 .../staging/lustre/lustre/obdclass/cl_internal.h   |  23 --
 drivers/staging/lustre/lustre/obdclass/cl_io.c |   1 -
 drivers/staging/lustre/lustre/obdclass/cl_object.c | 389 -
 drivers/staging/lustre/lustre/obdclass/lu_object.c |   4 -
 .../staging/lustre/lustre/obdecho/echo_client.c|  14 +-
 drivers/staging/lustre/lustre/osc/osc_cache.c  |   6 +-
 drivers/staging/lustre/lustre/osc/osc_lock.c   | 116 +++---
 drivers/staging/lustre/lustre/osc/osc_page.c   |   6 +-
 drivers/staging/lustre/lustre/osc/osc_request.c|   1 +
 drivers/staging/lustre/lustre/ptlrpc/client.c  |   4 +-
 drivers/staging/lustre/lustre/ptlrpc/import.c  |  19 +-
 drivers/staging/lustre/lustre/ptlrpc/service.c |   3 +-
 30 files changed, 298 insertions(+), 610 deletions(-)

-- 
2.7.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [lustre-devel] [PATCH 1/2] staging: lustre: replace uses of class_devno_max by MAX_OBD_DEVICES

2016-11-02 Thread Dilger, Andreas
On Oct 25, 2016, at 10:47, Aya Mahfouz  wrote:
> 
> On Mon, Oct 17, 2016 at 10:38:31PM +, Dilger, Andreas wrote:
>> On Oct 17, 2016, at 15:46, Aya Mahfouz  
>> wrote:
>>> 
>>> class_devno_max is an inline function that returns
>>> MAX_OBD_DEVICES. Replace all calls to the function
>>> by MAX_OBD_DEVICES.
>> 
>> Thanks for your patch, but unfortunately it can't be accepted.
>> 
>> This function was added in preparation of being able to tune the maximum
>> number of storage devices dynamically, rather than having to hard code it
>> to the maximum possible number of servers that a client can possibly
>> connect to.
>> 
>> While the current maximum of 8192 servers has been enough for current
>> filesystems, I'd rather move in the direction of dynamically handling this
>> limit rather than re-introducing a hard-coded constant throughout the code.
>> 
> Hello,
> 
> I would like to proceed with implementing the function if possible.
> Kindly direct me to some starting pointers.

Hi Aya,
thanks for offering to look into this.

There are several ways to approach this problem  to make the allocation
of the obd_devs[] array dynamic.  In most cases, there isn't any value
to dynamically shrink this array, since the filesystem(s) will typically
be mounted until the node is rebooted, and it is only in the tens of KB
size range, so this will not affect ongoing operations, and that simplifies
the implementation.

The easiest way would be to have a dynamically-sized obd_devs[] array that
is reallocated in class_newdev() in PAGE_SIZE chunks whenever the current
array has no more free slots and copied to the new array, using obd_dev_lock
to protect the array while it is being reallocated and copied.  In most
cases, this would save memory over the static array (not many filesystems
have so many servers), but for the few sites that have 1+ servers they
don't need to change the source to handle this.  Using libcfs_kvzalloc()
would avoid issues with allocating large chunks of memory.

There are a few places where obd_devs[] is accessed outside obd_dev_lock
that would need to be fixed now that this array may be changed at runtime.

A second approach that may scale better is to change obd_devs from an array
to a doubly linked list (using standard list_head helpers).  In many cases
the whole list is seached linearly, and most of the uses of class_num2obd()
are just used to walk that list in order, which could be replaced with
list_for_each_entry() list traversal.  The class_name2dev() function should
be changed to return the pointer to the obd_device structure, and a new
helper class_dev2num() would just return the obd_minor number from the
obd_device struct for the one use in class_resolve_dev_name().  Using a
linked list has the advantage that there is no need to search for free slots
in the array, since devices would be removed from the list when it is freed.

Cheers, Andreas

>> One comment inline below, if you still want to submit a patch.
>> 
>>> Signed-off-by: Aya Mahfouz 
>>> ---
>>> drivers/staging/lustre/lustre/obdclass/class_obd.c |  6 +++---
>>> drivers/staging/lustre/lustre/obdclass/genops.c| 22 
>>> +++---
>>> .../lustre/lustre/obdclass/linux/linux-module.c|  6 +++---
>>> 3 files changed, 17 insertions(+), 17 deletions(-)
>>> 
>>> diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c 
>>> b/drivers/staging/lustre/lustre/obdclass/class_obd.c
>>> index 2b21675..b775c74 100644
>>> --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c
>>> +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c
>>> @@ -345,7 +345,7 @@ int class_handle_ioctl(unsigned int cmd, unsigned long 
>>> arg)
>>> goto out;
>>> }
>>> obd = class_name2obd(data->ioc_inlbuf4);
>>> -   } else if (data->ioc_dev < class_devno_max()) {
>>> +   } else if (data->ioc_dev < MAX_OBD_DEVICES) {
>>> obd = class_num2obd(data->ioc_dev);
>>> } else {
>>> CERROR("OBD ioctl: No device\n");
>>> @@ -498,7 +498,7 @@ static int __init obdclass_init(void)
>>> }
>>> 
>>> /* This struct is already zeroed for us (static global) */
>>> -   for (i = 0; i < class_devno_max(); i++)
>>> +   for (i = 0; i < MAX_OBD_DEVICES; i++)
>>> obd_devs[i] = NULL;
>> 
>> This block can just be removed entirely.  It used to do something useful,
>> but through a series of changes it has become useless.
>> 
>> Cheers, Andreas
>> 
>>> /* Default the dirty page cache cap to 1/2 of system memory.
>>> @@ -548,7 +548,7 @@ static void obdclass_exit(void)
>>> lustre_unregister_fs();
>>> 
>>> misc_deregister(&obd_psdev);
>>> -   for (i = 0; i < class_devno_max(); i++) {
>>> +   for (i = 0; i < MAX_OBD_DEVICES; i++) {
>>> struct obd_device *obd = class_num2obd(i);
>>> 
>>> if (obd && obd->obd_set_up &&
>>> diff --git a/drivers/staging/lustre/lustre/obdclass/genops.c 
>>> b/drivers/staging/lustre/lustre/obdclass/genops.c
>>> index 99c2da6

[PATCH 5/5] staging: wlan-ng: remove unnecessary blank line

2016-11-02 Thread Sergio Paracuellos
Blank lines aren't necessary after an open brace '{'.
Clean them in p80211req.c source file to comply with
the standard kernel coding style.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211req.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/p80211req.c 
b/drivers/staging/wlan-ng/p80211req.c
index e9fbe18..c4d8e1b 100644
--- a/drivers/staging/wlan-ng/p80211req.c
+++ b/drivers/staging/wlan-ng/p80211req.c
@@ -171,7 +171,6 @@ static void p80211req_handlemsg(struct wlandevice *wlandev,
struct p80211msg *msg)
 {
switch (msg->msgcode) {
-
case DIDmsg_lnxreq_hostwep:{
struct p80211msg_lnxreq_hostwep *req =
(struct p80211msg_lnxreq_hostwep *)msg;
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/5] staging: wlan-ng: Fix several style issues.

2016-11-02 Thread Sergio Paracuellos
This patch series fix some style issues in several source and header files.

Sergio Paracuellos (5):
  staging: wlan-ng: add spaces around or operator :
HOSTWEP_DEFAULTKEY_MASK
  staging: wlan-ng: remove two unnecessary blank lines
  staging: wlan-ng: change comparison to NULL to preferred style.
  staging: wlan-ng: remove unnecessary parentheses
  staging: wlan-ng: remove unnecessary blank line

 drivers/staging/wlan-ng/p80211netdev.c | 2 --
 drivers/staging/wlan-ng/p80211netdev.h | 2 +-
 drivers/staging/wlan-ng/p80211req.c| 7 +++
 3 files changed, 4 insertions(+), 7 deletions(-)

-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/5] staging: wlan-ng: remove two unnecessary blank lines

2016-11-02 Thread Sergio Paracuellos
After open brace or before close brace blank lines are not really 
necessary. Remove them.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211netdev.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211netdev.c 
b/drivers/staging/wlan-ng/p80211netdev.c
index 10dacf8..ae6e635 100644
--- a/drivers/staging/wlan-ng/p80211netdev.c
+++ b/drivers/staging/wlan-ng/p80211netdev.c
@@ -277,7 +277,6 @@ static void p80211netdev_rx_bh(unsigned long arg)
/* Let's empty our our queue */
while ((skb = skb_dequeue(&wlandev->nsd_rxq))) {
if (wlandev->state == WLAN_DEVICE_OPEN) {
-
if (dev->type != ARPHRD_ETHER) {
/* RAW frame; we shouldn't convert it */
/* XXX Append the Prism Header here instead. */
@@ -461,7 +460,6 @@ static void p80211knetdev_set_multicast_list(struct 
net_device *dev)
 
if (wlandev->set_multicast_list)
wlandev->set_multicast_list(wlandev, dev);
-
 }
 
 #ifdef SIOCETHTOOL
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/5] staging: wlan-ng: remove unnecessary parentheses

2016-11-02 Thread Sergio Paracuellos
Avoid no necessary parentheses to comply with the standard kernel 
coding style.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211req.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wlan-ng/p80211req.c 
b/drivers/staging/wlan-ng/p80211req.c
index 3414fd8..e9fbe18 100644
--- a/drivers/staging/wlan-ng/p80211req.c
+++ b/drivers/staging/wlan-ng/p80211req.c
@@ -132,7 +132,7 @@ int p80211req_dorequest(struct wlandevice *wlandev, u8 
*msgbuf)
}
 
/* Check for busy status */
-   if (test_and_set_bit(1, &(wlandev->request_pending)))
+   if (test_and_set_bit(1, &wlandev->request_pending))
return -EBUSY;
 
/* Allow p80211 to look at msg and handle if desired. */
@@ -144,7 +144,7 @@ int p80211req_dorequest(struct wlandevice *wlandev, u8 
*msgbuf)
if (wlandev->mlmerequest)
wlandev->mlmerequest(wlandev, msg);
 
-   clear_bit(1, &(wlandev->request_pending));
+   clear_bit(1, &wlandev->request_pending);
return 0;   /* if result==0, msg->status still may contain an err */
 }
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/5] staging: wlan-ng: change comparison to NULL to preferred style.

2016-11-02 Thread Sergio Paracuellos
Comparison to NULL could be written in preferred form.
Change it to comply with the standard kernel coding style.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211req.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/p80211req.c 
b/drivers/staging/wlan-ng/p80211req.c
index b3b33d2e..3414fd8 100644
--- a/drivers/staging/wlan-ng/p80211req.c
+++ b/drivers/staging/wlan-ng/p80211req.c
@@ -141,7 +141,7 @@ int p80211req_dorequest(struct wlandevice *wlandev, u8 
*msgbuf)
p80211req_handlemsg(wlandev, msg);
 
/* Pass it down to wlandev via wlandev->mlmerequest */
-   if (wlandev->mlmerequest != NULL)
+   if (wlandev->mlmerequest)
wlandev->mlmerequest(wlandev, msg);
 
clear_bit(1, &(wlandev->request_pending));
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/5] staging: wlan-ng: add spaces around or operator : HOSTWEP_DEFAULTKEY_MASK

2016-11-02 Thread Sergio Paracuellos
Add spaces around or operator to comply with the standard 
kernel coding style.

Signed-off-by: Sergio Paracuellos 
---
 drivers/staging/wlan-ng/p80211netdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wlan-ng/p80211netdev.h 
b/drivers/staging/wlan-ng/p80211netdev.h
index 972e076..8066ac4 100644
--- a/drivers/staging/wlan-ng/p80211netdev.h
+++ b/drivers/staging/wlan-ng/p80211netdev.h
@@ -143,7 +143,7 @@ struct p80211_frmrx {
 #define NUM_WEPKEYS 4
 #define MAX_KEYLEN 32
 
-#define HOSTWEP_DEFAULTKEY_MASK (BIT(1)|BIT(0))
+#define HOSTWEP_DEFAULTKEY_MASK (BIT(1) | BIT(0))
 #define HOSTWEP_SHAREDKEY BIT(3)
 #define HOSTWEP_DECRYPT  BIT(4)
 #define HOSTWEP_ENCRYPT  BIT(5)
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: lustre: mdc: manage number of modify RPCs in flight

2016-11-02 Thread James Simmons
From: Gregoire Pichon 

This patch is the main client part of a new feature that supports
multiple modify metadata RPCs in parallel. Its goal is to improve
metadata operations performance of a single client, while maintening
the consistency of MDT reply reconstruction and MDT recovery
mechanisms.

It allows to manage the number of modify RPCs in flight within
the client obd structure and to assign a virtual index (the tag) to
each modify RPC to help server side cleaning of reply data.

The mdc component uses this feature to send multiple modify RPCs
in parallel.

Signed-off-by: Gregoire Pichon 
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5319
Reviewed-on: http://review.whamcloud.com/14374
Reviewed-by: Andreas Dilger 
Reviewed-by: Alex Zhuravlev 
Reviewed-by: Oleg Drokin 
Signed-off-by: James Simmons 
---
 drivers/staging/lustre/lustre/fid/fid_request.c|4 -
 drivers/staging/lustre/lustre/include/lustre_mdc.h |   24 +++
 drivers/staging/lustre/lustre/include/obd.h|7 +-
 drivers/staging/lustre/lustre/include/obd_class.h  |6 +
 drivers/staging/lustre/lustre/ldlm/ldlm_lib.c  |   37 +
 drivers/staging/lustre/lustre/mdc/lproc_mdc.c  |   23 +++
 drivers/staging/lustre/lustre/mdc/mdc_locks.c  |   13 +-
 drivers/staging/lustre/lustre/mdc/mdc_reint.c  |   23 +--
 drivers/staging/lustre/lustre/mdc/mdc_request.c|   50 ++-
 drivers/staging/lustre/lustre/obdclass/genops.c|  171 +++-
 10 files changed, 293 insertions(+), 65 deletions(-)

diff --git a/drivers/staging/lustre/lustre/fid/fid_request.c 
b/drivers/staging/lustre/lustre/fid/fid_request.c
index 1148b9a..999f250 100644
--- a/drivers/staging/lustre/lustre/fid/fid_request.c
+++ b/drivers/staging/lustre/lustre/fid/fid_request.c
@@ -112,11 +112,7 @@ static int seq_client_rpc(struct lu_client_seq *seq,
 
ptlrpc_at_set_req_timeout(req);
 
-   if (opc != SEQ_ALLOC_SUPER && seq->lcs_type == LUSTRE_SEQ_METADATA)
-   mdc_get_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL);
rc = ptlrpc_queue_wait(req);
-   if (opc != SEQ_ALLOC_SUPER && seq->lcs_type == LUSTRE_SEQ_METADATA)
-   mdc_put_rpc_lock(exp->exp_obd->u.cli.cl_rpc_lock, NULL);
if (rc)
goto out_req;
 
diff --git a/drivers/staging/lustre/lustre/include/lustre_mdc.h 
b/drivers/staging/lustre/lustre/include/lustre_mdc.h
index 92a5c0f..198ceb0 100644
--- a/drivers/staging/lustre/lustre/include/lustre_mdc.h
+++ b/drivers/staging/lustre/lustre/include/lustre_mdc.h
@@ -156,6 +156,30 @@ static inline void mdc_put_rpc_lock(struct mdc_rpc_lock 
*lck,
mutex_unlock(&lck->rpcl_mutex);
 }
 
+static inline void mdc_get_mod_rpc_slot(struct ptlrpc_request *req,
+   struct lookup_intent *it)
+{
+   struct client_obd *cli = &req->rq_import->imp_obd->u.cli;
+   u32 opc;
+   u16 tag;
+
+   opc = lustre_msg_get_opc(req->rq_reqmsg);
+   tag = obd_get_mod_rpc_slot(cli, opc, it);
+   lustre_msg_set_tag(req->rq_reqmsg, tag);
+}
+
+static inline void mdc_put_mod_rpc_slot(struct ptlrpc_request *req,
+   struct lookup_intent *it)
+{
+   struct client_obd *cli = &req->rq_import->imp_obd->u.cli;
+   u32 opc;
+   u16 tag;
+
+   opc = lustre_msg_get_opc(req->rq_reqmsg);
+   tag = lustre_msg_get_tag(req->rq_reqmsg);
+   obd_put_mod_rpc_slot(cli, opc, it, tag);
+}
+
 /**
  * Update the maximum possible easize.
  *
diff --git a/drivers/staging/lustre/lustre/include/obd.h 
b/drivers/staging/lustre/lustre/include/obd.h
index c8a6e23..09e3e71 100644
--- a/drivers/staging/lustre/lustre/include/obd.h
+++ b/drivers/staging/lustre/lustre/include/obd.h
@@ -263,14 +263,17 @@ struct client_obd {
wait_queue_head_t cl_destroy_waitq;
 
struct mdc_rpc_lock *cl_rpc_lock;
-   struct mdc_rpc_lock *cl_close_lock;
 
/* modify rpcs in flight
 * currently used for metadata only
 */
spinlock_t   cl_mod_rpcs_lock;
u16  cl_max_mod_rpcs_in_flight;
-
+   u16  cl_mod_rpcs_in_flight;
+   u16  cl_close_rpcs_in_flight;
+   wait_queue_head_tcl_mod_rpcs_waitq;
+   unsigned long   *cl_mod_tag_bitmap;
+   struct obd_histogram cl_mod_rpcs_hist;
 
/* mgc datastruct */
atomic_t cl_mgc_refcount;
diff --git a/drivers/staging/lustre/lustre/include/obd_class.h 
b/drivers/staging/lustre/lustre/include/obd_class.h
index 70b355e..f79133c 100644
--- a/drivers/staging/lustre/lustre/include/obd_class.h
+++ b/drivers/staging/lustre/lustre/include/obd_class.h
@@ -101,6 +101,12 @@ struct obd_device *class_devices_in_group(struct obd_uuid 
*grp_uuid,
 __u32 obd_get_max_rpcs_in_flight(struct client_obd *cli);
 int obd_set_max_rpcs_in_flight(struct client_obd *cli, __u32 max);
 int obd_set_max_mod_rpcs_in_flight(stru

Re: Greybus Future

2016-11-02 Thread Karim Yaghmour


On 11/02/2016 11:24 AM, Alex Elder wrote:

Yes.  I just created a test repository there.  If you find
you have trouble let me know and I'll create one for you.


Do we actually want do that though? I mean, who owns that?

This returns 404:
https://github.com/greybus

Do you want to grab that?

--
Karim Yaghmour
CEO - Opersys inc. / www.opersys.com
http://twitter.com/karimyaghmour

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: Greybus Future

2016-11-02 Thread Alex Elder
On 11/02/2016 11:29 AM, Alexandre Bailon wrote:
> On 10/31/2016 02:50 PM, Alex Elder wrote:
>> Git repositories.  Public git repositories related to Project Ara
>> are all hosted here:
>> https://github.com/projectara
>> At this time I see no reason to move away from this, but it would
>> not surprise me if we decided to host the code and documentation
>> somewhere else at some future date.
> Do we have the rights to add new repos to https://github.com/projectara?

Yes.  I just created a test repository there.  If you find
you have trouble let me know and I'll create one for you.

-Alex

> 
> Thanks,
> Alexandre
> 

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: Greybus Future

2016-11-02 Thread Alexandre Bailon
On 10/31/2016 02:50 PM, Alex Elder wrote:
> Git repositories.  Public git repositories related to Project Ara
> are all hosted here:
> https://github.com/projectara
> At this time I see no reason to move away from this, but it would
> not surprise me if we decided to host the code and documentation
> somewhere else at some future date.
Do we have the rights to add new repos to https://github.com/projectara?

Thanks,
Alexandre
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH 3/9] bus: fsl-mc: dpio: add APIs for DPIO objects

2016-11-02 Thread Ruxandra Ioana Radulescu
> -Original Message-
> From: Stuart Yoder [mailto:stuart.yo...@nxp.com]
> Sent: Friday, October 21, 2016 5:02 PM
> To: gre...@linuxfoundation.org
> Cc: German Rivera ; de...@driverdev.osuosl.org;
> linux-ker...@vger.kernel.org; ag...@suse.de; a...@arndb.de; Leo Li
> ; Ruxandra Ioana Radulescu
> ; Roy Pledge ; Stuart
> Yoder 
> Subject: [PATCH 3/9] bus: fsl-mc: dpio: add APIs for DPIO objects
> 
> From: Ioana Radulescu 
> 
> Add the command build/parse APIs for operating on DPIO objects through
> the DPAA2 Management Complex.
> 
> Signed-off-by: Ioana Radulescu 
> Signed-off-by: Roy Pledge 
> Signed-off-by: Stuart Yoder 
> ---
>  drivers/bus/fsl-mc/Kconfig |  10 ++
>  drivers/bus/fsl-mc/Makefile|   3 +
>  drivers/bus/fsl-mc/dpio/Makefile   |   9 ++
>  drivers/bus/fsl-mc/dpio/dpio-cmd.h | 198
> 
>  drivers/bus/fsl-mc/dpio/dpio.c | 229
> +
>  drivers/bus/fsl-mc/dpio/dpio.h | 108 +
>  6 files changed, 557 insertions(+)
>  create mode 100644 drivers/bus/fsl-mc/dpio/Makefile
>  create mode 100644 drivers/bus/fsl-mc/dpio/dpio-cmd.h
>  create mode 100644 drivers/bus/fsl-mc/dpio/dpio.c
>  create mode 100644 drivers/bus/fsl-mc/dpio/dpio.h
> 
> diff --git a/drivers/bus/fsl-mc/Kconfig b/drivers/bus/fsl-mc/Kconfig
> index 5c009ab..a10aaf0 100644
> --- a/drivers/bus/fsl-mc/Kconfig
> +++ b/drivers/bus/fsl-mc/Kconfig
> @@ -15,3 +15,13 @@ config FSL_MC_BUS
> architecture.  The fsl-mc bus driver handles discovery of
> DPAA2 objects (which are represented as Linux devices) and
> binding objects to drivers.
> +
> +config FSL_MC_DPIO
> +tristate "QorIQ DPAA2 DPIO driver"
> +depends on FSL_MC_BUS
> +help
> +   Driver for the DPAA2 DPIO object.  A DPIO provides queue and
> +   buffer management facilities for software to interact with
> +   other DPAA2 objects. This driver does not expose the DPIO
> +   objects individually, but groups them under a service layer
> +   API.
> diff --git a/drivers/bus/fsl-mc/Makefile b/drivers/bus/fsl-mc/Makefile
> index d56afee..d18df72 100644
> --- a/drivers/bus/fsl-mc/Makefile
> +++ b/drivers/bus/fsl-mc/Makefile
> @@ -17,3 +17,6 @@ mc-bus-driver-objs := fsl-mc-bus.o \
> fsl-mc-msi.o \
> dpmcp.o \
> dpbp.o
> +
> +# MC DPIO driver
> +obj-$(CONFIG_FSL_MC_DPIO) += dpio/
> diff --git a/drivers/bus/fsl-mc/dpio/Makefile b/drivers/bus/fsl-
> mc/dpio/Makefile
> new file mode 100644
> index 000..128befc
> --- /dev/null
> +++ b/drivers/bus/fsl-mc/dpio/Makefile
> @@ -0,0 +1,9 @@
> +#
> +# QorIQ DPAA2 DPIO driver
> +#
> +
> +subdir-ccflags-y := -Werror
> +
> +obj-$(CONFIG_FSL_MC_DPIO) += fsl-mc-dpio.o
> +
> +fsl-mc-dpio-objs := dpio.o
> diff --git a/drivers/bus/fsl-mc/dpio/dpio-cmd.h b/drivers/bus/fsl-
> mc/dpio/dpio-cmd.h
> new file mode 100644
> index 000..b25a4cc
> --- /dev/null
> +++ b/drivers/bus/fsl-mc/dpio/dpio-cmd.h
> @@ -0,0 +1,198 @@
> +/*
> + * Copyright 2013-2016 Freescale Semiconductor Inc.
> + *
> + * Redistribution and use in source and binary forms, with or without
> + * modification, are permitted provided that the following conditions are
> met:
> + * * Redistributions of source code must retain the above copyright
> + * notice, this list of conditions and the following disclaimer.
> + * * Redistributions in binary form must reproduce the above copyright
> + * notice, this list of conditions and the following disclaimer in the
> + * documentation and/or other materials provided with the distribution.
> + * * Neither the name of the above-listed copyright holders nor the
> + * names of any contributors may be used to endorse or promote products
> + * derived from this software without specific prior written permission.
> + *
> + * ALTERNATIVELY, this software may be distributed under the terms of the
> + * GNU General Public License ("GPL") as published by the Free Software
> + * Foundation, either version 2 of that License or (at your option) any
> + * later version.
> + *
> + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
> CONTRIBUTORS "AS IS"
> + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
> LIMITED TO, THE
> + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
> PARTICULAR PURPOSE
> + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
> CONTRIBUTORS BE
> + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
> OR
> + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
> PROCUREMENT OF
> + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
> BUSINESS
> + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
> WHETHER IN
> + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
> OTHERWISE)
> + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
> ADVISED OF THE
> + * POSSIBILITY OF SUCH DAMAGE.
> + */
> +#ifndef _FSL_DPIO_CMD_H
> +#defin