Re: [PATCH 2.6.27.y 04/11] ext4: Add percpu dirty block accounting.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2010-03-15, at 18:25, Theodore Ts'o wrote:
int ext4_claim_free_blocks(struct ext4_sb_info *sbi,
						ext4_fsblk_t nblocks)
{
+	if (free_blocks - (nblocks + root_blocks + dirty_blocks) <
+						EXT4_FREEBLOCKS_WATERMARK) {
+		free_blocks  = percpu_counter_sum(fbc);
+		dirty_blocks = percpu_counter_sum(dbc);
+		if (dirty_blocks < 0) {
+			printk(KERN_CRIT "Dirty block accounting "
+					"went wrong %lld\n",
+					dirty_blocks);

Just looking at this old patch, and noticed this is still the same in newer versions.

This should probably be either an ext4_error(), since it affects data correctness, even though it isn't an on-disk error, or at least an ext4_msg() so that it also prints the block device and uses the standard ext4 error format.

As it stands, this error doesn't indicate that it is an ext4 error, or which filesystem is involved, so it isn't very useful to the sysadmin. I don't think it is needed for the .stable release, but would be good for the next kernel.

In the first patch (ext4-claim-err.diff) the access to the superblock for ext4_msg() is a bit of a hack, but I think it isn't terrible.

The second patch (ext4-error-cleanup.diff, to be used instead of the first one) is a bit more thorough cleanup that changes the callers to pass a struct super_block, and also removes some single-use stack variables in related code.

Cheers, Andreas
--
Andreas Dilger
Sr. Staff Engineer, Lustre Group
Sun Microsystems of Canada, Inc.

Attachment: ext4-claim-err.diff
Description: Binary data

Attachment: ext4-error-cleanup.diff
Description: Binary data


[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux