Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
66129f88
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看板
提交
66129f88
编写于
11月 11, 2004
作者:
A
Anton Altaparmakov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NTFS: Use i_size_read() in fs/ntfs/logfile.c::ntfs_{check,empty}_logfile().
Signed-off-by:
N
Anton Altaparmakov
<
aia21@cantab.net
>
上级
da28438c
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
15 addition
and
15 deletion
+15
-15
fs/ntfs/ChangeLog
fs/ntfs/ChangeLog
+12
-13
fs/ntfs/logfile.c
fs/ntfs/logfile.c
+3
-2
未找到文件。
fs/ntfs/ChangeLog
浏览文件 @
66129f88
...
@@ -2,20 +2,18 @@ ToDo/Notes:
...
@@ -2,20 +2,18 @@ ToDo/Notes:
- Find and fix bugs.
- Find and fix bugs.
- Checkpoint or disable the user space journal ($UsnJrnl).
- Checkpoint or disable the user space journal ($UsnJrnl).
- In between ntfs_prepare/commit_write, need exclusion between
- In between ntfs_prepare/commit_write, need exclusion between
simultaneous file extensions.
Need perhaps an NInoResizeUnderway()
simultaneous file extensions.
This is given to us by holding i_sem
flag which we can set in ntfs_prepare_write() and clear again in
on the inode. The only places in the kernel when a file is resized
ntfs_commit_write(). Just have to be careful in readpage/writepage,
are prepare/commit write and truncate for both of which i_sem is
as well as in truncate, that we play nice... We might need to have
held. Just have to be careful in readpage/writepage and all other
a data_size field in the ntfs_inode to store the real attribute
helpers not running under i_sem that we play nice...
length.
Also need to be careful with initialized_size extention in
Also need to be careful with initialized_size extention in
ntfs_prepare_write. Basically, just be _very_ careful in this code...
ntfs_prepare_write. Basically, just be _very_ careful in this code...
OTOH, perhaps i_sem, which is held accross generic_file_write is
UPDATE: The only things that need to be checked are read/writepage
sufficient for synchronisation here. We then just need to make sure
which do not hold i_sem. Note writepage cannot change i_size but it
ntfs_readpage/writepage/truncate interoperate properly with us.
needs to cope with a concurrent i_size change, just like readpage.
UPDATE: The above is all ok as it is due to i_sem held. The only
Also both need to cope with concurrent changes to the other sizes,
thing that needs to be checked is ntfs_writepage() which does not
i.e. initialized/allocated/compressed size, as well.
hold i_sem. It cannot change i_size but it needs to cope with a
concurrent i_size change.
- Implement mft.c::sync_mft_mirror_umount(). We currently will just
- Implement mft.c::sync_mft_mirror_umount(). We currently will just
leave the volume dirty on umount if the final iput(vol->mft_ino)
leave the volume dirty on umount if the final iput(vol->mft_ino)
causes a write of any mirrored mft records due to the mft mirror
causes a write of any mirrored mft records due to the mft mirror
...
@@ -32,6 +30,7 @@ ToDo/Notes:
...
@@ -32,6 +30,7 @@ ToDo/Notes:
attack. Thanks to Carl-Daniel Hailfinger from SuSE for pointing this
attack. Thanks to Carl-Daniel Hailfinger from SuSE for pointing this
out.
out.
- Use i_size_read() in fs/ntfs/attrib.c::ntfs_attr_set().
- Use i_size_read() in fs/ntfs/attrib.c::ntfs_attr_set().
- Use i_size_read() in fs/ntfs/logfile.c::ntfs_{check,empty}_logfile().
2.1.22 - Many bug and race fixes and error handling improvements.
2.1.22 - Many bug and race fixes and error handling improvements.
...
...
fs/ntfs/logfile.c
浏览文件 @
66129f88
...
@@ -443,7 +443,7 @@ BOOL ntfs_check_logfile(struct inode *log_vi)
...
@@ -443,7 +443,7 @@ BOOL ntfs_check_logfile(struct inode *log_vi)
/* An empty $LogFile must have been clean before it got emptied. */
/* An empty $LogFile must have been clean before it got emptied. */
if
(
NVolLogFileEmpty
(
vol
))
if
(
NVolLogFileEmpty
(
vol
))
goto
is_empty
;
goto
is_empty
;
size
=
log_vi
->
i_size
;
size
=
i_size_read
(
log_vi
)
;
/* Make sure the file doesn't exceed the maximum allowed size. */
/* Make sure the file doesn't exceed the maximum allowed size. */
if
(
size
>
MaxLogFileSize
)
if
(
size
>
MaxLogFileSize
)
size
=
MaxLogFileSize
;
size
=
MaxLogFileSize
;
...
@@ -689,7 +689,8 @@ BOOL ntfs_empty_logfile(struct inode *log_vi)
...
@@ -689,7 +689,8 @@ BOOL ntfs_empty_logfile(struct inode *log_vi)
if
(
!
NVolLogFileEmpty
(
vol
))
{
if
(
!
NVolLogFileEmpty
(
vol
))
{
int
err
;
int
err
;
err
=
ntfs_attr_set
(
NTFS_I
(
log_vi
),
0
,
log_vi
->
i_size
,
0xff
);
err
=
ntfs_attr_set
(
NTFS_I
(
log_vi
),
0
,
i_size_read
(
log_vi
),
0xff
);
if
(
unlikely
(
err
))
{
if
(
unlikely
(
err
))
{
ntfs_error
(
vol
->
sb
,
"Failed to fill $LogFile with "
ntfs_error
(
vol
->
sb
,
"Failed to fill $LogFile with "
"0xff bytes (error code %i)."
,
err
);
"0xff bytes (error code %i)."
,
err
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录