[Stgt-devel] [PATCH] Make changes so that VTL stuff works properly ...

FUJITA Tomonori fujita.tomonori
Wed Jul 30 09:04:13 CEST 2008


On Wed, 30 Jul 2008 13:40:46 +1000
"Mark Harvey" <markh794 at gmail.com> wrote:

> On Wed, Jul 30, 2008 at 1:28 PM, Mark Harvey <markh794 at gmail.com> wrote:
> > My concern is with
> >
> > tgt_device_path_update()
> > {
> >    if(lu->path) {
> >        ....
> >        lu->bst->bs_close(lu);
> >        ....
> >    }
> > }
> >
> > bs_close()
> > {
> >    ....
> >    bs_thread_close();
> >    ....
> > }
> >
> >
> > What will occur if there are multiple LU attached to this target and
> > one LU is activately being read/written to while another LU has its
> > backing file path updated ?

Do you mean, we might kill threads that are touching other LUs in the
target?

If so, we are safe in regard to it. Each LU has the own threads (a
thread doesn't touch multiple LUs).

BTW, we will remove the thread code and use the single thread mode in
the future... We have it just because Linux AIO is not good enough
now.


> > I assume - multithreaded code is new experence for me - that we will
> > result in a core dump as the backing store threads have been torn
> > down.
> >
> > Cheers
> > Mark
> 
> Sorry - forgot to add. If this is the case, Richards patch will not
> fix the over-all problem.
> 
> The dtd_load_unload() only opens/closes the backing file. It does not
> attempt to initialize the threads.
> 
> 
> I feel the correct fix for this is:
> 
> To add  bs_init()/bs_exit() ?? hook to initialize/shutdown the threads.
> And the bs_open()/bs_close() to open/close the backing store file.
> 
> The bs_init() should be called at setup time and bs_open()/bs_close()
> when media loaded or unloaded.
> 
> I'll attempt to put something in code this afternoon and post a POC patch.

Yeah, as you said, we could have bs_init,exit,open/close. But I guess,
dtd_load_unload is ok even if we shutdown and initialize the threads
(though it's not optimal but it works).

Probably, we should unify dtd_load_unload and tgt_device_path_update
(I should have done when I added tgt_device_path_update).



More information about the stgt mailing list