From: Jan Kara <jack@suse.cz>
To: Peter Staubach <staubach@redhat.com>
Cc: Eric Sandeen <sandeen@redhat.com>, Mingming Cao <cmm@us.ibm.com>,
linux-ext4@vger.kernel.org
Subject: Re: [PATCH] ext4: delayed allocation i_blocks fix for stat(2)
Date: Tue, 8 Jul 2008 22:02:35 +0200 [thread overview]
Message-ID: <20080708200235.GC22477@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <48735A66.2040006@redhat.com>
> Eric Sandeen wrote:
> >Mingming Cao wrote:
> >
> >>ext4: delayed allocation i_blocks fix for stat(2)
> >>
> >>From: Mingming Cao <cmm@us.ibm.com>
> >>
> >>Right now i_blocks is not getting updated until the disks are actually
> >>allocaed on disk. This means with delayed allocation, right after files
> >>are copied, "ls -sF" shoes the file as taking 0 blocks on disk. "du"
> >>also shows the files taking zero space, which is highly confusing to the
> >>user.
> >>
> >>Since current delayed allocation already keep track of per-inode total
> >>number
> >>of blocks that are subject to delayed allocation, this patch fix this by
> >>using
> >>that to adjust the value returned by stat(2). When real block allocation
> >>is done, the i_blocks will get updated. Since the reserved blocks for
> >>delayed
> >>allocation will be decreased, this will be keep value returned by stat(2)
> >>consistent.
> >>
> >>Signed-off-by: Mingming Cao <cmm@us.ibm.com>
> >>
> >
> >Thanks Mingming, looks like just the right approach.
> >
> >Something about the spinlock for every stat seems heavy-handed to me but
> >I'll have to give that more thought. :)
> >
> >
>
> Since i_reserved_blocks is an unsigned long, it should be possible
> to atomically fetch it on all of the supported architectures,
> without the use of the spinlock. It seems to me that this spinlock
> is not required here.
Well, it's certainly not nice to rely on this. The clean solution
would be to convert i_reserved_blocks to atomic_t or atomic64_t on archs
that have it...
Honza
--
Jan Kara <jack@suse.cz>
SuSE CR Labs
next prev parent reply other threads:[~2008-07-08 20:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-07 23:36 [PATCH] ext4: delayed allocation i_blocks fix for stat(2) Mingming Cao
2008-07-07 23:47 ` Theodore Tso
2008-07-08 1:11 ` Eric Sandeen
2008-07-08 12:15 ` Peter Staubach
2008-07-08 20:02 ` Jan Kara [this message]
2008-07-08 22:55 ` Mingming Cao
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=20080708200235.GC22477@atrey.karlin.mff.cuni.cz \
--to=jack@suse.cz \
--cc=cmm@us.ibm.com \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=staubach@redhat.com \
/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