All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Two lustre bug fixes
@ 2018-02-12 21:09 ` NeilBrown
  0 siblings, 0 replies; 6+ messages in thread
From: NeilBrown @ 2018-02-12 21:09 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: lkml, lustre

These patches fix 2 issues I found during testing.
Together they cause lots of path-name-lookup syscalls
to return -ENOMEM.
The first bug fixes triggers and error
The second bug fixes causes that error to be reported as -ENOMEM.

Thanks,
NeilBrown


---

NeilBrown (2):
      staging: lustre: fix inverted test on strcmp
      staging: lustre: honor error code from ll_iget().


 drivers/staging/lustre/lustre/include/lustre_lmv.h |    2 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--
Signature

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/2] staging: lustre: honor error code from ll_iget().
  2018-02-12 21:09 ` [lustre-devel] " NeilBrown
@ 2018-02-12 21:09   ` NeilBrown
  -1 siblings, 0 replies; 6+ messages in thread
From: NeilBrown @ 2018-02-12 21:09 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: lkml, lustre

Commit 020ecc6f3229 ("staging: lustre: llite: Remove IS_ERR tests")
changed ll_prep_inode to assume any error from ll_iget() meant
-ENOMEM because at that time it only returned NULL for errors.
Commit c3397e7e677b ("staging: lustre: llite: add error handler in
inode prepare phase") changed ll_iget() to once again return
meaningful codes, but nobody told ll_prep_inode().

So change ll_prep_inode() back to using PTR_ERR(*inode).

Signed-off-by: NeilBrown <neilb@suse.com>
---
 drivers/staging/lustre/lustre/llite/llite_lib.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 6735a6f006d2..020f0faeb750 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -2143,7 +2143,7 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
 				md.posix_acl = NULL;
 			}
 #endif
-			rc = -ENOMEM;
+			rc = PTR_ERR(*inode);
 			CERROR("new_inode -fatal: rc %d\n", rc);
 			goto out;
 		}

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 1/2] staging: lustre: fix inverted test on strcmp
  2018-02-12 21:09 ` [lustre-devel] " NeilBrown
@ 2018-02-12 21:09   ` NeilBrown
  -1 siblings, 0 replies; 6+ messages in thread
From: NeilBrown @ 2018-02-12 21:09 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: lkml, lustre

This code tests various fields to see if they are different, except
for one where there test is if they are the same.
This is clearly wrong for a function that is tesding for equality.

So change "!strcmp()" which I always find hard to read, to
"strcmp() != 0" which obviously means that the strings are not equal.

Signed-off-by: NeilBrown <neilb@suse.com>
---
 drivers/staging/lustre/lustre/include/lustre_lmv.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_lmv.h b/drivers/staging/lustre/lustre/include/lustre_lmv.h
index f4298e5f7543..080ec1f8e19f 100644
--- a/drivers/staging/lustre/lustre/include/lustre_lmv.h
+++ b/drivers/staging/lustre/lustre/include/lustre_lmv.h
@@ -63,7 +63,7 @@ lsm_md_eq(const struct lmv_stripe_md *lsm1, const struct lmv_stripe_md *lsm2)
 	    lsm1->lsm_md_master_mdt_index != lsm2->lsm_md_master_mdt_index ||
 	    lsm1->lsm_md_hash_type != lsm2->lsm_md_hash_type ||
 	    lsm1->lsm_md_layout_version != lsm2->lsm_md_layout_version ||
-	    !strcmp(lsm1->lsm_md_pool_name, lsm2->lsm_md_pool_name))
+	    strcmp(lsm1->lsm_md_pool_name, lsm2->lsm_md_pool_name) != 0)
 		return false;
 
 	for (idx = 0; idx < lsm1->lsm_md_stripe_count; idx++) {

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [lustre-devel] [PATCH 0/2] Two lustre bug fixes
@ 2018-02-12 21:09 ` NeilBrown
  0 siblings, 0 replies; 6+ messages in thread
From: NeilBrown @ 2018-02-12 21:09 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: lkml, lustre

These patches fix 2 issues I found during testing.
Together they cause lots of path-name-lookup syscalls
to return -ENOMEM.
The first bug fixes triggers and error
The second bug fixes causes that error to be reported as -ENOMEM.

Thanks,
NeilBrown


---

NeilBrown (2):
      staging: lustre: fix inverted test on strcmp
      staging: lustre: honor error code from ll_iget().


 drivers/staging/lustre/lustre/include/lustre_lmv.h |    2 +-
 drivers/staging/lustre/lustre/llite/llite_lib.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--
Signature

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [lustre-devel] [PATCH 1/2] staging: lustre: fix inverted test on strcmp
@ 2018-02-12 21:09   ` NeilBrown
  0 siblings, 0 replies; 6+ messages in thread
From: NeilBrown @ 2018-02-12 21:09 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: lkml, lustre

This code tests various fields to see if they are different, except
for one where there test is if they are the same.
This is clearly wrong for a function that is tesding for equality.

So change "!strcmp()" which I always find hard to read, to
"strcmp() != 0" which obviously means that the strings are not equal.

Signed-off-by: NeilBrown <neilb@suse.com>
---
 drivers/staging/lustre/lustre/include/lustre_lmv.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_lmv.h b/drivers/staging/lustre/lustre/include/lustre_lmv.h
index f4298e5f7543..080ec1f8e19f 100644
--- a/drivers/staging/lustre/lustre/include/lustre_lmv.h
+++ b/drivers/staging/lustre/lustre/include/lustre_lmv.h
@@ -63,7 +63,7 @@ lsm_md_eq(const struct lmv_stripe_md *lsm1, const struct lmv_stripe_md *lsm2)
 	    lsm1->lsm_md_master_mdt_index != lsm2->lsm_md_master_mdt_index ||
 	    lsm1->lsm_md_hash_type != lsm2->lsm_md_hash_type ||
 	    lsm1->lsm_md_layout_version != lsm2->lsm_md_layout_version ||
-	    !strcmp(lsm1->lsm_md_pool_name, lsm2->lsm_md_pool_name))
+	    strcmp(lsm1->lsm_md_pool_name, lsm2->lsm_md_pool_name) != 0)
 		return false;
 
 	for (idx = 0; idx < lsm1->lsm_md_stripe_count; idx++) {

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [lustre-devel] [PATCH 2/2] staging: lustre: honor error code from ll_iget().
@ 2018-02-12 21:09   ` NeilBrown
  0 siblings, 0 replies; 6+ messages in thread
From: NeilBrown @ 2018-02-12 21:09 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, James Simmons, Greg Kroah-Hartman
  Cc: lkml, lustre

Commit 020ecc6f3229 ("staging: lustre: llite: Remove IS_ERR tests")
changed ll_prep_inode to assume any error from ll_iget() meant
-ENOMEM because at that time it only returned NULL for errors.
Commit c3397e7e677b ("staging: lustre: llite: add error handler in
inode prepare phase") changed ll_iget() to once again return
meaningful codes, but nobody told ll_prep_inode().

So change ll_prep_inode() back to using PTR_ERR(*inode).

Signed-off-by: NeilBrown <neilb@suse.com>
---
 drivers/staging/lustre/lustre/llite/llite_lib.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 6735a6f006d2..020f0faeb750 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -2143,7 +2143,7 @@ int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
 				md.posix_acl = NULL;
 			}
 #endif
-			rc = -ENOMEM;
+			rc = PTR_ERR(*inode);
 			CERROR("new_inode -fatal: rc %d\n", rc);
 			goto out;
 		}

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-02-12 21:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-12 21:09 [PATCH 0/2] Two lustre bug fixes NeilBrown
2018-02-12 21:09 ` [lustre-devel] " NeilBrown
2018-02-12 21:09 ` [PATCH 2/2] staging: lustre: honor error code from ll_iget() NeilBrown
2018-02-12 21:09   ` [lustre-devel] " NeilBrown
2018-02-12 21:09 ` [PATCH 1/2] staging: lustre: fix inverted test on strcmp NeilBrown
2018-02-12 21:09   ` [lustre-devel] " NeilBrown

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.