<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/scsi/st.h, branch v3.8.4</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>[SCSI] st: raise device limit</title>
<updated>2012-09-14T16:59:29+00:00</updated>
<author>
<name>Jeff Mahoney</name>
<email>jeffm@suse.de</email>
</author>
<published>2012-08-18T19:20:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6ed33a4a0b86da42638b5f6a0bb9f9f9aee89f60'/>
<id>6ed33a4a0b86da42638b5f6a0bb9f9f9aee89f60</id>
<content type='text'>
The device limit of 128 tape drives was established in 2003 as a
significant increase from the 8 tape drives allowed previously.

We're seeing customer sites that between a large number of drives
and multipath are discovering more than 128 devices and running
into problems.

Now that we're not stuck having to store a pointer in array
and aren't limited by kmalloc failing on higher order allocs we can
lift the limit to fill the entire minor range based on the number
of modes.

Based on the current code, that's 2^17 devices.

Reviewed-by: Lee Duncan &lt;lduncan@suse.com&gt;
Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Acked-by: Kai Mäkisara &lt;kai.makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The device limit of 128 tape drives was established in 2003 as a
significant increase from the 8 tape drives allowed previously.

We're seeing customer sites that between a large number of drives
and multipath are discovering more than 128 devices and running
into problems.

Now that we're not stuck having to store a pointer in array
and aren't limited by kmalloc failing on higher order allocs we can
lift the limit to fill the entire minor range based on the number
of modes.

Based on the current code, that's 2^17 devices.

Reviewed-by: Lee Duncan &lt;lduncan@suse.com&gt;
Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Acked-by: Kai Mäkisara &lt;kai.makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] st: clean up device file creation and removal</title>
<updated>2012-09-14T16:59:29+00:00</updated>
<author>
<name>Jeff Mahoney</name>
<email>jeffm@suse.de</email>
</author>
<published>2012-08-18T19:20:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=26898afd67dfd707aa291648ca731063c8333c7f'/>
<id>26898afd67dfd707aa291648ca731063c8333c7f</id>
<content type='text'>
This patch cleans up the st device file creation and removal.

Reviewed-by: Lee Duncan &lt;lduncan@suse.com&gt;
Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Acked-by: Kai Mäkisara &lt;kai.makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch cleans up the st device file creation and removal.

Reviewed-by: Lee Duncan &lt;lduncan@suse.com&gt;
Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Acked-by: Kai Mäkisara &lt;kai.makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] st: get rid of scsi_tapes array</title>
<updated>2012-09-14T16:59:28+00:00</updated>
<author>
<name>Jeff Mahoney</name>
<email>jeffm@suse.de</email>
</author>
<published>2012-08-18T19:20:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6c648d95a6af4a79241a916871df17c84c68ea20'/>
<id>6c648d95a6af4a79241a916871df17c84c68ea20</id>
<content type='text'>
st currently allocates an array to store pointers to all of the
scsi_tape objects. It's used to discover available indexes to use as the
base for the minor number selection and later to look up scsi_tape
devices for character devices.

We switch to using an IDR for minor selection and a pointer from
st_modedef back to scsi_tape for the lookups.

Reviewed-by: Lee Duncan &lt;lduncan@suse.com&gt;
Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Acked-by: Kai Mäkisara &lt;kai.makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
st currently allocates an array to store pointers to all of the
scsi_tape objects. It's used to discover available indexes to use as the
base for the minor number selection and later to look up scsi_tape
devices for character devices.

We switch to using an IDR for minor selection and a pointer from
st_modedef back to scsi_tape for the lookups.

Reviewed-by: Lee Duncan &lt;lduncan@suse.com&gt;
Signed-off-by: Jeff Mahoney &lt;jeffm@suse.com&gt;
Acked-by: Kai Mäkisara &lt;kai.makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] st: fix memory leak with &gt;1MB tape I/O</title>
<updated>2012-05-10T07:32:34+00:00</updated>
<author>
<name>David Jeffery</name>
<email>dhjeffery@gmail.com</email>
</author>
<published>2012-04-11T16:14:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7c018a901c3fef2af9d713ba849e8e52eb82dde1'/>
<id>7c018a901c3fef2af9d713ba849e8e52eb82dde1</id>
<content type='text'>
There is a memory leak in the st driver when sending large enough reads or
writes using st's direct I/O path.  As part of mapping the application's
memory, a buffer to hold page pointers is allocated and the count of mapped
pages is stored in field do_dio.  A non-zero do_dio marks that direct I/O is
in use.

But do_dio is only 1 byte in size.  Mapping 256 4k pages overflows
do_dio and causes it to be set to 0, like direct I/O option was not
used.  When the I/O completes, the buffer to hold the page pointers is
not freed, and the page counts of the mapped pages are not reduced.
Every I/O of this size then leaks memory.

The size of do_dio needs to be increased to prevent it wrapping around.

Signed-off-by: David Jeffery &lt;djeffery@redhat.com&gt;
Acked-by: Kai Mäkisara &lt;kai.makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There is a memory leak in the st driver when sending large enough reads or
writes using st's direct I/O path.  As part of mapping the application's
memory, a buffer to hold page pointers is allocated and the count of mapped
pages is stored in field do_dio.  A non-zero do_dio marks that direct I/O is
in use.

But do_dio is only 1 byte in size.  Mapping 256 4k pages overflows
do_dio and causes it to be set to 0, like direct I/O option was not
used.  When the I/O completes, the buffer to hold the page pointers is
not freed, and the page counts of the mapped pages are not reduced.
Every I/O of this size then leaks memory.

The size of do_dio needs to be increased to prevent it wrapping around.

Signed-off-by: David Jeffery &lt;djeffery@redhat.com&gt;
Acked-by: Kai Mäkisara &lt;kai.makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] st: expand ability to write immediate filemarks</title>
<updated>2012-03-27T07:26:34+00:00</updated>
<author>
<name>Lee Duncan</name>
<email>lduncan@suse.com</email>
</author>
<published>2012-03-01T20:41:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c743e44fbb1f8668941e83de07662b1ecd33d083'/>
<id>c743e44fbb1f8668941e83de07662b1ecd33d083</id>
<content type='text'>
The st tape driver recently added the MTWEOFI ioctl, which writes
a tape filemark (EOF), like the MTWEOF ioctl, except that MTWEOFI
returns immediately. This makes certain applications, like backup
software, run much more quickly on buffered tape drives.

Since legacy applications do not know about this new MTWEOFI ioctl,
this patch adds a new ioctl option that tells the st driver to return
immediately when writing an EOF (i.e. a filemark). This new flag
is much like the existing flag that tells the st driver to perform
writes (and certain other IOs) immediately, but this new flag only
applies to writing EOFs.

This new feature is controlled via the MTSETDRVBUFFER ioctl, using
the newly-defined MT_ST_NOWAIT_EOF flag.

Use of this new feature is displayed via the sysfs tape "options"
attribute.

The st documentation was updated to mention this new flag, as well
as the problems that can occur from using it.

Signed-off-by: Lee Duncan &lt;lduncan@suse.com&gt;
Acked-by: Kai Makisara &lt;kai.makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The st tape driver recently added the MTWEOFI ioctl, which writes
a tape filemark (EOF), like the MTWEOF ioctl, except that MTWEOFI
returns immediately. This makes certain applications, like backup
software, run much more quickly on buffered tape drives.

Since legacy applications do not know about this new MTWEOFI ioctl,
this patch adds a new ioctl option that tells the st driver to return
immediately when writing an EOF (i.e. a filemark). This new flag
is much like the existing flag that tells the st driver to perform
writes (and certain other IOs) immediately, but this new flag only
applies to writing EOFs.

This new feature is controlled via the MTSETDRVBUFFER ioctl, using
the newly-defined MT_ST_NOWAIT_EOF flag.

Use of this new feature is displayed via the sysfs tape "options"
attribute.

The st documentation was updated to mention this new flag, as well
as the problems that can occur from using it.

Signed-off-by: Lee Duncan &lt;lduncan@suse.com&gt;
Acked-by: Kai Makisara &lt;kai.makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] st: fix mdata-&gt;page_order handling</title>
<updated>2009-12-10T14:54:13+00:00</updated>
<author>
<name>FUJITA Tomonori</name>
<email>fujita.tomonori@lab.ntt.co.jp</email>
</author>
<published>2009-11-26T00:24:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c982c368bb90adbd312faa05d0cfd842e9ab45a7'/>
<id>c982c368bb90adbd312faa05d0cfd842e9ab45a7</id>
<content type='text'>
dio transfer always resets mdata-&gt;page_order to zero. It breaks
high-order pages previously allocated for non-dio transfer.

This patches adds reserved_page_order to st_buffer structure to save
page order for non-dio transfer.

http://bugzilla.kernel.org/show_bug.cgi?id=14563

When enlarge_buffer() allocates 524288 from 0, st uses six-order page
allocation. So mdata-&gt;page_order is 6 and frp_seg is 2.

After that, if st uses dio, sgl_map_user_pages() sets
mdata-&gt;page_order to 0 for st_do_scsi(). After that, when we call
normalize_buffer(), it frees only free frp_seg * PAGE_SIZE (2 * 4096)
though we should free frp_seg * PAGE_SIZE &lt;&lt; 6 (2 * 4096 &lt;&lt; 6). So we
see buffer_size is set to 516096 (524288 - 8192).

Reported-by: Joachim Breuer &lt;linux-kernel@jmbreuer.net&gt;
Tested-by: Joachim Breuer &lt;linux-kernel@jmbreuer.net&gt;
Acked-by: Kai Makisara &lt;kai.makisara@kolumbus.fi&gt;
Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Cc: stable@kernel.org
Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dio transfer always resets mdata-&gt;page_order to zero. It breaks
high-order pages previously allocated for non-dio transfer.

This patches adds reserved_page_order to st_buffer structure to save
page order for non-dio transfer.

http://bugzilla.kernel.org/show_bug.cgi?id=14563

When enlarge_buffer() allocates 524288 from 0, st uses six-order page
allocation. So mdata-&gt;page_order is 6 and frp_seg is 2.

After that, if st uses dio, sgl_map_user_pages() sets
mdata-&gt;page_order to 0 for st_do_scsi(). After that, when we call
normalize_buffer(), it frees only free frp_seg * PAGE_SIZE (2 * 4096)
though we should free frp_seg * PAGE_SIZE &lt;&lt; 6 (2 * 4096 &lt;&lt; 6). So we
see buffer_size is set to 516096 (524288 - 8192).

Reported-by: Joachim Breuer &lt;linux-kernel@jmbreuer.net&gt;
Tested-by: Joachim Breuer &lt;linux-kernel@jmbreuer.net&gt;
Acked-by: Kai Makisara &lt;kai.makisara@kolumbus.fi&gt;
Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Cc: stable@kernel.org
Signed-off-by: James Bottomley &lt;James.Bottomley@suse.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] st: remove unused frp_sg_current</title>
<updated>2009-01-02T18:02:25+00:00</updated>
<author>
<name>FUJITA Tomonori</name>
<email>fujita.tomonori@lab.ntt.co.jp</email>
</author>
<published>2008-12-18T05:49:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=edf69c58c74eeeb48f62f267ce41f7827cb4dd06'/>
<id>edf69c58c74eeeb48f62f267ce41f7827cb4dd06</id>
<content type='text'>
frp_sg_current in struct st_buffer is always zero. We don't need it.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Acked-by: Kai Makisara &lt;Kai.Makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
frp_sg_current in struct st_buffer is always zero. We don't need it.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Acked-by: Kai Makisara &lt;Kai.Makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] st: remove unused orig_frp_segs</title>
<updated>2009-01-02T18:02:01+00:00</updated>
<author>
<name>FUJITA Tomonori</name>
<email>fujita.tomonori@lab.ntt.co.jp</email>
</author>
<published>2008-12-18T05:49:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1ac63cf5c05f956f52ab418a07f77d12328f3b5f'/>
<id>1ac63cf5c05f956f52ab418a07f77d12328f3b5f</id>
<content type='text'>
orig_frp_segs in struct st_buffer is always zero. We don't need it.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Acked-by: Kai Makisara &lt;Kai.Makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
orig_frp_segs in struct st_buffer is always zero. We don't need it.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Acked-by: Kai Makisara &lt;Kai.Makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] st: remove struct scatterlist</title>
<updated>2009-01-02T18:01:15+00:00</updated>
<author>
<name>FUJITA Tomonori</name>
<email>fujita.tomonori@lab.ntt.co.jp</email>
</author>
<published>2008-12-18T05:49:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b3d59115ba2b2550d70eafd929f1fa607fe588dc'/>
<id>b3d59115ba2b2550d70eafd929f1fa607fe588dc</id>
<content type='text'>
This removes the usage of struct scatterlist completely.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Acked-by: Kai Makisara &lt;Kai.Makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This removes the usage of struct scatterlist completely.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Acked-by: Kai Makisara &lt;Kai.Makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] st: kill struct st_buff_fragment</title>
<updated>2009-01-02T18:00:53+00:00</updated>
<author>
<name>FUJITA Tomonori</name>
<email>fujita.tomonori@lab.ntt.co.jp</email>
</author>
<published>2008-12-18T05:49:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=08c95832427b449ecfb357696f7b8e239b79a72c'/>
<id>08c95832427b449ecfb357696f7b8e239b79a72c</id>
<content type='text'>
This removes struct st_buff_fragment and use reserved_pages array to
store fragment buffer.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Acked-by: Kai Makisara &lt;Kai.Makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This removes struct st_buff_fragment and use reserved_pages array to
store fragment buffer.

Signed-off-by: FUJITA Tomonori &lt;fujita.tomonori@lab.ntt.co.jp&gt;
Acked-by: Kai Makisara &lt;Kai.Makisara@kolumbus.fi&gt;
Signed-off-by: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
