[PATCH] ufs: fill i_size at directory creation

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

 



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 <[email protected]>

--- 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux