From: fazlin on
Hello All,

I am running an 2.6.29 linux kernel machine and am using a partition
with ext2 filesystem.

I ran dumpe2fs on this partition before and after running "df" command
and find that the "free block count" is getting reduced (which
according to me means some file has grown since free inode count
remains same).

I ran "df" with strace and find that it does statfs on all partitions.
Is it possible for statfs to modify the block counts??

Any ideas/help is appreciated.

Thanks in advance,
Fazlin
From: Måns Rullgård on
fazlin <fazlincse(a)gmail.com> writes:

> Hello All,
>
> I am running an 2.6.29 linux kernel machine and am using a partition
> with ext2 filesystem.
>
> I ran dumpe2fs on this partition before and after running "df" command
> and find that the "free block count" is getting reduced (which
> according to me means some file has grown since free inode count
> remains same).
>
> I ran "df" with strace and find that it does statfs on all partitions.
> Is it possible for statfs to modify the block counts??

Does that filesystem have any log files on it? Files in /var/log are
changing all the time, and the shell might be logging commands to your
home directory.

--
M�ns Rullg�rd
mans(a)mansr.com
From: fazlin on
On Apr 19, 9:00 pm, Måns Rullgård <m...(a)mansr.com> wrote:
> fazlin <fazlin...(a)gmail.com> writes:
> > Hello All,
>
> > I am running an 2.6.29 linux kernel machine and am using a partition
> > with ext2 filesystem.
>
> > I ran dumpe2fs on this partition before and after running "df" command
> > and find that the "free block count" is getting reduced (which
> > according to me means some file has grown since free inode count
> > remains same).
>
> > I ran "df" with strace and find that it does statfs on all partitions.
> > Is it possible for statfs to modify the block counts??
>
> Does that filesystem have any log files on it? Files in /var/log are
> changing all the time, and the shell might be logging commands to your
> home directory.
>
> --
> Måns Rullgård
> m...(a)mansr.com

No.. That partition has one file that cannot be written to and "lost
+found" directory...
From: fazlin on
On Apr 19, 9:02 pm, fazlin <fazlin...(a)gmail.com> wrote:
> On Apr 19, 9:00 pm, Måns Rullgård <m...(a)mansr.com> wrote:
>
>
>
> > fazlin <fazlin...(a)gmail.com> writes:
> > > Hello All,
>
> > > I am running an 2.6.29 linux kernel machine and am using a partition
> > > with ext2 filesystem.
>
> > > I ran dumpe2fs on this partition before and after running "df" command
> > > and find that the "free block count" is getting reduced (which
> > > according to me means some file has grown since free inode count
> > > remains same).
>
> > > I ran "df" with strace and find that it does statfs on all partitions..
> > > Is it possible for statfs to modify the block counts??
>
> > Does that filesystem have any log files on it? Files in /var/log are
> > changing all the time, and the shell might be logging commands to your
> > home directory.
>
> > --
> > Måns Rullgård
> > m...(a)mansr.com
>
> No.. That partition has one file that cannot be written to and "lost
> +found" directory...

I did more investigation and wrote a small pgm. that does statfs on
this partition. Running this also modified the free block count.

I looked into the kernel function ext2_statfs and i find that it
updates "es->s_free_blocks_count" and "es->s_free_inodes_count"
instead of just filling the buffer. Any idea why this done???? I guess
this mite be causing the prob that i see...

Thanks,
Fazlin
From: Måns Rullgård on
fazlin <fazlincse(a)gmail.com> writes:

> On Apr 19, 9:02 pm, fazlin <fazlin...(a)gmail.com> wrote:
>> On Apr 19, 9:00 pm, M�ns Rullg�rd <m...(a)mansr.com> wrote:
>>
>>
>>
>> > fazlin <fazlin...(a)gmail.com> writes:
>> > > Hello All,
>>
>> > > I am running an 2.6.29 linux kernel machine and am using a partition
>> > > with ext2 filesystem.
>>
>> > > I ran dumpe2fs on this partition before and after running "df" command
>> > > and find that the "free block count" is getting reduced (which
>> > > according to me means some file has grown since free inode count
>> > > remains same).
>>
>> > > I ran "df" with strace and find that it does statfs on all partitions.
>> > > Is it possible for statfs to modify the block counts??
>>
>> > Does that filesystem have any log files on it? Files in /var/log are
>> > changing all the time, and the shell might be logging commands to your
>> > home directory.
>>
>> No.. That partition has one file that cannot be written to and "lost
>> +found" directory...
>
> I did more investigation and wrote a small pgm. that does statfs on
> this partition. Running this also modified the free block count.
>
> I looked into the kernel function ext2_statfs and i find that it
> updates "es->s_free_blocks_count" and "es->s_free_inodes_count"
> instead of just filling the buffer. Any idea why this done???? I guess
> this mite be causing the prob that i see...

Here's the explanation:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2235219

--
M�ns Rullg�rd
mans(a)mansr.com