Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
ab9d1e4f
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
ab9d1e4f
编写于
3月 09, 2016
作者:
D
Dave Chinner
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'xfs-misc-fixes-4.6-3' into for-next
上级
3c1a79f5
a5fd276b
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
204 addition
and
79 deletion
+204
-79
fs/xfs/libxfs/xfs_bmap.c
fs/xfs/libxfs/xfs_bmap.c
+1
-4
fs/xfs/libxfs/xfs_ialloc.c
fs/xfs/libxfs/xfs_ialloc.c
+2
-2
fs/xfs/xfs_log.c
fs/xfs/xfs_log.c
+68
-64
fs/xfs/xfs_log_recover.c
fs/xfs/xfs_log_recover.c
+13
-9
fs/xfs/xfs_ondisk.h
fs/xfs/xfs_ondisk.h
+117
-0
fs/xfs/xfs_super.c
fs/xfs/xfs_super.c
+3
-0
未找到文件。
fs/xfs/libxfs/xfs_bmap.c
浏览文件 @
ab9d1e4f
...
...
@@ -477,10 +477,7 @@ xfs_bmap_check_leaf_extents(
}
block
=
XFS_BUF_TO_BLOCK
(
bp
);
}
if
(
bp_release
)
{
bp_release
=
0
;
xfs_trans_brelse
(
NULL
,
bp
);
}
return
;
error0:
...
...
fs/xfs/libxfs/xfs_ialloc.c
浏览文件 @
ab9d1e4f
...
...
@@ -2403,8 +2403,8 @@ xfs_ialloc_compute_maxlevels(
maxleafents
=
(
1LL
<<
XFS_INO_AGINO_BITS
(
mp
))
>>
XFS_INODES_PER_CHUNK_LOG
;
minleafrecs
=
mp
->
m_
alloc
_mnr
[
0
];
minnoderecs
=
mp
->
m_
alloc
_mnr
[
1
];
minleafrecs
=
mp
->
m_
inobt
_mnr
[
0
];
minnoderecs
=
mp
->
m_
inobt
_mnr
[
1
];
maxblocks
=
(
maxleafents
+
minleafrecs
-
1
)
/
minleafrecs
;
for
(
level
=
1
;
maxblocks
>
1
;
level
++
)
maxblocks
=
(
maxblocks
+
minnoderecs
-
1
)
/
minnoderecs
;
...
...
fs/xfs/xfs_log.c
浏览文件 @
ab9d1e4f
...
...
@@ -2008,77 +2008,81 @@ xlog_print_tic_res(
uint
ophdr_spc
=
ticket
->
t_res_num_ophdrs
*
(
uint
)
sizeof
(
xlog_op_header_t
);
/* match with XLOG_REG_TYPE_* in xfs_log.h */
static
char
*
res_type_str
[
XLOG_REG_TYPE_MAX
]
=
{
"bformat"
,
"bchunk"
,
"efi_format"
,
"efd_format"
,
"iformat"
,
"icore"
,
"iext"
,
"ibroot"
,
"ilocal"
,
"iattr_ext"
,
"iattr_broot"
,
"iattr_local"
,
"qformat"
,
"dquot"
,
"quotaoff"
,
"LR header"
,
"unmount"
,
"commit"
,
"trans header"
#define REG_TYPE_STR(type, str) [XLOG_REG_TYPE_##type] = str
static
char
*
res_type_str
[
XLOG_REG_TYPE_MAX
+
1
]
=
{
REG_TYPE_STR
(
BFORMAT
,
"bformat"
),
REG_TYPE_STR
(
BCHUNK
,
"bchunk"
),
REG_TYPE_STR
(
EFI_FORMAT
,
"efi_format"
),
REG_TYPE_STR
(
EFD_FORMAT
,
"efd_format"
),
REG_TYPE_STR
(
IFORMAT
,
"iformat"
),
REG_TYPE_STR
(
ICORE
,
"icore"
),
REG_TYPE_STR
(
IEXT
,
"iext"
),
REG_TYPE_STR
(
IBROOT
,
"ibroot"
),
REG_TYPE_STR
(
ILOCAL
,
"ilocal"
),
REG_TYPE_STR
(
IATTR_EXT
,
"iattr_ext"
),
REG_TYPE_STR
(
IATTR_BROOT
,
"iattr_broot"
),
REG_TYPE_STR
(
IATTR_LOCAL
,
"iattr_local"
),
REG_TYPE_STR
(
QFORMAT
,
"qformat"
),
REG_TYPE_STR
(
DQUOT
,
"dquot"
),
REG_TYPE_STR
(
QUOTAOFF
,
"quotaoff"
),
REG_TYPE_STR
(
LRHEADER
,
"LR header"
),
REG_TYPE_STR
(
UNMOUNT
,
"unmount"
),
REG_TYPE_STR
(
COMMIT
,
"commit"
),
REG_TYPE_STR
(
TRANSHDR
,
"trans header"
),
REG_TYPE_STR
(
ICREATE
,
"inode create"
)
};
#undef REG_TYPE_STR
#define TRANS_TYPE_STR(type) [XFS_TRANS_##type] = #type
static
char
*
trans_type_str
[
XFS_TRANS_TYPE_MAX
]
=
{
"SETATTR_NOT_SIZE"
,
"SETATTR_SIZE"
,
"INACTIVE"
,
"CREATE"
,
"CREATE_TRUNC"
,
"TRUNCATE_FILE"
,
"REMOVE"
,
"LINK"
,
"RENAME"
,
"MKDIR"
,
"RMDIR"
,
"SYMLINK"
,
"SET_DMATTRS"
,
"GROWFS"
,
"STRAT_WRITE"
,
"DIOSTRAT"
,
"WRITE_SYNC"
,
"WRITEID"
,
"ADDAFORK"
,
"ATTRINVAL"
,
"ATRUNCATE"
,
"ATTR_SET"
,
"ATTR_RM"
,
"ATTR_FLAG"
,
"CLEAR_AGI_BUCKET"
,
"QM_SBCHANGE"
,
"DUMMY1"
,
"DUMMY2"
,
"QM_QUOTAOFF"
,
"QM_DQALLOC"
,
"QM_SETQLIM"
,
"QM_DQCLUSTER"
,
"QM_QINOCREATE"
,
"QM_QUOTAOFF_END"
,
"FSYNC_TS"
,
"GROWFSRT_ALLOC"
,
"GROWFSRT_ZERO"
,
"GROWFSRT_FREE"
,
"SWAPEXT"
,
"CHECKPOINT"
,
"ICREATE"
,
"CREATE_TMPFILE"
TRANS_TYPE_STR
(
SETATTR_NOT_SIZE
),
TRANS_TYPE_STR
(
SETATTR_SIZE
),
TRANS_TYPE_STR
(
INACTIVE
),
TRANS_TYPE_STR
(
CREATE
),
TRANS_TYPE_STR
(
CREATE_TRUNC
),
TRANS_TYPE_STR
(
TRUNCATE_FILE
),
TRANS_TYPE_STR
(
REMOVE
),
TRANS_TYPE_STR
(
LINK
),
TRANS_TYPE_STR
(
RENAME
),
TRANS_TYPE_STR
(
MKDIR
),
TRANS_TYPE_STR
(
RMDIR
),
TRANS_TYPE_STR
(
SYMLINK
),
TRANS_TYPE_STR
(
SET_DMATTRS
),
TRANS_TYPE_STR
(
GROWFS
),
TRANS_TYPE_STR
(
STRAT_WRITE
),
TRANS_TYPE_STR
(
DIOSTRAT
),
TRANS_TYPE_STR
(
WRITEID
),
TRANS_TYPE_STR
(
ADDAFORK
),
TRANS_TYPE_STR
(
ATTRINVAL
),
TRANS_TYPE_STR
(
ATRUNCATE
),
TRANS_TYPE_STR
(
ATTR_SET
),
TRANS_TYPE_STR
(
ATTR_RM
),
TRANS_TYPE_STR
(
ATTR_FLAG
),
TRANS_TYPE_STR
(
CLEAR_AGI_BUCKET
),
TRANS_TYPE_STR
(
SB_CHANGE
),
TRANS_TYPE_STR
(
DUMMY1
),
TRANS_TYPE_STR
(
DUMMY2
),
TRANS_TYPE_STR
(
QM_QUOTAOFF
),
TRANS_TYPE_STR
(
QM_DQALLOC
),
TRANS_TYPE_STR
(
QM_SETQLIM
),
TRANS_TYPE_STR
(
QM_DQCLUSTER
),
TRANS_TYPE_STR
(
QM_QINOCREATE
),
TRANS_TYPE_STR
(
QM_QUOTAOFF_END
),
TRANS_TYPE_STR
(
FSYNC_TS
),
TRANS_TYPE_STR
(
GROWFSRT_ALLOC
),
TRANS_TYPE_STR
(
GROWFSRT_ZERO
),
TRANS_TYPE_STR
(
GROWFSRT_FREE
),
TRANS_TYPE_STR
(
SWAPEXT
),
TRANS_TYPE_STR
(
CHECKPOINT
),
TRANS_TYPE_STR
(
ICREATE
),
TRANS_TYPE_STR
(
CREATE_TMPFILE
)
};
#undef TRANS_TYPE_STR
xfs_warn
(
mp
,
"xlog_write: reservation summary:"
);
xfs_warn
(
mp
,
" trans type = %s (%u)"
,
((
ticket
->
t_trans_type
<=
0
||
ticket
->
t_trans_type
>
XFS_TRANS_TYPE_MAX
)
?
"bad-trans-type"
:
trans_type_str
[
ticket
->
t_trans_type
-
1
]),
"bad-trans-type"
:
trans_type_str
[
ticket
->
t_trans_type
]),
ticket
->
t_trans_type
);
xfs_warn
(
mp
,
" unit res = %d bytes"
,
ticket
->
t_unit_res
);
...
...
@@ -2097,7 +2101,7 @@ xlog_print_tic_res(
uint
r_type
=
ticket
->
t_res_arr
[
i
].
r_type
;
xfs_warn
(
mp
,
"region[%u]: %s - %u bytes"
,
i
,
((
r_type
<=
0
||
r_type
>
XLOG_REG_TYPE_MAX
)
?
"bad-rtype"
:
res_type_str
[
r_type
-
1
]),
"bad-rtype"
:
res_type_str
[
r_type
]),
ticket
->
t_res_arr
[
i
].
r_len
);
}
...
...
fs/xfs/xfs_log_recover.c
浏览文件 @
ab9d1e4f
...
...
@@ -4963,6 +4963,7 @@ xlog_do_recover(
xfs_daddr_t
head_blk
,
xfs_daddr_t
tail_blk
)
{
struct
xfs_mount
*
mp
=
log
->
l_mp
;
int
error
;
xfs_buf_t
*
bp
;
xfs_sb_t
*
sbp
;
...
...
@@ -4977,7 +4978,7 @@ xlog_do_recover(
/*
* If IO errors happened during recovery, bail out.
*/
if
(
XFS_FORCED_SHUTDOWN
(
log
->
l_
mp
))
{
if
(
XFS_FORCED_SHUTDOWN
(
mp
))
{
return
-
EIO
;
}
...
...
@@ -4990,13 +4991,13 @@ xlog_do_recover(
* or iunlinks they will have some entries in the AIL; so we look at
* the AIL to determine how to set the tail_lsn.
*/
xlog_assign_tail_lsn
(
log
->
l_
mp
);
xlog_assign_tail_lsn
(
mp
);
/*
* Now that we've finished replaying all buffer and inode
* updates, re-read in the superblock and reverify it.
*/
bp
=
xfs_getsb
(
log
->
l_
mp
,
0
);
bp
=
xfs_getsb
(
mp
,
0
);
bp
->
b_flags
&=
~
(
XBF_DONE
|
XBF_ASYNC
);
ASSERT
(
!
(
bp
->
b_flags
&
XBF_WRITE
));
bp
->
b_flags
|=
XBF_READ
;
...
...
@@ -5004,7 +5005,7 @@ xlog_do_recover(
error
=
xfs_buf_submit_wait
(
bp
);
if
(
error
)
{
if
(
!
XFS_FORCED_SHUTDOWN
(
log
->
l_
mp
))
{
if
(
!
XFS_FORCED_SHUTDOWN
(
mp
))
{
xfs_buf_ioerror_alert
(
bp
,
__func__
);
ASSERT
(
0
);
}
...
...
@@ -5013,14 +5014,17 @@ xlog_do_recover(
}
/* Convert superblock from on-disk format */
sbp
=
&
log
->
l_
mp
->
m_sb
;
sbp
=
&
mp
->
m_sb
;
xfs_sb_from_disk
(
sbp
,
XFS_BUF_TO_SBP
(
bp
));
ASSERT
(
sbp
->
sb_magicnum
==
XFS_SB_MAGIC
);
ASSERT
(
xfs_sb_good_version
(
sbp
));
xfs_reinit_percpu_counters
(
log
->
l_mp
);
xfs_buf_relse
(
bp
);
/* re-initialise in-core superblock and geometry structures */
xfs_reinit_percpu_counters
(
mp
);
error
=
xfs_initialize_perag
(
mp
,
sbp
->
sb_agcount
,
&
mp
->
m_maxagi
);
if
(
error
)
{
xfs_warn
(
mp
,
"Failed post-recovery per-ag init: %d"
,
error
);
return
error
;
}
xlog_recover_check_summary
(
log
);
...
...
fs/xfs/xfs_ondisk.h
0 → 100644
浏览文件 @
ab9d1e4f
/*
* Copyright (c) 2016 Oracle.
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it would be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __XFS_ONDISK_H
#define __XFS_ONDISK_H
#define XFS_CHECK_STRUCT_SIZE(structname, size) \
BUILD_BUG_ON_MSG(sizeof(structname) != (size), "XFS: sizeof(" \
#structname ") is wrong, expected " #size)
static
inline
void
__init
xfs_check_ondisk_structs
(
void
)
{
/* ag/file structures */
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_acl
,
4
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_acl_entry
,
12
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_agf
,
224
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_agfl
,
36
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_agi
,
336
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_bmbt_key
,
8
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_bmbt_rec
,
16
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_bmdr_block
,
4
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_btree_block
,
72
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_dinode
,
176
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_disk_dquot
,
104
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_dqblk
,
136
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_dsb
,
264
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_dsymlink_hdr
,
56
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_inobt_key
,
4
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_inobt_rec
,
16
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_timestamp
,
8
);
XFS_CHECK_STRUCT_SIZE
(
xfs_alloc_key_t
,
8
);
XFS_CHECK_STRUCT_SIZE
(
xfs_alloc_ptr_t
,
4
);
XFS_CHECK_STRUCT_SIZE
(
xfs_alloc_rec_t
,
8
);
XFS_CHECK_STRUCT_SIZE
(
xfs_inobt_ptr_t
,
4
);
/* dir/attr trees */
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_attr3_leaf_hdr
,
80
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_attr3_leafblock
,
88
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_attr3_rmt_hdr
,
56
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_da3_blkinfo
,
56
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_da3_intnode
,
64
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_da3_node_hdr
,
64
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_dir3_blk_hdr
,
48
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_dir3_data_hdr
,
64
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_dir3_free
,
64
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_dir3_free_hdr
,
64
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_dir3_leaf
,
64
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_dir3_leaf_hdr
,
64
);
XFS_CHECK_STRUCT_SIZE
(
xfs_attr_leaf_entry_t
,
8
);
XFS_CHECK_STRUCT_SIZE
(
xfs_attr_leaf_hdr_t
,
32
);
XFS_CHECK_STRUCT_SIZE
(
xfs_attr_leaf_map_t
,
4
);
XFS_CHECK_STRUCT_SIZE
(
xfs_attr_leaf_name_local_t
,
4
);
/*
* m68k has problems with xfs_attr_leaf_name_remote_t, but we pad it to
* 4 bytes anyway so it's not obviously a problem. Hence for the moment
* we don't check this structure. This can be re-instated when the attr
* definitions are updated to use c99 VLA definitions.
*
XFS_CHECK_STRUCT_SIZE(xfs_attr_leaf_name_remote_t, 12);
*/
XFS_CHECK_STRUCT_SIZE
(
xfs_attr_leafblock_t
,
40
);
XFS_CHECK_STRUCT_SIZE
(
xfs_attr_shortform_t
,
8
);
XFS_CHECK_STRUCT_SIZE
(
xfs_da_blkinfo_t
,
12
);
XFS_CHECK_STRUCT_SIZE
(
xfs_da_intnode_t
,
16
);
XFS_CHECK_STRUCT_SIZE
(
xfs_da_node_entry_t
,
8
);
XFS_CHECK_STRUCT_SIZE
(
xfs_da_node_hdr_t
,
16
);
XFS_CHECK_STRUCT_SIZE
(
xfs_dir2_data_free_t
,
4
);
XFS_CHECK_STRUCT_SIZE
(
xfs_dir2_data_hdr_t
,
16
);
XFS_CHECK_STRUCT_SIZE
(
xfs_dir2_data_unused_t
,
6
);
XFS_CHECK_STRUCT_SIZE
(
xfs_dir2_free_hdr_t
,
16
);
XFS_CHECK_STRUCT_SIZE
(
xfs_dir2_free_t
,
16
);
XFS_CHECK_STRUCT_SIZE
(
xfs_dir2_ino4_t
,
4
);
XFS_CHECK_STRUCT_SIZE
(
xfs_dir2_ino8_t
,
8
);
XFS_CHECK_STRUCT_SIZE
(
xfs_dir2_inou_t
,
8
);
XFS_CHECK_STRUCT_SIZE
(
xfs_dir2_leaf_entry_t
,
8
);
XFS_CHECK_STRUCT_SIZE
(
xfs_dir2_leaf_hdr_t
,
16
);
XFS_CHECK_STRUCT_SIZE
(
xfs_dir2_leaf_t
,
16
);
XFS_CHECK_STRUCT_SIZE
(
xfs_dir2_leaf_tail_t
,
4
);
XFS_CHECK_STRUCT_SIZE
(
xfs_dir2_sf_entry_t
,
3
);
XFS_CHECK_STRUCT_SIZE
(
xfs_dir2_sf_hdr_t
,
10
);
XFS_CHECK_STRUCT_SIZE
(
xfs_dir2_sf_off_t
,
2
);
/* log structures */
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_dq_logformat
,
24
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_efd_log_format_32
,
28
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_efd_log_format_64
,
32
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_efi_log_format_32
,
28
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_efi_log_format_64
,
32
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_extent_32
,
12
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_extent_64
,
16
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_log_dinode
,
176
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_icreate_log
,
28
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_ictimestamp
,
8
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_inode_log_format_32
,
52
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_inode_log_format_64
,
56
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_qoff_logformat
,
20
);
XFS_CHECK_STRUCT_SIZE
(
struct
xfs_trans_header
,
16
);
}
#endif
/* __XFS_ONDISK_H */
fs/xfs/xfs_super.c
浏览文件 @
ab9d1e4f
...
...
@@ -45,6 +45,7 @@
#include "xfs_filestream.h"
#include "xfs_quota.h"
#include "xfs_sysfs.h"
#include "xfs_ondisk.h"
#include <linux/namei.h>
#include <linux/init.h>
...
...
@@ -1858,6 +1859,8 @@ init_xfs_fs(void)
{
int
error
;
xfs_check_ondisk_structs
();
printk
(
KERN_INFO
XFS_VERSION_STRING
" with "
XFS_BUILD_OPTIONS
" enabled
\n
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录