[PATCH] e2fsprogs: remove fragment support which will never be implemented [modified format]

2007-08-09 Thread Coly Li
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

- From last patch, I found some strings contain '@' are treated as email 
address by my email client.
Therefore I resend this post again with modified format. Hope it is OK this 
time  :-)

Signed-Off-By: Coly Li <[EMAIL PROTECTED]>

diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 190c4b7..e94302d 100644
- --- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -521,7 +521,6 @@ void internal_dump_inode(FILE *out, const char *prefix,
 int do_dump_blocks)
 {
const char *i_type;
- - char frag, fsize;
int os = current_fs->super->s_creator_os;

if (LINUX_S_ISDIR(inode->i_mode)) i_type = "directory";
@@ -564,20 +563,6 @@ void internal_dump_inode(FILE *out, const char *prefix,
else
fprintf(out, "%sLinks: %d   Blockcount: %u\n",
prefix, inode->i_links_count, inode->i_blocks);
- - switch (os) {
- - case EXT2_OS_HURD:
- - frag = inode->osd2.hurd2.h_i_frag;
- - fsize = inode->osd2.hurd2.h_i_fsize;
- - break;
- - case EXT2_OS_MASIX:
- - frag = inode->osd2.masix2.m_i_frag;
- - fsize = inode->osd2.masix2.m_i_fsize;
- - break;
- - default:
- - frag = fsize = 0;
- - }
- - fprintf(out, "%sFragment:  Address: %dNumber: %dSize: %d\n",
- - prefix, inode->i_faddr, frag, fsize);
fprintf(out, "%sctime: 0x%08x -- %s", prefix, inode->i_ctime,
time_to_string(inode->i_ctime));
fprintf(out, "%satime: 0x%08x -- %s", prefix, inode->i_atime,
@@ -849,7 +834,6 @@ void do_modify_inode(int argc, char *argv[])
struct ext2_inode inode;
ext2_ino_t  inode_num;
int i;
- - unsigned char   *frag, *fsize;
charbuf[80];
int os;
const char  *hex_format = "0x%x";
@@ -893,24 +877,6 @@ void do_modify_inode(int argc, char *argv[])
modify_u32(argv[0], "Translator Block",
decimal_format, &inode.osd1.hurd1.h_i_translator);

- - modify_u32(argv[0], "Fragment address", decimal_format, &inode.i_faddr);
- - switch (os) {
- - case EXT2_OS_HURD:
- - frag = &inode.osd2.hurd2.h_i_frag;
- - fsize = &inode.osd2.hurd2.h_i_fsize;
- - break;
- - case EXT2_OS_MASIX:
- - frag = &inode.osd2.masix2.m_i_frag;
- - fsize = &inode.osd2.masix2.m_i_fsize;
- - break;
- - default:
- - frag = fsize = 0;
- - }
- - if (frag)
- - modify_u8(argv[0], "Fragment number", decimal_format, frag);
- - if (fsize)
- - modify_u8(argv[0], "Fragment size", decimal_format, fsize);
- -
for (i=0;  i < EXT2_NDIR_BLOCKS; i++) {
sprintf(buf, "Direct Block #%d", i);
modify_u32(argv[0], buf, decimal_format, &inode.i_block[i]);
diff --git a/debugfs/set_fields.c b/debugfs/set_fields.c
index 9ff7f8c..5f95a60 100644
- --- a/debugfs/set_fields.c
+++ b/debugfs/set_fields.c
@@ -65,9 +65,7 @@ static struct field_set_info super_fields[] = {
{ "free_inodes_count", &set_sb.s_free_inodes_count, 4, parse_uint },
{ "first_data_block", &set_sb.s_first_data_block, 4, parse_uint },
{ "log_block_size", &set_sb.s_log_block_size, 4, parse_uint },
- - { "log_frag_size", &set_sb.s_log_frag_size, 4, parse_int },
{ "blocks_per_group", &set_sb.s_blocks_per_group, 4, parse_uint },
- - { "frags_per_group", &set_sb.s_frags_per_group, 4, parse_uint },
{ "inodes_per_group", &set_sb.s_inodes_per_group, 4, parse_uint },
{ "mtime", &set_sb.s_mtime, 4, parse_time },
{ "wtime", &set_sb.s_wtime, 4, parse_time },
@@ -141,10 +139,7 @@ static struct field_set_info inode_fields[] = {
{ "generation", &set_inode.i_generation, 4, parse_uint },
{ "file_acl", &set_inode.i_file_acl, 4, parse_uint },
{ "dir_acl", &set_inode.i_dir_acl, 4, parse_uint },
- - { "faddr", &set_inode.i_faddr, 4, parse_uint },
{ "blocks_hi", &set_inode.osd2.linux2.l_i_blocks_hi, 2, parse_uint },
- - { "frag", &set_inode.osd2.hurd2.h_i_frag, 1, parse_uint },
- - { "fsize", &set_inode.osd2.hurd2.h_i_fsize, 1, parse_uint },
{ "uid_high", &set_inode.osd2.linux2.l_i_uid_high, 2, parse_uint },
{ "gid_high", &set_inode.osd2.linux2.l_i_gid_high, 2, parse_uint },
{ "author", &set_inode.osd2.hurd2.h_i_author, 4, parse_uint },
diff --git a/e2fsck/message.c b/e2fsck/message.c
index b2e3e0f..e263bca 100644
- --- a/e2fsck/message.c
+++ b/e2fsck/message.c
@@ -293,9 +293,6 @@ static _INLINE_ void expand_inode_expression(char ch,
time_str = asctime(do_gmt ? gmtime(&t) : localtime(&t));
printf("%.24s", time_str);
break;
- - case 'F':
- - printf(

[PATCH] obsolete fragment from ext4

2007-08-09 Thread Coly Li
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Once ext4 will not implement fragment, it is believed it will never be implement
in future. Therefore fragment related source code in ext4 should be obsoleted --
no one will use it.

This patch obsolete fragment from ext4.
Another patch posted on linux-ext4 removing fragment supporting from e2fsprogs.
I tested both patch.


Signed-Off-By: Coly Li <[EMAIL PROTECTED]>

diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
index 427f830..b8b538d 100644
- --- a/fs/ext4/ialloc.c
+++ b/fs/ext4/ialloc.c
@@ -576,11 +576,6 @@ got:
/* dirsync only applies to directories */
if (!S_ISDIR(mode))
ei->i_flags &= ~EXT4_DIRSYNC_FL;
- -#ifdef EXT4_FRAGMENTS
- - ei->i_faddr = 0;
- - ei->i_frag_no = 0;
- - ei->i_frag_size = 0;
- -#endif
ei->i_file_acl = 0;
ei->i_dir_acl = 0;
ei->i_dtime = 0;
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index a4848e0..f283522 100644
- --- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2645,11 +2645,6 @@ void ext4_read_inode(struct inode * inode)
}
inode->i_blocks = le32_to_cpu(raw_inode->i_blocks);
ei->i_flags = le32_to_cpu(raw_inode->i_flags);
- -#ifdef EXT4_FRAGMENTS
- - ei->i_faddr = le32_to_cpu(raw_inode->i_faddr);
- - ei->i_frag_no = raw_inode->i_frag;
- - ei->i_frag_size = raw_inode->i_fsize;
- -#endif
ei->i_file_acl = le32_to_cpu(raw_inode->i_file_acl);
if (EXT4_SB(inode->i_sb)->s_es->s_creator_os !=
cpu_to_le32(EXT4_OS_HURD))
@@ -2794,11 +2789,6 @@ static int ext4_do_update_inode(handle_t *handle,
raw_inode->i_blocks = cpu_to_le32(inode->i_blocks);
raw_inode->i_dtime = cpu_to_le32(ei->i_dtime);
raw_inode->i_flags = cpu_to_le32(ei->i_flags);
- -#ifdef EXT4_FRAGMENTS
- - raw_inode->i_faddr = cpu_to_le32(ei->i_faddr);
- - raw_inode->i_frag = ei->i_frag_no;
- - raw_inode->i_fsize = ei->i_frag_size;
- -#endif
if (EXT4_SB(inode->i_sb)->s_es->s_creator_os !=
cpu_to_le32(EXT4_OS_HURD))
raw_inode->i_file_acl_high =
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 75adbb6..5e04d68 100644
- --- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1655,14 +1655,6 @@ static int ext4_fill_super (struct super_block *sb, void 
*data, int silent)
if (sbi->s_inode_size > EXT4_GOOD_OLD_INODE_SIZE)
sb->s_time_gran = 1 << (EXT4_EPOCH_BITS - 2);
}
- - sbi->s_frag_size = EXT4_MIN_FRAG_SIZE <<
- -le32_to_cpu(es->s_log_frag_size);
- - if (blocksize != sbi->s_frag_size) {
- - printk(KERN_ERR
- -"EXT4-fs: fragsize %lu != blocksize %u (unsupported)\n",
- -sbi->s_frag_size, blocksize);
- - goto failed_mount;
- - }
sbi->s_desc_size = le16_to_cpu(es->s_desc_size);
if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_64BIT)) {
if (sbi->s_desc_size < EXT4_MIN_DESC_SIZE_64BIT ||
@@ -1676,7 +1668,6 @@ static int ext4_fill_super (struct super_block *sb, void 
*data, int silent)
} else
sbi->s_desc_size = EXT4_MIN_DESC_SIZE;
sbi->s_blocks_per_group = le32_to_cpu(es->s_blocks_per_group);
- - sbi->s_frags_per_group = le32_to_cpu(es->s_frags_per_group);
sbi->s_inodes_per_group = le32_to_cpu(es->s_inodes_per_group);
if (EXT4_INODE_SIZE(sb) == 0)
goto cantfind_ext4;
@@ -1700,12 +1691,6 @@ static int ext4_fill_super (struct super_block *sb, void 
*data, int silent)
sbi->s_blocks_per_group);
goto failed_mount;
}
- - if (sbi->s_frags_per_group > blocksize * 8) {
- - printk (KERN_ERR
- - "EXT4-fs: #fragments per group too big: %lu\n",
- - sbi->s_frags_per_group);
- - goto failed_mount;
- - }
if (sbi->s_inodes_per_group > blocksize * 8) {
printk (KERN_ERR
"EXT4-fs: #inodes per group too big: %lu\n",
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index cdee7aa..3baeb99 100644
- --- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -105,20 +105,6 @@
 #define EXT4_BLOCK_ALIGN(size, blkbits)ALIGN((size), (1 << 
(blkbits)))

 /*
- - * Macro-instructions used to manage fragments
- - */
- -#define EXT4_MIN_FRAG_SIZE   1024
- -#define  EXT4_MAX_FRAG_SIZE  4096
- -#define EXT4_MIN_FRAG_LOG_SIZE 10
- -#ifdef __KERNEL__
- -# define EXT4_FRAG_SIZE(s)   (EXT4_SB(s)->s_frag_size)
- -# define EXT4_FRAGS_PER_BLOCK(s) (EXT4_SB(s)->s_frags_per_block)
- -#else
- -# define EXT4_FRAG_SIZE(s)   (EXT4_MIN_FRAG_SIZE << 
(s)->s_log_frag_size)
- -# define EXT4_FRAGS_PER_BLOCK(s) (EXT4_BLOCK_SIZE(s) / EXT4_FRAG_SIZE(s))
- -#endif
- -
- -/*
  * Structure of a blocks group descriptor
  */
 struct ext4_gr

Re: seekwatcher IO visualization

2007-08-09 Thread Jose R. Santos
On Thu, 9 Aug 2007 14:53:55 -0600
Andreas Dilger <[EMAIL PROTECTED]> wrote:

> I saw on #linuxfs today some graphs and movies by Chris Mason showing
> the poor IO locality for ext3 compared to btrfs and XFS.  It would be
> interesting to run this with ext4+mballoc+delalloc, and a separate
> one with the FLEXBG feature enabled to see how that improves the
> seeking/locality.
> 
> http://oss.oracle.com/~mason/seekwatcher/
> 
> Cheers, Andreas
> --
> Andreas Dilger
> Principal Software Engineer
> Cluster File Systems, Inc.
> 

I was planing to use seekwatcher to look at fsck activity when using
FLEX_BG since I'm already seeing noticeable improvements by using this
feature alone.

We can try other workloads and see how ext4 compares.

-JRS
-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] dir_index: error out instead of BUG on corrupt hash dir limit

2007-08-09 Thread Eric Sandeen
Eric Sandeen wrote:
> A corrupt ondisk hash dir limit will trip an assert in dx_probe,
> which calls BUG().  Instead, we can just issue the warning and
> fail dx_probe like the other 3 tests just before it.  Thanks
> to aviro for suggesting this...  

BTW this type of corruption is apparently quite easily generated by
using the binary windows-only ext driver at www.fs-driver.org

-Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] dir_index: error out instead of BUG on corrupt hash dir limit

2007-08-09 Thread Eric Sandeen
A corrupt ondisk hash dir limit will trip an assert in dx_probe,
which calls BUG().  Instead, we can just issue the warning and
fail dx_probe like the other 3 tests just before it.  Thanks
to aviro for suggesting this...  Tested with a hand-crafted
corrupt ext3 image, issues:

EXT3-fs warning (device loop0): dx_probe: Corrupt limit in dir inode 14337

vs. previous:

Assertion failure in dx_probe() at fs/ext3/namei.c:383: "dx_get_limit(entries) 
== dx_root_limit(dir, root->info.info_length)"
[ cut here ]
kernel BUG at fs/ext3/namei.c:383!
...


Signed-off-by: Eric Sandeen <[EMAIL PROTECTED]>

Index: linux-2.6.22-rc4/fs/ext3/namei.c
===
--- linux-2.6.22-rc4.orig/fs/ext3/namei.c
+++ linux-2.6.22-rc4/fs/ext3/namei.c
@@ -379,8 +379,16 @@ dx_probe(struct dentry *dentry, struct i
 
entries = (struct dx_entry *) (((char *)&root->info) +
   root->info.info_length);
-   assert(dx_get_limit(entries) == dx_root_limit(dir,
- root->info.info_length));
+
+   if (dx_get_limit(entries) != dx_root_limit(dir,
+  root->info.info_length)) {
+   ext3_warning(dir->i_sb, __FUNCTION__,
+"Corrupt limit in dir inode %ld\n", dir->i_ino);
+   brelse(bh);
+   *err = ERR_BAD_DX_DIR;
+   goto fail;
+   }
+
dxtrace (printk("Look up %x", hash));
while (1)
{
Index: linux-2.6.22-rc4/fs/ext4/namei.c
===
--- linux-2.6.22-rc4.orig/fs/ext4/namei.c
+++ linux-2.6.22-rc4/fs/ext4/namei.c
@@ -379,8 +379,16 @@ dx_probe(struct dentry *dentry, struct i
 
entries = (struct dx_entry *) (((char *)&root->info) +
   root->info.info_length);
-   assert(dx_get_limit(entries) == dx_root_limit(dir,
- root->info.info_length));
+
+   if (dx_get_limit(entries) != dx_root_limit(dir,
+  root->info.info_length)) {
+   ext4_warning(dir->i_sb, __FUNCTION__,
+"Corrupt limit in dir inode %ld\n", dir->i_ino);
+   brelse(bh);
+   *err = ERR_BAD_DX_DIR;
+   goto fail;
+   }
+
dxtrace (printk("Look up %x", hash));
while (1)
{

-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


seekwatcher IO visualization

2007-08-09 Thread Andreas Dilger
I saw on #linuxfs today some graphs and movies by Chris Mason showing
the poor IO locality for ext3 compared to btrfs and XFS.  It would be
interesting to run this with ext4+mballoc+delalloc, and a separate
one with the FLEXBG feature enabled to see how that improves the
seeking/locality.

http://oss.oracle.com/~mason/seekwatcher/

Cheers, Andreas
--
Andreas Dilger
Principal Software Engineer
Cluster File Systems, Inc.

-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [fuse-devel] [PATCH 00/25] move handling of setuid/gid bits from VFS into individual setattr functions (RESEND)

2007-08-09 Thread Jeff Layton
On Wed, 8 Aug 2007 22:05:13 +0200 (CEST)
Jan Engelhardt <[EMAIL PROTECTED]> wrote:

> 
> On Aug 8 2007 09:48, Andrew Morton wrote:
> >> > On Mon, 6 Aug 2007 09:54:03 -0400
> >> > Jeff Layton <[EMAIL PROTECTED]> wrote:
> >> > 
> >> > Is there any way in which we can prevent these problems?  Say
> >> > 
> >> > - rename something so that unconverted filesystems will reliably fail to
> >> >   compile?
> >> > 
> >> 
> >> I suppose we could rename the .setattr inode operation to something
> >> else, but then we'll be stuck with it for at least a while. That seems
> >> sort of kludgey too...
> >
> >Sure.  We're changing the required behaviour of .setattr.  Changing its
> >name is a fine and reasonably reliable way to communicate that fact.
> 
> Maybe ->chattr/->chgattr?
> 
> 

That seems like a good replacement name. :-)

Now that I think on this further though, maybe Trond's suggestion to
change how the return code works is the best one. That would
(hopefully) catch this problem at runtime, so if someone is using a
precompiled but unconverted module then that would be detected too.

--
Jeff Layton <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html