ocfs2: Replace deprecated strcpy with strscpy
PATCH 1/1 ocfs2: Replace deprecated strcpy with strscpy
strcpy() has been deprecated [1] because it performs no bounds checking on the destination buffer, which can lead to buffer overflows. Replace it with the safer strscpy(). No functional changes.
--- fs/ocfs2/alloc.c | 5 +++-- fs/ocfs2/cluster/nodemanager.c | 3 ++- fs/ocfs2/dir.c | 10 +++++----- fs/ocfs2/namei.c | 3 ++- fs/ocfs2/stackglue.c | 3 ++- fs/ocfs2/suballoc.c | 3 ++- 6 files changed, 16 insertions(+), 11 deletions(-)
fs/ocfs2/alloc.c +3 -2
@@ -10,6 +10,7 @@#include <linux/fs.h> #include <linux/types.h> #include <linux/slab.h> +#include <linux/string.h> #include <linux/highmem.h> #include <linux/swap.h> #include <linux/quotaops.h>
@@ -1037,7 +1038,7 @@ static int ocfs2_create_new_meta_bhs(handle_t *handle,memset (bhs[i]->b_data,0 , osb->sb->s_blocksize); eb = (struct ocfs2_extent_block *) bhs[i]->b_data;/* Ok, setup the minimal stuff here. */ -strcpy (eb->h_signature,OCFS2_EXTENT_BLOCK_SIGNATURE ); +strscpy (eb->h_signature,OCFS2_EXTENT_BLOCK_SIGNATURE ); eb->h_blkno =cpu_to_le64 (first_blkno); eb->h_fs_generation =cpu_to_le32 (osb->fs_generation); eb->h_suballoc_slot =
@@ -6744,7 +6745,7 @@ static int ocfs2_reuse_blk_from_dealloc(handle_t *handle,/* We can't guarantee that buffer head is still cached, so * polutlate the extent block again. */ -strcpy (eb->h_signature,OCFS2_EXTENT_BLOCK_SIGNATURE ); +strscpy (eb->h_signature,OCFS2_EXTENT_BLOCK_SIGNATURE ); eb->h_blkno =cpu_to_le64 (bf->free_blk); eb->h_fs_generation =cpu_to_le32 (osb->fs_generation); eb->h_suballoc_slot =cpu_to_le16 (real_slot);
fs/ocfs2/cluster/nodemanager.c +2 -1
@@ -4,6 +4,7 @@*/ #include <linux/slab.h> +#include <linux/string.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/configfs.h>
@@ -590,7 +591,7 @@ static struct config_item *o2nm_node_group_make_item(struct config_group *group,if (node ==NULL )return ERR_PTR (-ENOMEM ); -strcpy (node->nd_name, name);/* use item.ci_namebuf instead? */ +strscpy (node->nd_name, name);/* use item.ci_namebuf instead? */ config_item_init_type_name (&node->nd_item, name, &o2nm_node_type);spin_lock_init (&node->nd_lock);
fs/ocfs2/dir.c +5 -5
@@ -136,7 +136,7 @@ static void ocfs2_init_dir_trailer(struct inode *inode,struct ocfs2_dir_block_trailer *trailer; trailer =ocfs2_trailer_from_bh (bh, inode->i_sb); -strcpy (trailer->db_signature,OCFS2_DIR_TRAILER_SIGNATURE ); +strscpy (trailer->db_signature,OCFS2_DIR_TRAILER_SIGNATURE ); trailer->db_compat_rec_len =cpu_to_le16 (sizeof (struct ocfs2_dir_block_trailer )); trailer->db_parent_dinode =cpu_to_le64 (OCFS2_I (inode)->ip_blkno);
@@ -2192,14 +2192,14 @@ static struct ocfs2_dir_entry *ocfs2_fill_initial_dirents(struct inode *inode, de->name_len =1 ; de->rec_len =cpu_to_le16 (OCFS2_DIR_REC_LEN (de->name_len)); -strcpy (de->name,"." ); +strscpy (de->name,"." );ocfs2_set_de_type (de,S_IFDIR ); de = (struct ocfs2_dir_entry *) ((char *)de +le16_to_cpu (de->rec_len)); de->inode =cpu_to_le64 (OCFS2_I (parent)->ip_blkno); de->rec_len =cpu_to_le16 (size -OCFS2_DIR_REC_LEN (1 )); de->name_len =2 ; -strcpy (de->name,".." ); +strscpy (de->name,".." );ocfs2_set_de_type (de,S_IFDIR );return de;
@@ -2357,7 +2357,7 @@ static int ocfs2_dx_dir_attach_index(struct ocfs2_super *osb, dx_root = (struct ocfs2_dx_root_block *)dx_root_bh->b_data;memset (dx_root,0 , osb->sb->s_blocksize); -strcpy (dx_root->dr_signature,OCFS2_DX_ROOT_SIGNATURE ); +strscpy (dx_root->dr_signature,OCFS2_DX_ROOT_SIGNATURE ); dx_root->dr_suballoc_slot =cpu_to_le16 (meta_ac->ac_alloc_slot); dx_root->dr_suballoc_loc =cpu_to_le64 (suballoc_loc); dx_root->dr_suballoc_bit =cpu_to_le16 (dr_suballoc_bit);
@@ -2433,7 +2433,7 @@ static int ocfs2_dx_dir_format_cluster(struct ocfs2_super *osb, dx_leaf = (struct ocfs2_dx_leaf *) bh->b_data;memset (dx_leaf,0 , osb->sb->s_blocksize); -strcpy (dx_leaf->dl_signature,OCFS2_DX_LEAF_SIGNATURE ); +strscpy (dx_leaf->dl_signature,OCFS2_DX_LEAF_SIGNATURE ); dx_leaf->dl_fs_generation =cpu_to_le32 (osb->fs_generation); dx_leaf->dl_blkno =cpu_to_le64 (bh->b_blocknr); dx_leaf->dl_list.de_count =
fs/ocfs2/namei.c +2 -1
@@ -23,6 +23,7 @@#include <linux/fs.h> #include <linux/types.h> #include <linux/slab.h> +#include <linux/string.h> #include <linux/highmem.h> #include <linux/quotaops.h> #include <linux/iversion.h>
@@ -568,7 +569,7 @@ static int __ocfs2_mknod_locked(struct inode *dir,ocfs2_set_links_count (fe, inode->i_nlink); fe->i_last_eb_blk =0 ; -strcpy (fe->i_signature,OCFS2_INODE_SIGNATURE ); +strscpy (fe->i_signature,OCFS2_INODE_SIGNATURE ); fe->i_flags |=cpu_to_le32 (OCFS2_VALID_FL );ktime_get_coarse_real_ts64 (&ts); fe->i_atime = fe->i_ctime = fe->i_mtime =
fs/ocfs2/stackglue.c +2 -1
@@ -10,6 +10,7 @@#include <linux/list.h> #include <linux/spinlock.h> +#include <linux/string.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/kmod.h>
@@ -670,7 +671,7 @@ static int __init ocfs2_stack_glue_init(void) {int ret; -strcpy (cluster_stack_name,OCFS2_STACK_PLUGIN_O2CB ); +strscpy (cluster_stack_name,OCFS2_STACK_PLUGIN_O2CB ); ocfs2_table_header =register_sysctl ("fs/ocfs2/nm" , ocfs2_nm_table);if (!ocfs2_table_header) {
fs/ocfs2/suballoc.c +2 -1
@@ -11,6 +11,7 @@#include <linux/fs.h> #include <linux/types.h> #include <linux/slab.h> +#include <linux/string.h> #include <linux/highmem.h> #include <cluster/masklog.h>
@@ -372,7 +373,7 @@ static int ocfs2_block_group_fill(handle_t *handle, }memset (bg,0 , sb->s_blocksize); -strcpy (bg->bg_signature,OCFS2_GROUP_DESC_SIGNATURE ); +strscpy (bg->bg_signature,OCFS2_GROUP_DESC_SIGNATURE ); bg->bg_generation =cpu_to_le32 (osb->fs_generation); bg->bg_size =cpu_to_le16 (ocfs2_group_bitmap_size (sb,1 , osb->s_feature_incompat));
Signature · 2 lines
Thorsten Blum <[email protected]> GPG: 1D60 735E 8AEF 3BE4 73B6 9D84 7336 78FD 8DFE EAD4
Joseph Qi
maintainerQuoted 169 lines · Thorsten Blum
strcpy()has been deprecated [1] because it performs no bounds checking on the destination buffer, which can lead to buffer overflows. Replace it with the saferstrscpy(). No functional changes.Signed-off-by Thorsten Blum <[email protected]>--- fs/ocfs2/alloc.c | 5 +++-- fs/ocfs2/cluster/nodemanager.c | 3 ++- fs/ocfs2/dir.c | 10 +++++----- fs/ocfs2/namei.c | 3 ++- fs/ocfs2/stackglue.c | 3 ++- fs/ocfs2/suballoc.c | 3 ++- 6 files changed, 16 insertions(+), 11 deletions(-)fs/ocfs2/alloc.c +3
-2@@ -10,6 +10,7 @@#include <linux/fs.h> #include <linux/types.h> #include <linux/slab.h> +#include <linux/string.h> #include <linux/highmem.h> #include <linux/swap.h> #include <linux/quotaops.h> @@ -1037,7 +1038,7 @@ static int ocfs2_create_new_meta_bhs(handle_t *handle,memset (bhs[i]->b_data,0 , osb->sb->s_blocksize); eb = (struct ocfs2_extent_block *) bhs[i]->b_data;/* Ok, setup the minimal stuff here. */ -strcpy (eb->h_signature,OCFS2_EXTENT_BLOCK_SIGNATURE ); +strscpy (eb->h_signature,OCFS2_EXTENT_BLOCK_SIGNATURE ); eb->h_blkno =cpu_to_le64 (first_blkno); eb->h_fs_generation =cpu_to_le32 (osb->fs_generation); eb->h_suballoc_slot =@@ -6744,7 +6745,7 @@ static int ocfs2_reuse_blk_from_dealloc(handle_t *handle,/* We can't guarantee that buffer head is still cached, so * polutlate the extent block again. */ -strcpy (eb->h_signature,OCFS2_EXTENT_BLOCK_SIGNATURE ); +strscpy (eb->h_signature,OCFS2_EXTENT_BLOCK_SIGNATURE ); eb->h_blkno =cpu_to_le64 (bf->free_blk); eb->h_fs_generation =cpu_to_le32 (osb->fs_generation); eb->h_suballoc_slot =cpu_to_le16 (real_slot);fs/ocfs2/cluster/nodemanager.c +2
-1@@ -4,6 +4,7 @@*/ #include <linux/slab.h> +#include <linux/string.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/configfs.h> @@ -590,7 +591,7 @@ static struct config_item *o2nm_node_group_make_item(struct config_group *group,if (node ==NULL )return ERR_PTR (-ENOMEM ); -strcpy (node->nd_name, name);/* use item.ci_namebuf instead? */ +strscpy (node->nd_name, name);/* use item.ci_namebuf instead? */ config_item_init_type_name (&node->nd_item, name, &o2nm_node_type);spin_lock_init (&node->nd_lock);fs/ocfs2/dir.c +5
-5@@ -136,7 +136,7 @@ static void ocfs2_init_dir_trailer(struct inode *inode,struct ocfs2_dir_block_trailer *trailer; trailer =ocfs2_trailer_from_bh (bh, inode->i_sb); -strcpy (trailer->db_signature,OCFS2_DIR_TRAILER_SIGNATURE ); +strscpy (trailer->db_signature,OCFS2_DIR_TRAILER_SIGNATURE ); trailer->db_compat_rec_len =cpu_to_le16 (sizeof (struct ocfs2_dir_block_trailer )); trailer->db_parent_dinode =cpu_to_le64 (OCFS2_I (inode)->ip_blkno);@@ -2192,14 +2192,14 @@ static struct ocfs2_dir_entry *ocfs2_fill_initial_dirents(struct inode *inode, de->name_len =1 ; de->rec_len =cpu_to_le16 (OCFS2_DIR_REC_LEN (de->name_len)); -strcpy (de->name,"." ); +strscpy (de->name,"." );ocfs2_set_de_type (de,S_IFDIR ); de = (struct ocfs2_dir_entry *) ((char *)de +le16_to_cpu (de->rec_len)); de->inode =cpu_to_le64 (OCFS2_I (parent)->ip_blkno); de->rec_len =cpu_to_le16 (size -OCFS2_DIR_REC_LEN (1 )); de->name_len =2 ; -strcpy (de->name,".." ); +strscpy (de->name,".." );ocfs2_set_de_type (de,S_IFDIR );return de;@@ -2357,7 +2357,7 @@ static int ocfs2_dx_dir_attach_index(struct ocfs2_super *osb, dx_root = (struct ocfs2_dx_root_block *)dx_root_bh->b_data;memset (dx_root,0 , osb->sb->s_blocksize); -strcpy (dx_root->dr_signature,OCFS2_DX_ROOT_SIGNATURE ); +strscpy (dx_root->dr_signature,OCFS2_DX_ROOT_SIGNATURE ); dx_root->dr_suballoc_slot =cpu_to_le16 (meta_ac->ac_alloc_slot); dx_root->dr_suballoc_loc =cpu_to_le64 (suballoc_loc); dx_root->dr_suballoc_bit =cpu_to_le16 (dr_suballoc_bit);@@ -2433,7 +2433,7 @@ static int ocfs2_dx_dir_format_cluster(struct ocfs2_super *osb, dx_leaf = (struct ocfs2_dx_leaf *) bh->b_data;memset (dx_leaf,0 , osb->sb->s_blocksize); -strcpy (dx_leaf->dl_signature,OCFS2_DX_LEAF_SIGNATURE ); +strscpy (dx_leaf->dl_signature,OCFS2_DX_LEAF_SIGNATURE ); dx_leaf->dl_fs_generation =cpu_to_le32 (osb->fs_generation); dx_leaf->dl_blkno =cpu_to_le64 (bh->b_blocknr); dx_leaf->dl_list.de_count =fs/ocfs2/namei.c +2
-1@@ -23,6 +23,7 @@#include <linux/fs.h> #include <linux/types.h> #include <linux/slab.h> +#include <linux/string.h> #include <linux/highmem.h> #include <linux/quotaops.h> #include <linux/iversion.h> @@ -568,7 +569,7 @@ static int __ocfs2_mknod_locked(struct inode *dir,ocfs2_set_links_count (fe, inode->i_nlink); fe->i_last_eb_blk =0 ; -strcpy (fe->i_signature,OCFS2_INODE_SIGNATURE ); +strscpy (fe->i_signature,OCFS2_INODE_SIGNATURE ); fe->i_flags |=cpu_to_le32 (OCFS2_VALID_FL );ktime_get_coarse_real_ts64 (&ts); fe->i_atime = fe->i_ctime = fe->i_mtime =fs/ocfs2/stackglue.c +2
-1@@ -10,6 +10,7 @@#include <linux/list.h> #include <linux/spinlock.h> +#include <linux/string.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/kmod.h> @@ -670,7 +671,7 @@ static int __init ocfs2_stack_glue_init(void) {int ret; -strcpy (cluster_stack_name,OCFS2_STACK_PLUGIN_O2CB ); +strscpy (cluster_stack_name,OCFS2_STACK_PLUGIN_O2CB ); ocfs2_table_header =register_sysctl ("fs/ocfs2/nm" , ocfs2_nm_table);if (!ocfs2_table_header) {fs/ocfs2/suballoc.c +1
-0@@ -11,6 +11,7 @@#include <linux/fs.h> #include <linux/types.h> #include <linux/slab.h> +#include <linux/string.h> #include <linux/highmem.h> #include <cluster/masklog.h>
fs/ocfs2/suballoc.c static int ocfs2_block_group_fill(handle_t *handle, · line 379
Quoted 8 lines
fs/ocfs2/suballoc.c +1
-1@@ -372,7 +373,7 @@ static int ocfs2_block_group_fill(handle_t *handle, }memset (bg,0 , sb->s_blocksize); -strcpy (bg->bg_signature,OCFS2_GROUP_DESC_SIGNATURE ); +strscpy (bg->bg_signature,OCFS2_GROUP_DESC_SIGNATURE ); bg->bg_generation =cpu_to_le32 (osb->fs_generation); bg->bg_size =cpu_to_le16 (ocfs2_group_bitmap_size (sb,1 , osb->s_feature_incompat));
It seems that all 'include' above are not needed.
Thanks,
Joseph
Quoted 11 lines · Joseph Qi
Quoted 8 lines · Thorsten Blum
strcpy()has been deprecated [1] because it performs no bounds checking on the destination buffer, which can lead to buffer overflows. Replace it with the saferstrscpy(). No functional changes.Signed-off-by Thorsten Blum <[email protected]>---
[...]It seems that all 'include' above are not needed.
They might not be necessary for the code to compile, but I think it's recommended to add the headers to make the relationship explicit.
Thanks,
Thorsten
Quoted 6 lines · Thorsten Blum
strcpy()has been deprecated [1] because it performs no bounds checking on the destination buffer, which can lead to buffer overflows. Replace it with the saferstrscpy(). No functional changes.
Quoted 171 lines
--- fs/ocfs2/alloc.c | 5 +++-- fs/ocfs2/cluster/nodemanager.c | 3 ++- fs/ocfs2/dir.c | 10 +++++----- fs/ocfs2/namei.c | 3 ++- fs/ocfs2/stackglue.c | 3 ++- fs/ocfs2/suballoc.c | 3 ++- 6 files changed, 16 insertions(+), 11 deletions(-)fs/ocfs2/alloc.c +3
-2@@ -10,6 +10,7 @@#include <linux/fs.h> #include <linux/types.h> #include <linux/slab.h> +#include <linux/string.h> #include <linux/highmem.h> #include <linux/swap.h> #include <linux/quotaops.h> @@ -1037,7 +1038,7 @@ static int ocfs2_create_new_meta_bhs(handle_t *handle,memset (bhs[i]->b_data,0 , osb->sb->s_blocksize); eb = (struct ocfs2_extent_block *) bhs[i]->b_data;/* Ok, setup the minimal stuff here. */ -strcpy (eb->h_signature,OCFS2_EXTENT_BLOCK_SIGNATURE ); +strscpy (eb->h_signature,OCFS2_EXTENT_BLOCK_SIGNATURE ); eb->h_blkno =cpu_to_le64 (first_blkno); eb->h_fs_generation =cpu_to_le32 (osb->fs_generation); eb->h_suballoc_slot =@@ -6744,7 +6745,7 @@ static int ocfs2_reuse_blk_from_dealloc(handle_t *handle,/* We can't guarantee that buffer head is still cached, so * polutlate the extent block again. */ -strcpy (eb->h_signature,OCFS2_EXTENT_BLOCK_SIGNATURE ); +strscpy (eb->h_signature,OCFS2_EXTENT_BLOCK_SIGNATURE ); eb->h_blkno =cpu_to_le64 (bf->free_blk); eb->h_fs_generation =cpu_to_le32 (osb->fs_generation); eb->h_suballoc_slot =cpu_to_le16 (real_slot);fs/ocfs2/cluster/nodemanager.c +2
-1@@ -4,6 +4,7 @@*/ #include <linux/slab.h> +#include <linux/string.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/configfs.h> @@ -590,7 +591,7 @@ static struct config_item *o2nm_node_group_make_item(struct config_group *group,if (node ==NULL )return ERR_PTR (-ENOMEM ); -strcpy (node->nd_name, name);/* use item.ci_namebuf instead? */ +strscpy (node->nd_name, name);/* use item.ci_namebuf instead? */ config_item_init_type_name (&node->nd_item, name, &o2nm_node_type);spin_lock_init (&node->nd_lock);fs/ocfs2/dir.c +5
-5@@ -136,7 +136,7 @@ static void ocfs2_init_dir_trailer(struct inode *inode,struct ocfs2_dir_block_trailer *trailer; trailer =ocfs2_trailer_from_bh (bh, inode->i_sb); -strcpy (trailer->db_signature,OCFS2_DIR_TRAILER_SIGNATURE ); +strscpy (trailer->db_signature,OCFS2_DIR_TRAILER_SIGNATURE ); trailer->db_compat_rec_len =cpu_to_le16 (sizeof (struct ocfs2_dir_block_trailer )); trailer->db_parent_dinode =cpu_to_le64 (OCFS2_I (inode)->ip_blkno);@@ -2192,14 +2192,14 @@ static struct ocfs2_dir_entry *ocfs2_fill_initial_dirents(struct inode *inode, de->name_len =1 ; de->rec_len =cpu_to_le16 (OCFS2_DIR_REC_LEN (de->name_len)); -strcpy (de->name,"." ); +strscpy (de->name,"." );ocfs2_set_de_type (de,S_IFDIR ); de = (struct ocfs2_dir_entry *) ((char *)de +le16_to_cpu (de->rec_len)); de->inode =cpu_to_le64 (OCFS2_I (parent)->ip_blkno); de->rec_len =cpu_to_le16 (size -OCFS2_DIR_REC_LEN (1 )); de->name_len =2 ; -strcpy (de->name,".." ); +strscpy (de->name,".." );ocfs2_set_de_type (de,S_IFDIR );return de;@@ -2357,7 +2357,7 @@ static int ocfs2_dx_dir_attach_index(struct ocfs2_super *osb, dx_root = (struct ocfs2_dx_root_block *)dx_root_bh->b_data;memset (dx_root,0 , osb->sb->s_blocksize); -strcpy (dx_root->dr_signature,OCFS2_DX_ROOT_SIGNATURE ); +strscpy (dx_root->dr_signature,OCFS2_DX_ROOT_SIGNATURE ); dx_root->dr_suballoc_slot =cpu_to_le16 (meta_ac->ac_alloc_slot); dx_root->dr_suballoc_loc =cpu_to_le64 (suballoc_loc); dx_root->dr_suballoc_bit =cpu_to_le16 (dr_suballoc_bit);@@ -2433,7 +2433,7 @@ static int ocfs2_dx_dir_format_cluster(struct ocfs2_super *osb, dx_leaf = (struct ocfs2_dx_leaf *) bh->b_data;memset (dx_leaf,0 , osb->sb->s_blocksize); -strcpy (dx_leaf->dl_signature,OCFS2_DX_LEAF_SIGNATURE ); +strscpy (dx_leaf->dl_signature,OCFS2_DX_LEAF_SIGNATURE ); dx_leaf->dl_fs_generation =cpu_to_le32 (osb->fs_generation); dx_leaf->dl_blkno =cpu_to_le64 (bh->b_blocknr); dx_leaf->dl_list.de_count =fs/ocfs2/namei.c +2
-1@@ -23,6 +23,7 @@#include <linux/fs.h> #include <linux/types.h> #include <linux/slab.h> +#include <linux/string.h> #include <linux/highmem.h> #include <linux/quotaops.h> #include <linux/iversion.h> @@ -568,7 +569,7 @@ static int __ocfs2_mknod_locked(struct inode *dir,ocfs2_set_links_count (fe, inode->i_nlink); fe->i_last_eb_blk =0 ; -strcpy (fe->i_signature,OCFS2_INODE_SIGNATURE ); +strscpy (fe->i_signature,OCFS2_INODE_SIGNATURE ); fe->i_flags |=cpu_to_le32 (OCFS2_VALID_FL );ktime_get_coarse_real_ts64 (&ts); fe->i_atime = fe->i_ctime = fe->i_mtime =fs/ocfs2/stackglue.c +2
-1@@ -10,6 +10,7 @@#include <linux/list.h> #include <linux/spinlock.h> +#include <linux/string.h> #include <linux/module.h> #include <linux/slab.h> #include <linux/kmod.h> @@ -670,7 +671,7 @@ static int __init ocfs2_stack_glue_init(void) {int ret; -strcpy (cluster_stack_name,OCFS2_STACK_PLUGIN_O2CB ); +strscpy (cluster_stack_name,OCFS2_STACK_PLUGIN_O2CB ); ocfs2_table_header =register_sysctl ("fs/ocfs2/nm" , ocfs2_nm_table);if (!ocfs2_table_header) {fs/ocfs2/suballoc.c +2
-1@@ -11,6 +11,7 @@#include <linux/fs.h> #include <linux/types.h> #include <linux/slab.h> +#include <linux/string.h> #include <linux/highmem.h> #include <cluster/masklog.h> @@ -372,7 +373,7 @@ static int ocfs2_block_group_fill(handle_t *handle, }memset (bg,0 , sb->s_blocksize); -strcpy (bg->bg_signature,OCFS2_GROUP_DESC_SIGNATURE ); +strscpy (bg->bg_signature,OCFS2_GROUP_DESC_SIGNATURE ); bg->bg_generation =cpu_to_le32 (osb->fs_generation); bg->bg_size =cpu_to_le16 (ocfs2_group_bitmap_size (sb,1 , osb->s_feature_incompat));