2001-11-19 02:46:12

by Jeff V. Merkey

[permalink] [raw]
Subject: st.c SCSI Tape ioctl() bug



Kai/Linux,

The ioctl() function to enable/disable code 15 comrpession has
some problems. I have a fix to the code, but it does not
always seem to work properly, so I think you should do this
review.

If you call the ioctl() tape command from kernel space to
enable and disable **DEFAULT** compression (not MTCOMPRESSION
ioctl, the MT_ST_DEF_COMPRESSION code path) there is a case
where the default_compression/compression_changed flags
can horribly out of sync.

Please take a look at this code. We have gotten around it
by simply calling MTCOMPRESSION everytime we need to use it,
however, but the other path seems busted, and it would be
nice for it to work properly.

Thanks,

Jeff


2001-11-21 21:58:42

by Kai Mäkisara (Kolumbus)

[permalink] [raw]
Subject: Re: st.c SCSI Tape ioctl() bug

On Sun, 18 Nov 2001, Jeff V. Merkey wrote:

>
>
> Kai/Linux,
>
> The ioctl() function to enable/disable code 15 comrpession has
> some problems. I have a fix to the code, but it does not
> always seem to work properly, so I think you should do this
> review.
>
> If you call the ioctl() tape command from kernel space to
> enable and disable **DEFAULT** compression (not MTCOMPRESSION
> ioctl, the MT_ST_DEF_COMPRESSION code path) there is a case
> where the default_compression/compression_changed flags
> can horribly out of sync.
>
> Please take a look at this code. We have gotten around it
> by simply calling MTCOMPRESSION everytime we need to use it,
> however, but the other path seems busted, and it would be
> nice for it to work properly.
>
The default compression is meant to be set only at system
startup/module loading. If the user wants to change the compression at any
other time, using MTCOMPRESSION is the correct way.

However, I agree that setting the default compression at any other time
should also give the expected result. Currently, the compression default
will be enforced when a new tape is inserted. It might be better to change
the compression immediately after the default has been changed if the
drive is ready. This should also synchronize the compression_changed flag.
I will think about this a little more and then make the changes.

Kai


2001-11-21 22:15:32

by Jeff Merkey

[permalink] [raw]
Subject: Re: st.c SCSI Tape ioctl() bug

Thanks Kai. You may want to check the default settings of these flags. We
did notice that for whatever reaosn, when theyn get out of sync it's related
ot this problem. However, the fix I did to the code appeared to cause
breakage of other areas. Clearly a task better left to you.

Jeff

----- Original Message -----
From: "Kai Makisara" <[email protected]>
To: "Jeff V. Merkey" <[email protected]>
Cc: <[email protected]>
Sent: Wednesday, November 21, 2001 2:58 PM
Subject: Re: st.c SCSI Tape ioctl() bug


> On Sun, 18 Nov 2001, Jeff V. Merkey wrote:
>
> >
> >
> > Kai/Linux,
> >
> > The ioctl() function to enable/disable code 15 comrpession has
> > some problems. I have a fix to the code, but it does not
> > always seem to work properly, so I think you should do this
> > review.
> >
> > If you call the ioctl() tape command from kernel space to
> > enable and disable **DEFAULT** compression (not MTCOMPRESSION
> > ioctl, the MT_ST_DEF_COMPRESSION code path) there is a case
> > where the default_compression/compression_changed flags
> > can horribly out of sync.
> >
> > Please take a look at this code. We have gotten around it
> > by simply calling MTCOMPRESSION everytime we need to use it,
> > however, but the other path seems busted, and it would be
> > nice for it to work properly.
> >
> The default compression is meant to be set only at system
> startup/module loading. If the user wants to change the compression at any
> other time, using MTCOMPRESSION is the correct way.
>
> However, I agree that setting the default compression at any other time
> should also give the expected result. Currently, the compression default
> will be enforced when a new tape is inserted. It might be better to change
> the compression immediately after the default has been changed if the
> drive is ready. This should also synchronize the compression_changed flag.
> I will think about this a little more and then make the changes.
>
> Kai
>