From: Linus Torvalds <torvalds@osdl.org>
To: Samuel Thibault <samuel.thibault@ens-lyon.org>,
Jeremy Allison <jra@samba.org>
Cc: Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [2.6] smbfs & "du" illness
Date: Sat, 25 Sep 2004 09:41:59 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.58.0409250929030.2317@ppc970.osdl.org> (raw)
In-Reply-To: <20040917205422.GD2685@bouh.is-a-geek.org>
On Fri, 17 Sep 2004, Samuel Thibault wrote:
>
> But I discussed about it with samba people (see
> http://lists.samba.org/archive/samba-technical/2004-September/thread.html
> "Unix Extension & "du"" subject), and they told that they modified
> it into bytes because there was no block size specified.
I hate to say so, but Jeremy is a git in this case.
There's definitely a very standard UNIX blocksize, and it's 512.
And yes, that's a _fixed_ blocksize. When you use "stat()", and you look
at "st_blocks", it's ALWAYS in 512-byte entities. It doesn't matter that
"st_blksize" might be something else - when UNIX counts blocks, it counts
them in 512-byte chunks.
So complaining that you don't have a blocksize is just silly.
This is a fairly common thinko, btw. Many people see "st_blocks" and
"st_blksize" in the UNIX stat info, and they think that they are defined
in terms of each other, and that disk usage is "st_blocks*st_blksize"
bytes. Not so. Disk usage is "st_blocks*512" bytes, and "st_blksize" is
something totally different - it's the _preferred_ IO blocking factor.
So let's all repeat after me: UNIX file "blocksize" is 512. It's not a
question of whether that value makes sense these days or not, it's just a
matter of simple _fact_.
> Some conservative way of correcting it is the following:
Since that won't fix "du" _anyway_, I think it's pointless. As you point
out:
> Now another trouble is that samba people also use a minimum of 1Mo
> (hence the number in the above fstat result). I'm not sure what to do
> with this: should we then use file size which we divide into sectors
> ourselves ? Or should we keep 1Mo, getting some strange results to some
> extent ?
I'm claiming that samba is broken, and we should not try to fix it on the
client side. We should ask the samba people to get their act together.
They've apparently been able to put _two_ bugs in one single integer:
both messing up the block size _and_ then using a totally illogical
minimum value for the thing.
I bet the minimum value comes from the fact that all files end up using
"n" bytes for things like inodes etc. Let's make up some numbers, and
assume that somebody thought that the minimum disk-space used was 2kB.
Instead of dividing that by 512, and coming up with the value "4", they
multiplied it by the block size and came up with the value 1Mb.
Whatever the reason, the minimum size is clearly a samba bug, even if you
were to (incorrectly, Jeremy) claim that there is no standard blocksize.
Linus
next prev parent reply other threads:[~2004-09-25 16:42 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-17 20:54 Samuel Thibault
2004-09-25 16:41 ` Linus Torvalds [this message]
2004-09-25 17:11 ` Jeremy Allison
2004-09-25 17:14 ` Jeremy Allison
2004-09-25 17:41 ` YOSHIFUJI Hideaki / 吉藤英明
[not found] ` <20040925174406.GP580@jeremy1>
2004-09-25 18:06 ` Linus Torvalds
2004-09-25 18:12 ` Linus Torvalds
2004-09-25 18:20 ` Jeremy Allison
2004-09-25 18:25 ` Samuel Thibault
2004-09-25 18:32 ` Jeremy Allison
2004-09-25 19:16 ` Linus Torvalds
2004-09-25 19:22 ` Jeremy Allison
2004-09-25 19:27 ` Samuel Thibault
2004-09-25 18:29 ` Jeremy Allison
2004-09-25 18:31 ` Jeremy Allison
2004-09-25 19:20 ` Linus Torvalds
2004-09-25 19:25 ` Jeremy Allison
2004-09-25 19:52 ` Jeremy Allison
2004-09-25 20:21 ` Linus Torvalds
2004-09-25 21:10 ` Jeremy Allison
2004-09-25 21:59 ` Linus Torvalds
2004-09-25 22:08 ` Jeremy Allison
2004-09-25 22:18 ` Linus Torvalds
2004-09-25 22:23 ` Jeremy Allison
2004-09-25 22:40 ` Samuel Thibault
2004-09-26 0:41 ` Theodore Ts'o
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.58.0409250929030.2317@ppc970.osdl.org \
--to=torvalds@osdl.org \
--cc=jra@samba.org \
--cc=linux-kernel@vger.kernel.org \
--cc=samuel.thibault@ens-lyon.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®