alloc.c (a45ff5994c9cde41af627c46abb9f32beae68943) | alloc.c (d8b2fa657deaa73ff70d40aea9a54997fc0c7fc9) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-or-later 2/* -*- mode: c; c-basic-offset: 8; -*- 3 * vim: noexpandtab sw=8 ts=8 sts=0: 4 * 5 * alloc.c 6 * 7 * Extent allocs and frees 8 * --- 6177 unchanged lines hidden (view full) --- 6186 * validated by the underlying call to ocfs2_read_inode_block(), 6187 * so any corruption is a code bug */ 6188 BUG_ON(!OCFS2_IS_VALID_DINODE(di)); 6189 6190 tl = &di->id2.i_dealloc; 6191 if (le16_to_cpu(tl->tl_used)) { 6192 trace_ocfs2_truncate_log_recovery_num(le16_to_cpu(tl->tl_used)); 6193 | 1// SPDX-License-Identifier: GPL-2.0-or-later 2/* -*- mode: c; c-basic-offset: 8; -*- 3 * vim: noexpandtab sw=8 ts=8 sts=0: 4 * 5 * alloc.c 6 * 7 * Extent allocs and frees 8 * --- 6177 unchanged lines hidden (view full) --- 6186 * validated by the underlying call to ocfs2_read_inode_block(), 6187 * so any corruption is a code bug */ 6188 BUG_ON(!OCFS2_IS_VALID_DINODE(di)); 6189 6190 tl = &di->id2.i_dealloc; 6191 if (le16_to_cpu(tl->tl_used)) { 6192 trace_ocfs2_truncate_log_recovery_num(le16_to_cpu(tl->tl_used)); 6193 |
6194 *tl_copy = kmalloc(tl_bh->b_size, GFP_KERNEL); | 6194 /* 6195 * Assuming the write-out below goes well, this copy will be 6196 * passed back to recovery for processing. 6197 */ 6198 *tl_copy = kmemdup(tl_bh->b_data, tl_bh->b_size, GFP_KERNEL); |
6195 if (!(*tl_copy)) { 6196 status = -ENOMEM; 6197 mlog_errno(status); 6198 goto bail; 6199 } 6200 | 6199 if (!(*tl_copy)) { 6200 status = -ENOMEM; 6201 mlog_errno(status); 6202 goto bail; 6203 } 6204 |
6201 /* Assuming the write-out below goes well, this copy 6202 * will be passed back to recovery for processing. */ 6203 memcpy(*tl_copy, tl_bh->b_data, tl_bh->b_size); 6204 | |
6205 /* All we need to do to clear the truncate log is set 6206 * tl_used. */ 6207 tl->tl_used = 0; 6208 6209 ocfs2_compute_meta_ecc(osb->sb, tl_bh->b_data, &di->i_check); 6210 status = ocfs2_write_block(osb, tl_bh, INODE_CACHE(tl_inode)); 6211 if (status < 0) { 6212 mlog_errno(status); --- 1486 unchanged lines hidden --- | 6205 /* All we need to do to clear the truncate log is set 6206 * tl_used. */ 6207 tl->tl_used = 0; 6208 6209 ocfs2_compute_meta_ecc(osb->sb, tl_bh->b_data, &di->i_check); 6210 status = ocfs2_write_block(osb, tl_bh, INODE_CACHE(tl_inode)); 6211 if (status < 0) { 6212 mlog_errno(status); --- 1486 unchanged lines hidden --- |