[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 17/31: Fix supporting >4GiB files in ext2fs
From: |
Samuel Thibault |
Subject: |
[hurd] 17/31: Fix supporting >4GiB files in ext2fs |
Date: |
Mon, 02 May 2016 23:48:32 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit f4d6b646a1aa6f8e489dd3eeae1a188de0b2a070
Author: Samuel Thibault <address@hidden>
Date: Tue Apr 26 22:37:09 2016 +0200
Fix supporting >4GiB files in ext2fs
* ext2fs/inode.c (diskfs_user_read_node): When sizeof(off_t) >= 8, add
di->i_size_high as high-64bit part to st->st_size. Drop setting
unused info->i_high_size.
(write_node): When sizeof(off_t) >= 8, write high-64bit part of st->st_size
to di->i_size_high.
* ext2fs/ext2_fs_i.h (ext2_inode_info): Remove i_high_size field.
* pfinet/linux-src/include/linux/ext2_fs_i.h (ext2_inode_info): Likewise.
---
ext2fs/ext2_fs_i.h | 1 -
ext2fs/inode.c | 20 ++++++++++++++------
pfinet/linux-src/include/linux/ext2_fs_i.h | 1 -
3 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/ext2fs/ext2_fs_i.h b/ext2fs/ext2_fs_i.h
index 72bcd5c..eefdbfa 100644
--- a/ext2fs/ext2_fs_i.h
+++ b/ext2fs/ext2_fs_i.h
@@ -35,7 +35,6 @@ struct ext2_inode_info {
__u32 i_next_alloc_goal;
__u32 i_prealloc_block;
__u32 i_prealloc_count;
- __u32 i_high_size;
int i_new_inode:1; /* Is a freshly allocated inode */
};
diff --git a/ext2fs/inode.c b/ext2fs/inode.c
index d83bedc..ccc8d69 100644
--- a/ext2fs/inode.c
+++ b/ext2fs/inode.c
@@ -198,13 +198,18 @@ diskfs_user_read_node (struct node *np, struct
lookup_context *ctx)
else
{
info->i_dir_acl = 0;
- info->i_high_size = di->i_size_high;
- if (info->i_high_size) /* XXX */
+ if (sizeof (off_t) >= 8)
+ /* 64bit file size */
+ st->st_size += ((off_t) di->i_size_high) << 32;
+ else
{
- dino_deref (di);
- ext2_warning ("cannot handle large file inode %Ld", np->cache_id);
- diskfs_end_catch_exception ();
- return EFBIG;
+ if (di->i_size_high) /* XXX */
+ {
+ dino_deref (di);
+ ext2_warning ("cannot handle large file inode %Ld", np->cache_id);
+ diskfs_end_catch_exception ();
+ return EFBIG;
+ }
}
}
info->i_block_group = inode_group_num (np->cache_id);
@@ -426,6 +431,9 @@ write_node (struct node *np)
{
di->i_dtime = 0;
di->i_size = st->st_size;
+ if (sizeof (off_t) >= 8 && !S_ISDIR (st->st_mode))
+ /* 64bit file size */
+ di->i_size_high = st->st_size >> 32;
di->i_blocks = st->st_blocks;
}
diff --git a/pfinet/linux-src/include/linux/ext2_fs_i.h
b/pfinet/linux-src/include/linux/ext2_fs_i.h
index 8f01f8a..7df9021 100644
--- a/pfinet/linux-src/include/linux/ext2_fs_i.h
+++ b/pfinet/linux-src/include/linux/ext2_fs_i.h
@@ -35,7 +35,6 @@ struct ext2_inode_info {
__u32 i_next_alloc_goal;
__u32 i_prealloc_block;
__u32 i_prealloc_count;
- __u32 i_high_size;
int i_new_inode:1; /* Is a freshly allocated inode */
};
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (b5a5ed2 -> b90164e), Samuel Thibault, 2016/05/02
- [hurd] 03/31: Use swapon path as pager partition path, Samuel Thibault, 2016/05/02
- [hurd] 05/31: Update NEWS file, Samuel Thibault, 2016/05/02
- [hurd] 14/31: libdiskfs: improve error handling, Samuel Thibault, 2016/05/02
- [hurd] 15/31: libtrivfs: fix error handling, Samuel Thibault, 2016/05/02
- [hurd] 17/31: Fix supporting >4GiB files in ext2fs,
Samuel Thibault <=
- [hurd] 18/31: libdiskfs: Reject LFS seeks and read/writes, Samuel Thibault, 2016/05/02
- [hurd] 22/31: Unify and document the way fsids are handled in trivfs translators, Samuel Thibault, 2016/05/02
- [hurd] 21/31: libshouldbeinlibc: use the new assert in the refcount primitives, Samuel Thibault, 2016/05/02
- [hurd] 12/31: Fix access mode of temporary files, Samuel Thibault, 2016/05/02
- [hurd] 02/31: Fix swap information numbers, Samuel Thibault, 2016/05/02
- [hurd] 19/31: libpager: add missing include, Samuel Thibault, 2016/05/02
- [hurd] 09/31: Make make install idempotent, Samuel Thibault, 2016/05/02
- [hurd] 23/31: startup: implement bits of the fs and io protocols, Samuel Thibault, 2016/05/02
- [hurd] 11/31: libfshelp: pass cookie to the callback function, Samuel Thibault, 2016/05/02
- [hurd] 13/31: Merge branch 'master' of git.savannah.gnu.org:/srv/git/hurd/hurd, Samuel Thibault, 2016/05/02