[LU-10923] cl_io_loop improperly assumes all ios are rw-type IOs Created: 18/Apr/18  Updated: 29/Jan/22  Resolved: 29/Jan/22

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Oleg Drokin Assignee: Dmitry Eremin (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None

Issue Links:
Related
is related to LU-11825 Remove LU-8964/pio feature & supporti... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

cl_io_loop has this code:

                pos   = io->u.ci_rw.rw_range.cir_pos;
                count = io->u.ci_rw.rw_range.cir_count;

                if (io->ci_pio) {
                        /* submit this range for parallel execution */
                        pt = cl_io_submit_pt(io, pos, count);
                        if (IS_ERR(pt)) {
                                cl_io_iter_fini(env, io);
                                rc = PTR_ERR(pt);
                                break;
                        }

                        *tail = pt;
                        tail = &pt->cip_next;
                } else {
                        size_t nob = io->ci_nob;

                        CDEBUG(D_VFSTRACE,
                                "execute type %u range: [%llu, %llu) nob: %zu %s\n",
                                io->ci_type, pos, pos + count, nob,
                                io->ci_continue ? "continue" : "stop");

Now the io->u.ci_rw. is only valid for accessing if the IO is of type CIT_READ/WRITE, otherwise the union is populated differently.

And cl_io_loop IS called by other places, for example:

        if (cl_io_init(env, io, CIT_FSYNC, io->ci_obj) == 0)
                result = cl_io_loop(env, io);

The problematic code was introduced by LU-8964 - parallel io code.
commit db59ecb5d1d0284fb918def6348a11e0966d7767



 Comments   
Comment by Peter Jones [ 18/Apr/18 ]

Dmitry

Can you please advise?

Thanks

Peter

Comment by Dmitry Eremin (Inactive) [ 18/Apr/18 ]

I agree this is not correct, but not valid values are used in debug message only. Therefore this is minor issue. I will provide a patch to make it valid.

Comment by Gerrit Updater [ 18/Apr/18 ]

Dmitry Eremin (dmitry.eremin@intel.com) uploaded a new patch: https://review.whamcloud.com/32049
Subject: LU-10923 obdclass: fix access to rw-type members from other IOs
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 438bc8dbf986718959557c6ba83553ff7e1ac28c

Comment by Andreas Dilger [ 29/Jan/22 ]

The pio feature was removed in patch https://review.whamcloud.com/33912 "LU-11825 clio: Remove pio feature"

Generated at Sat Feb 10 02:39:22 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.