2018-02-22 22:11:51

by NeilBrown

[permalink] [raw]
Subject: [PATCH 0/3] Three lustre bugfixes

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



2018-02-22 22:11:40

by NeilBrown

[permalink] [raw]
Subject: [PATCH 1/3] staging: lustre: lov: use correct env in lov_io_data_version_end()

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 <[email protected]>
---
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;



2018-02-22 22:12:04

by NeilBrown

[permalink] [raw]
Subject: [PATCH 3/3] staging: lustre: lnet/selftest: don't ignore status from lstcon_test_add

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 <[email protected]>
---
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:



2018-02-22 22:12:07

by NeilBrown

[permalink] [raw]
Subject: [PATCH 2/3] staging: lustre: lmv: correctly iput lmo_root

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 <[email protected]>
---
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



2018-02-26 14:49:48

by James Simmons

[permalink] [raw]
Subject: Re: [PATCH 2/3] staging: lustre: lmv: correctly iput lmo_root


> 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 <[email protected]>

Reviewed-by: James Simmons <[email protected]>


> ---
> 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
>
>
>

2018-02-26 15:29:07

by James Simmons

[permalink] [raw]
Subject: Re: [PATCH 1/3] staging: lustre: lov: use correct env in lov_io_data_version_end()


> 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 <[email protected]>

Reviewed-by: James Simmons <[email protected]>

> ---
> 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;
>
>
>

2018-02-26 15:29:26

by James Simmons

[permalink] [raw]
Subject: Re: [PATCH 3/3] staging: lustre: lnet/selftest: don't ignore status from lstcon_test_add


> 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 <[email protected]>

Reviewed-by: James Simmons <[email protected]>

> ---
> 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:
>
>
>