linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Three lustre bugfixes
@ 2018-02-22 22:09 NeilBrown
  2018-02-22 22:09 ` [PATCH 3/3] staging: lustre: lnet/selftest: don't ignore status from lstcon_test_add NeilBrown
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: NeilBrown @ 2018-02-22 22:09 UTC (permalink / raw)
  To: devel, Greg Kroah-Hartman, Oleg Drokin, James Simmons, Andreas Dilger
  Cc: Linux Kernel Mailing List, Lustre Development List

First two patches fix bugs that have been prevented the test suite
from finished for me - now it completes with about 10% of tests
failing.

Third patch fixes a tiny bug I noticed while reviewing another recent
patch to the same file.

Thanks,
NeilBrown

---

NeilBrown (3):
      staging: lustre: lov: use correct env in lov_io_data_version_end()
      staging: lustre: lmv: correctly iput lmo_root
      staging: lustre: lnet/selftest: don't ignore status from lstcon_test_add


 drivers/staging/lustre/lnet/selftest/conctl.c |    2 +-
 drivers/staging/lustre/lustre/lmv/lmv_obd.c   |    2 +-
 drivers/staging/lustre/lustre/lov/lov_io.c    |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

--
Signature

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

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

* [PATCH 3/3] staging: lustre: lnet/selftest: don't ignore status from lstcon_test_add
  2018-02-22 22:09 [PATCH 0/3] Three lustre bugfixes NeilBrown
@ 2018-02-22 22:09 ` NeilBrown
  2018-02-26 14:48   ` James Simmons
  2018-02-22 22:09 ` [PATCH 1/3] staging: lustre: lov: use correct env in lov_io_data_version_end() NeilBrown
  2018-02-22 22:09 ` [PATCH 2/3] staging: lustre: lmv: correctly iput lmo_root NeilBrown
  2 siblings, 1 reply; 7+ messages in thread
From: NeilBrown @ 2018-02-22 22:09 UTC (permalink / raw)
  To: devel, Greg Kroah-Hartman, Oleg Drokin, James Simmons, Andreas Dilger
  Cc: Linux Kernel Mailing List, Lustre Development List

If lstcon_test_add sets 'ret' (passed by reference) to 1,
then lst_test_add_ioctl() ignores the return value.
This isn't justified - the return value must be zero for 'ret'
to be meaningful.

Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lnet/selftest/conctl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c
index 51497cf9a832..a2d8092bdeb7 100644
--- a/drivers/staging/lustre/lnet/selftest/conctl.c
+++ b/drivers/staging/lustre/lnet/selftest/conctl.c
@@ -670,7 +670,7 @@ static int lst_test_add_ioctl(struct lstio_test_args *args)
 			     args->lstio_tes_param_len,
 			     &ret, args->lstio_tes_resultp);
 
-	if (ret)
+	if (!rc && ret)
 		rc = (copy_to_user(args->lstio_tes_retp, &ret,
 				   sizeof(ret))) ? -EFAULT : 0;
 out:


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

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

* [PATCH 2/3] staging: lustre: lmv: correctly iput lmo_root
  2018-02-22 22:09 [PATCH 0/3] Three lustre bugfixes NeilBrown
  2018-02-22 22:09 ` [PATCH 3/3] staging: lustre: lnet/selftest: don't ignore status from lstcon_test_add NeilBrown
  2018-02-22 22:09 ` [PATCH 1/3] staging: lustre: lov: use correct env in lov_io_data_version_end() NeilBrown
@ 2018-02-22 22:09 ` NeilBrown
  2018-02-26 14:48   ` James Simmons
  2 siblings, 1 reply; 7+ messages in thread
From: NeilBrown @ 2018-02-22 22:09 UTC (permalink / raw)
  To: devel, Greg Kroah-Hartman, Oleg Drokin, James Simmons, Andreas Dilger
  Cc: Linux Kernel Mailing List, Lustre Development List

Commit 8f18c8a48b73 ("staging: lustre: lmv: separate master object
with master stripe") changed how lmo_root inodes were managed,
particularly when LMV_HASH_FLAG_MIGRATION is not set.
Previously lsm_md_oinfo[0].lmo_root was always a borrowed
inode reference and didn't need to by iput().
Since the change, that special case only applies when
LMV_HASH_FLAG_MIGRATION is set

In the upstream (lustre-release) version of this patch [Commit
60e07b972114 ("LU-4690 lod: separate master object with master
stripe")] the for loop in the lmv_unpack_md() was changed to count
from 0 and to ignore entry 0 if LMV_HASH_FLAG_MIGRATION is set.
In the patch that got applied to Linux, that change was missing,
so lsm_md_oinfo[0].lmo_root is never iput().
This results in a "VFS: Busy inodes" warning at unmount.

Fixes: 8f18c8a48b73 ("staging: lustre: lmv: separate master object with master stripe")
Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/lmv/lmv_obd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
index 179651531862..e8a9b9902c37 100644
--- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
+++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
@@ -2695,7 +2695,7 @@ static int lmv_unpackmd(struct obd_export *exp, struct lmv_stripe_md **lsmp,
 	if (lsm && !lmm) {
 		int i;
 
-		for (i = 1; i < lsm->lsm_md_stripe_count; i++) {
+		for (i = 0; i < lsm->lsm_md_stripe_count; i++) {
 			/*
 			 * For migrating inode, the master stripe and master
 			 * object will be the same, so do not need iput, see


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

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

* [PATCH 1/3] staging: lustre: lov: use correct env in lov_io_data_version_end()
  2018-02-22 22:09 [PATCH 0/3] Three lustre bugfixes NeilBrown
  2018-02-22 22:09 ` [PATCH 3/3] staging: lustre: lnet/selftest: don't ignore status from lstcon_test_add NeilBrown
@ 2018-02-22 22:09 ` NeilBrown
  2018-02-26 14:47   ` James Simmons
  2018-02-22 22:09 ` [PATCH 2/3] staging: lustre: lmv: correctly iput lmo_root NeilBrown
  2 siblings, 1 reply; 7+ messages in thread
From: NeilBrown @ 2018-02-22 22:09 UTC (permalink / raw)
  To: devel, Greg Kroah-Hartman, Oleg Drokin, James Simmons, Andreas Dilger
  Cc: Linux Kernel Mailing List, Lustre Development List

lov - the logical object volume manager - is responsible for
striping data across multiple volumes.

So when it is given a request, it creates one or more
sub-requests, one for each target volume.  Each sub_io
request has a sub_env environment which it operates in.

When lov_io_data_version_end() calls lov_io_end_wrapper() to
wait for and close off a sub_io, it passes the wrong
environment.

This causes an LINVRNT() to fail in cl2osc_io(), and may
cause other problems.

This patch changes the call to use ->sub_env, much like
other code in the same file.

Fixes: f0cf21abcccc ("staging: lustre: clio: add CIT_DATA_VERSION and remove IOC_LOV_GETINFO")
Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/lov/lov_io.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_io.c b/drivers/staging/lustre/lustre/lov/lov_io.c
index c0dbf6cd53b4..b823f8a21856 100644
--- a/drivers/staging/lustre/lustre/lov/lov_io.c
+++ b/drivers/staging/lustre/lustre/lov/lov_io.c
@@ -483,7 +483,7 @@ lov_io_data_version_end(const struct lu_env *env, const struct cl_io_slice *ios)
 	struct lov_io_sub *sub;
 
 	list_for_each_entry(sub, &lio->lis_active, sub_linkage) {
-		lov_io_end_wrapper(env, sub->sub_io);
+		lov_io_end_wrapper(sub->sub_env, sub->sub_io);
 
 		parent->u.ci_data_version.dv_data_version +=
 			sub->sub_io->u.ci_data_version.dv_data_version;


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

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

* Re: [PATCH 1/3] staging: lustre: lov: use correct env in lov_io_data_version_end()
  2018-02-22 22:09 ` [PATCH 1/3] staging: lustre: lov: use correct env in lov_io_data_version_end() NeilBrown
@ 2018-02-26 14:47   ` James Simmons
  0 siblings, 0 replies; 7+ messages in thread
From: James Simmons @ 2018-02-26 14:47 UTC (permalink / raw)
  To: NeilBrown
  Cc: devel, Andreas Dilger, Greg Kroah-Hartman,
	Linux Kernel Mailing List, Oleg Drokin, Lustre Development List


> lov - the logical object volume manager - is responsible for
> striping data across multiple volumes.
> 
> So when it is given a request, it creates one or more
> sub-requests, one for each target volume.  Each sub_io
> request has a sub_env environment which it operates in.
> 
> When lov_io_data_version_end() calls lov_io_end_wrapper() to
> wait for and close off a sub_io, it passes the wrong
> environment.
> 
> This causes an LINVRNT() to fail in cl2osc_io(), and may
> cause other problems.
> 
> This patch changes the call to use ->sub_env, much like
> other code in the same file.
> 
> Fixes: f0cf21abcccc ("staging: lustre: clio: add CIT_DATA_VERSION and remove IOC_LOV_GETINFO")
> Signed-off-by: NeilBrown <neilb@suse.com>

Reviewed-by: James Simmons <jsimmons@infradead.org>

> ---
>  drivers/staging/lustre/lustre/lov/lov_io.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lustre/lov/lov_io.c b/drivers/staging/lustre/lustre/lov/lov_io.c
> index c0dbf6cd53b4..b823f8a21856 100644
> --- a/drivers/staging/lustre/lustre/lov/lov_io.c
> +++ b/drivers/staging/lustre/lustre/lov/lov_io.c
> @@ -483,7 +483,7 @@ lov_io_data_version_end(const struct lu_env *env, const struct cl_io_slice *ios)
>  	struct lov_io_sub *sub;
>  
>  	list_for_each_entry(sub, &lio->lis_active, sub_linkage) {
> -		lov_io_end_wrapper(env, sub->sub_io);
> +		lov_io_end_wrapper(sub->sub_env, sub->sub_io);
>  
>  		parent->u.ci_data_version.dv_data_version +=
>  			sub->sub_io->u.ci_data_version.dv_data_version;
> 
> 
> 
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 2/3] staging: lustre: lmv: correctly iput lmo_root
  2018-02-22 22:09 ` [PATCH 2/3] staging: lustre: lmv: correctly iput lmo_root NeilBrown
@ 2018-02-26 14:48   ` James Simmons
  0 siblings, 0 replies; 7+ messages in thread
From: James Simmons @ 2018-02-26 14:48 UTC (permalink / raw)
  To: NeilBrown
  Cc: devel, Andreas Dilger, Greg Kroah-Hartman,
	Linux Kernel Mailing List, Oleg Drokin, Lustre Development List


> Commit 8f18c8a48b73 ("staging: lustre: lmv: separate master object
> with master stripe") changed how lmo_root inodes were managed,
> particularly when LMV_HASH_FLAG_MIGRATION is not set.
> Previously lsm_md_oinfo[0].lmo_root was always a borrowed
> inode reference and didn't need to by iput().
> Since the change, that special case only applies when
> LMV_HASH_FLAG_MIGRATION is set
> 
> In the upstream (lustre-release) version of this patch [Commit
> 60e07b972114 ("LU-4690 lod: separate master object with master
> stripe")] the for loop in the lmv_unpack_md() was changed to count
> from 0 and to ignore entry 0 if LMV_HASH_FLAG_MIGRATION is set.
> In the patch that got applied to Linux, that change was missing,
> so lsm_md_oinfo[0].lmo_root is never iput().
> This results in a "VFS: Busy inodes" warning at unmount.
> 
> Fixes: 8f18c8a48b73 ("staging: lustre: lmv: separate master object with master stripe")
> Signed-off-by: NeilBrown <neilb@suse.com>

Reviewed-by: James Simmons <jsimmons@infradead.org>


> ---
>  drivers/staging/lustre/lustre/lmv/lmv_obd.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lustre/lmv/lmv_obd.c b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
> index 179651531862..e8a9b9902c37 100644
> --- a/drivers/staging/lustre/lustre/lmv/lmv_obd.c
> +++ b/drivers/staging/lustre/lustre/lmv/lmv_obd.c
> @@ -2695,7 +2695,7 @@ static int lmv_unpackmd(struct obd_export *exp, struct lmv_stripe_md **lsmp,
>  	if (lsm && !lmm) {
>  		int i;
>  
> -		for (i = 1; i < lsm->lsm_md_stripe_count; i++) {
> +		for (i = 0; i < lsm->lsm_md_stripe_count; i++) {
>  			/*
>  			 * For migrating inode, the master stripe and master
>  			 * object will be the same, so do not need iput, see
> 
> 
> 
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [PATCH 3/3] staging: lustre: lnet/selftest: don't ignore status from lstcon_test_add
  2018-02-22 22:09 ` [PATCH 3/3] staging: lustre: lnet/selftest: don't ignore status from lstcon_test_add NeilBrown
@ 2018-02-26 14:48   ` James Simmons
  0 siblings, 0 replies; 7+ messages in thread
From: James Simmons @ 2018-02-26 14:48 UTC (permalink / raw)
  To: NeilBrown
  Cc: devel, Andreas Dilger, Greg Kroah-Hartman,
	Linux Kernel Mailing List, Oleg Drokin, Lustre Development List


> If lstcon_test_add sets 'ret' (passed by reference) to 1,
> then lst_test_add_ioctl() ignores the return value.
> This isn't justified - the return value must be zero for 'ret'
> to be meaningful.
> 
> Signed-off-by: NeilBrown <neilb@suse.com>

Reviewed-by: James Simmons <jsimmons@infradead.org>

> ---
>  drivers/staging/lustre/lnet/selftest/conctl.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/lustre/lnet/selftest/conctl.c b/drivers/staging/lustre/lnet/selftest/conctl.c
> index 51497cf9a832..a2d8092bdeb7 100644
> --- a/drivers/staging/lustre/lnet/selftest/conctl.c
> +++ b/drivers/staging/lustre/lnet/selftest/conctl.c
> @@ -670,7 +670,7 @@ static int lst_test_add_ioctl(struct lstio_test_args *args)
>  			     args->lstio_tes_param_len,
>  			     &ret, args->lstio_tes_resultp);
>  
> -	if (ret)
> +	if (!rc && ret)
>  		rc = (copy_to_user(args->lstio_tes_retp, &ret,
>  				   sizeof(ret))) ? -EFAULT : 0;
>  out:
> 
> 
> 
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

end of thread, other threads:[~2018-02-26 14:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-22 22:09 [PATCH 0/3] Three lustre bugfixes NeilBrown
2018-02-22 22:09 ` [PATCH 3/3] staging: lustre: lnet/selftest: don't ignore status from lstcon_test_add NeilBrown
2018-02-26 14:48   ` James Simmons
2018-02-22 22:09 ` [PATCH 1/3] staging: lustre: lov: use correct env in lov_io_data_version_end() NeilBrown
2018-02-26 14:47   ` James Simmons
2018-02-22 22:09 ` [PATCH 2/3] staging: lustre: lmv: correctly iput lmo_root NeilBrown
2018-02-26 14:48   ` James Simmons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).