Skip to contentSkip to conversation

e2compress on Linux 2.4.16

DISCUSSION Peter Wächtler 1 participant 1 message Jan 7, 2002 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 16 lines · Peter Wächtler
Quoted 16 lines

Bonjour,

I tried your e2compress patches and it didn't work for me at the first run :-( After compression of some larger files (>400KiB) the files couldn't be stat()ed -> the i_blocks field was "negative".

in fs/ext2/cpmpress.c::ext2_compress_cluster:2886
        inode->i_blocks -= ((u_nblk - c_nblk)
                            << (inode->i_sb->s_blocksize_bits - 9));

has to be deleted. Otherwise the i_blocks field gets decremented twice. Depending on the glibc version you use, a stat() fails due to some conversion code between lstat64() and userspace returning EOVERFLOW and "negative i_blocks" (viewable with debugfs)

Quoted 8 lines
Quoted 8 lines

ext2_free_blocks() calls DQUOT_FREE_BLOCK() which calls include/linux/fs.h::inode_sub_bytes() regardless if CONFIG_QUOTA is enabled or not.
In 2.2 the quota code was different - so there it was correct to substract the free'ed blocks.

With this "fix" all seems to work fine. So thanx for your work!

Since I didn't get any reply so far (perhaps you have longer vacation than me:)

I resend my mail and also cc:lkml - take it as a positive feedback!