[Ocfs2-tools-devel] [PATCH 3/5] tunefs.ocfs2: Check for block64 before resizing > 16TB
Sunil Mushran
sunil.mushran at oracle.com
Thu Jan 12 13:44:37 PST 2012
Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com>
If it alright, I will tweak the error message thrown in the last if block.
From:
errorf("The Journaled Block Device (JBD) cannot "
"support more than %"PRIu32" blocks.\n"
"Please enable block64 journals (JBD2) to resize.\n",
UINT32_MAX);
To:
errorf("The file system journal is not configured to support "
"more than %"PRIu32" blocks\n."
"Please enable the \"block64\" journal feature before "
"resizing the file system.\n", UINT32_MAX);
Sunil
On 12/22/2011 03:42 PM, Goldwyn Rodrigues wrote:
> Signed-off-by: Goldwyn Rodrigues<rgoldwyn at suse.de>
> ---
> tunefs.ocfs2/libocfs2ne.c | 8 ++++++++
> tunefs.ocfs2/libocfs2ne.h | 1 +
> tunefs.ocfs2/op_resize_volume.c | 3 ++-
> 3 files changed, 11 insertions(+), 1 deletions(-)
>
> diff --git a/tunefs.ocfs2/libocfs2ne.c b/tunefs.ocfs2/libocfs2ne.c
> index 8e814e7..709951c 100644
> --- a/tunefs.ocfs2/libocfs2ne.c
> +++ b/tunefs.ocfs2/libocfs2ne.c
> @@ -2080,6 +2080,14 @@ out:
> return err;
> }
>
> +int tunefs_is_journal64(ocfs2_filesys *fs)
> +{
> + struct tunefs_filesystem_state *state = tunefs_get_state(fs);
> + if (state->ts_journal_features.opt_incompat& JBD2_FEATURE_INCOMPAT_64BIT)
> + return 1;
> + return 0;
> +}
> +
> errcode_t tunefs_close(ocfs2_filesys *fs)
> {
> errcode_t tmp, err = 0;
> diff --git a/tunefs.ocfs2/libocfs2ne.h b/tunefs.ocfs2/libocfs2ne.h
> index 15d0ec6..848840f 100644
> --- a/tunefs.ocfs2/libocfs2ne.h
> +++ b/tunefs.ocfs2/libocfs2ne.h
> @@ -310,5 +310,6 @@ errcode_t tunefs_prepare_dir_trailer(ocfs2_filesys *fs,
> errcode_t tunefs_install_dir_trailer(ocfs2_filesys *fs, struct
> ocfs2_dinode *di,
> struct tunefs_trailer_context *tc);
> void tunefs_trailer_context_free(struct tunefs_trailer_context *tc);
> +int tunefs_is_journal64(ocfs2_filesys *fs);
>
> #endif /* _LIBTUNEFS_H */
> diff --git a/tunefs.ocfs2/op_resize_volume.c b/tunefs.ocfs2/op_resize_volume.c
> index 1409c08..259dd1a 100644
> --- a/tunefs.ocfs2/op_resize_volume.c
> +++ b/tunefs.ocfs2/op_resize_volume.c
> @@ -514,6 +514,7 @@ static errcode_t check_new_size(ocfs2_filesys *fs,
> uint64_t new_size,
> int b_to_c_bits =
> OCFS2_RAW_SB(fs->fs_super)->s_clustersize_bits -
> OCFS2_RAW_SB(fs->fs_super)->s_blocksize_bits;
> + int block64 = tunefs_is_journal64(fs);
>
> if (new_size> max_bytes) {
> verbosef(VL_APP,
> @@ -578,7 +579,7 @@ static errcode_t check_new_size(ocfs2_filesys *fs,
> uint64_t new_size,
> return TUNEFS_ET_INVALID_NUMBER;
> }
>
> - if (try_blocks> UINT32_MAX) {
> + if (!block64&& (try_blocks> UINT32_MAX)) {
> verbosef(VL_APP,
> "Requested %"PRIu32" clusters (%"PRIu64" "
> "blocks)\n",
More information about the Ocfs2-tools-devel
mailing list