lkml.org 
[lkml]   [2006]   [Feb]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] ufs: fill i_size at directory creation
On Fri, Feb 03, 2006 at 08:46:13PM +0300, Alexey Dobriyan wrote:
> Thanks, these two patches makes things better but not much better.
>
> 1.
>
> inode->i_blocks = sb->s_blocksize / UFS_SECTOR_SIZE;
> + inode->i_size = sb->s_blocksize;
> de = (struct ufs_dir_entry *) dir_block->b_data;
>
> This creates directories which are 2048 bytes in size. Native ones are
> 512 bytes.
>
> inode->i_size = 512;
>
> makes mkdir and rm reliable for me both on linux and OpenBSD.

I take "reliably" back.

for i in $(seq 1 100); do mkdir $i; done

barfs after 42-nd.

How about this as a first small step?

[PATCH] ufs: fill i_size at directory creation

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

--- a/fs/ufs/dir.c
+++ b/fs/ufs/dir.c
@@ -539,6 +539,7 @@ int ufs_make_empty(struct inode * inode,
return err;

inode->i_blocks = sb->s_blocksize / UFS_SECTOR_SIZE;
+ inode->i_size = UFS_SB(sb)->s_uspi->s_fsize;
de = (struct ufs_dir_entry *) dir_block->b_data;
de->d_ino = cpu_to_fs32(sb, inode->i_ino);
ufs_set_de_type(sb, de, inode->i_mode);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-02-04 02:02    [W:0.167 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site