public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* squashfs size in statfs
@ 2006-06-05 10:43 Jan Engelhardt
  2006-06-05 22:57 ` H. Peter Anvin
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Engelhardt @ 2006-06-05 10:43 UTC (permalink / raw)
  To: Linux Kernel Mailing List; +Cc: plougher

Hello list,


# l /mnt
total 36293
drwxr-xr-x   2 root root       20 Jun  5 11:50 .
drwxr-xr-x  31 root root     4096 Jun  5  2006 ..
-rw-r--r--   1 root root 37158912 Jun  5 11:06 mem
# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/shm/sc.sqfs         26688     26688         0 100% /mnt
# l sc.sqfs
-rwx------  1 jengelh users 27279360 Jun  5 11:50 sc.sqfs

I think statfs() should show the uncompressed size, no?



Jan Engelhardt
-- 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: squashfs size in statfs
  2006-06-05 10:43 squashfs size in statfs Jan Engelhardt
@ 2006-06-05 22:57 ` H. Peter Anvin
  2006-06-15  9:51   ` Jan Engelhardt
  0 siblings, 1 reply; 6+ messages in thread
From: H. Peter Anvin @ 2006-06-05 22:57 UTC (permalink / raw)
  To: linux-kernel

Followup to:  <Pine.LNX.4.61.0606051243100.579@yvahk01.tjqt.qr>
By author:    Jan Engelhardt <jengelh@linux01.gwdg.de>
In newsgroup: linux.dev.kernel
>
> Hello list,
> 
> 
> # l /mnt
> total 36293
> drwxr-xr-x   2 root root       20 Jun  5 11:50 .
> drwxr-xr-x  31 root root     4096 Jun  5  2006 ..
> -rw-r--r--   1 root root 37158912 Jun  5 11:06 mem
> # df
> Filesystem           1K-blocks      Used Available Use% Mounted on
> /dev/shm/sc.sqfs         26688     26688         0 100% /mnt
> # l sc.sqfs
> -rwx------  1 jengelh users 27279360 Jun  5 11:50 sc.sqfs
> 
> I think statfs() should show the uncompressed size, no?
> 

No.

	-hpa

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: squashfs size in statfs
  2006-06-05 22:57 ` H. Peter Anvin
@ 2006-06-15  9:51   ` Jan Engelhardt
  2006-06-16 22:11     ` Phillip Lougher
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Engelhardt @ 2006-06-15  9:51 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: linux-kernel

>> Hello list,
>> 
>> 
>> # l /mnt
>> total 36293
>> drwxr-xr-x   2 root root       20 Jun  5 11:50 .
>> drwxr-xr-x  31 root root     4096 Jun  5  2006 ..
>> -rw-r--r--   1 root root 37158912 Jun  5 11:06 mem
>> # df
>> Filesystem           1K-blocks      Used Available Use% Mounted on
>> /dev/shm/sc.sqfs         26688     26688         0 100% /mnt
>> # l sc.sqfs
>> -rwx------  1 jengelh users 27279360 Jun  5 11:50 sc.sqfs
>> 
>> I think statfs() should show the uncompressed size, no?
>
>No.
>
Yes, because CRAM does it that way, and maybe zisofs does it too:

11:50 shanghai:/dev/shm # mount out.cram /mnt -oloop,ro
11:50 shanghai:/dev/shm # df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/shm/out.cram        14336     14336         0 100% /mnt
11:50 shanghai:/dev/shm # l out.cram
-rw-r--r--  1 root root 110592 Jun 15 11:50 out.cram



Jan Engelhardt
-- 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: squashfs size in statfs
  2006-06-15  9:51   ` Jan Engelhardt
@ 2006-06-16 22:11     ` Phillip Lougher
  2006-06-16 22:38       ` H. Peter Anvin
  0 siblings, 1 reply; 6+ messages in thread
From: Phillip Lougher @ 2006-06-16 22:11 UTC (permalink / raw)
  To: Jan Engelhardt; +Cc: H. Peter Anvin, linux-kernel, phillip

On 6/15/06, Jan Engelhardt <jengelh@linux01.gwdg.de> wrote:
> >> Hello list,
> >>
> >>
> >> # l /mnt
> >> total 36293
> >> drwxr-xr-x   2 root root       20 Jun  5 11:50 .
> >> drwxr-xr-x  31 root root     4096 Jun  5  2006 ..
> >> -rw-r--r--   1 root root 37158912 Jun  5 11:06 mem
> >> # df
> >> Filesystem           1K-blocks      Used Available Use% Mounted on
> >> /dev/shm/sc.sqfs         26688     26688         0 100% /mnt
> >> # l sc.sqfs
> >> -rwx------  1 jengelh users 27279360 Jun  5 11:50 sc.sqfs
> >>
> >> I think statfs() should show the uncompressed size, no?
> >
> >No.
> >
> Yes, because CRAM does it that way, and maybe zisofs does it too:

Zisofs doesn't (H. Peter Anvin should know as he wrote it :-) ).

root@pierrot:/# ls -la dir.iso
-rw-r--r--  1 root root 366592 2006-06-16 22:41 dir.iso
root@pierrot:/# mount -t iso9660 dir.iso /mnt -o loop
root@pierrot:/# df /mnt
Filesystem           1K-blocks      Used Available Use% Mounted on
/dir.iso                   358       358         0 100% /mnt
root@pierrot:/# ls -la /mnt
total 13
drwxr-xr-x   2 root root     2048 2006-06-16 22:41 .
drwxr-xr-x  32 root root     4096 2006-06-16 22:56 ..
-rw-r--r--   1 root root 51200000 2006-06-16 22:40 zero

Statfs should return the size of the filesystem, not the amount of
data the filesystem  represents.  In this respect the behaviour of
Squashfs and Zisofs is correct.

This is analogous to performing stat on a gzipped file.  The stat
returns the size of the compressed file, not the uncompressed size.

Phillip

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: squashfs size in statfs
  2006-06-16 22:11     ` Phillip Lougher
@ 2006-06-16 22:38       ` H. Peter Anvin
  2006-06-17  9:15         ` Jan Engelhardt
  0 siblings, 1 reply; 6+ messages in thread
From: H. Peter Anvin @ 2006-06-16 22:38 UTC (permalink / raw)
  To: Phillip Lougher; +Cc: Jan Engelhardt, linux-kernel, phillip

Phillip Lougher wrote:
>> >
>> Yes, because CRAM does it that way, and maybe zisofs does it too:
> 
> Zisofs doesn't (H. Peter Anvin should know as he wrote it :-) ).
> 
> root@pierrot:/# ls -la dir.iso
> -rw-r--r--  1 root root 366592 2006-06-16 22:41 dir.iso
> root@pierrot:/# mount -t iso9660 dir.iso /mnt -o loop
> root@pierrot:/# df /mnt
> Filesystem           1K-blocks      Used Available Use% Mounted on
> /dir.iso                   358       358         0 100% /mnt
> root@pierrot:/# ls -la /mnt
> total 13
> drwxr-xr-x   2 root root     2048 2006-06-16 22:41 .
> drwxr-xr-x  32 root root     4096 2006-06-16 22:56 ..
> -rw-r--r--   1 root root 51200000 2006-06-16 22:40 zero
> 
> Statfs should return the size of the filesystem, not the amount of
> data the filesystem  represents.  In this respect the behaviour of
> Squashfs and Zisofs is correct.
> 
> This is analogous to performing stat on a gzipped file.  The stat
> returns the size of the compressed file, not the uncompressed size.
> 

A better analogy is it is like statting a sparse file on, say, an ext3 filesystem.  stat 
(ls -s) and statfs report the amount of storage consumed.

	-hpa


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: squashfs size in statfs
  2006-06-16 22:38       ` H. Peter Anvin
@ 2006-06-17  9:15         ` Jan Engelhardt
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Engelhardt @ 2006-06-17  9:15 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Phillip Lougher, linux-kernel, phillip

>> > Yes, because CRAM does it that way, and maybe zisofs does it too:
>> 
>> Zisofs doesn't (H. Peter Anvin should know as he wrote it :-) ).
>> 
>> Statfs should return the size of the filesystem, not the amount of
>> data the filesystem  represents.  In this respect the behaviour of
>> Squashfs and Zisofs is correct.
>> 
>> This is analogous to performing stat on a gzipped file.  The stat
>> returns the size of the compressed file, not the uncompressed size.
>
> A better analogy is it is like statting a sparse file on, say, an ext3
> filesystem.  stat (ls -s) and statfs report the amount of storage consumed.
>
Too bad. Would have been a good indicator of how much space you need to 
copy an entire disc to disk, rather than running and waiting for du -s to 
complete.

So cramfs would need fixing.


Jan Engelhardt
-- 

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-06-17  9:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-05 10:43 squashfs size in statfs Jan Engelhardt
2006-06-05 22:57 ` H. Peter Anvin
2006-06-15  9:51   ` Jan Engelhardt
2006-06-16 22:11     ` Phillip Lougher
2006-06-16 22:38       ` H. Peter Anvin
2006-06-17  9:15         ` Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox