<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<pre>Hi Jan</pre>
<blockquote type="cite"
cite="mid:218497387.15286923.1591694653027.JavaMail.zimbra@redhat.com">
<pre class="moz-quote-pre" wrap="">
----- Original Message -----
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">In loop driver code, the sb_bsize was calculated as below
sb_bsize = bdev_logical_block_size(inode->i_sb->s_bdev),
it is the super block's block size that the backing file's inode belongs to,
not by using the st_blksize member of stat struct(it uses inode->i_blkbits).
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
I'm not sure I follow the above, are you saying the difference is bdev blksize
vs. filesystem blksize?</pre>
</blockquote>
<pre>I said the loop driver used dev_logical_block_size(inode->i_sb->s_bdev) but not using
st_blksize. I don't see they have conversion formula so using st_blksize maybe wrong.
</pre>
<blockquote type="cite"
cite="mid:218497387.15286923.1591694653027.JavaMail.zimbra@redhat.com">
<pre class="moz-quote-pre" wrap=""> Is the test failing in some scenarios or is this
fix based on code inspection?</pre>
</blockquote>
<pre>It affects the result of ("With nonzero offset less than logical_block_size").
When we can get sb_bdev on other machine(not s390), it should report EINVAL error.
But if we use stat.st_blksize, it passed.
not using st_blksize, result as below:
ioctl_loop05.c:81: INFO: With nonzero offset less than logical_block_size
ioctl_loop05.c:92: PASS: LOOP_SET_DIRECT_IO failed as expected: EINVAL (22)
using st_blksize, result as below:
ioctl_loop05.c:81: INFO: With nonzero offset less than logical_block_size
ioctl_loop05.c:87: PASS: LOOP_SET_DIRECT_IO succeeded
</pre>
<blockquote type="cite"
cite="mid:218497387.15286923.1591694653027.JavaMail.zimbra@redhat.com">
<pre class="moz-quote-pre" wrap="">
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
IMO, we don't have the direct ioctl to get this size, just try it from 512 to
page_size.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Would BLKSSZGET work? It returns bdev_logical_block_size().</pre>
</blockquote>
<pre>But it needs a blockdev, in user space, we can specify bdev, but how can we figure out this inode->i_sb->s_bdev block dev. </pre>
<blockquote type="cite"
cite="mid:218497387.15286923.1591694653027.JavaMail.zimbra@redhat.com">
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
</body>
</html>