Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
dfdeeb41
Commit
dfdeeb41
authored
Nov 19, 2019
by
Theodore Ts'o
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'tt/misc' into dev
parents
3c845acd
c7df4a1e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
15 deletions
+32
-15
fs/ext4/inode.c
fs/ext4/inode.c
+15
-0
fs/ext4/namei.c
fs/ext4/namei.c
+5
-6
fs/ext4/super.c
fs/ext4/super.c
+12
-9
No files found.
fs/ext4/inode.c
View file @
dfdeeb41
...
@@ -5580,8 +5580,23 @@ static int __ext4_expand_extra_isize(struct inode *inode,
...
@@ -5580,8 +5580,23 @@ static int __ext4_expand_extra_isize(struct inode *inode,
{
{
struct
ext4_inode
*
raw_inode
;
struct
ext4_inode
*
raw_inode
;
struct
ext4_xattr_ibody_header
*
header
;
struct
ext4_xattr_ibody_header
*
header
;
unsigned
int
inode_size
=
EXT4_INODE_SIZE
(
inode
->
i_sb
);
struct
ext4_inode_info
*
ei
=
EXT4_I
(
inode
);
int
error
;
int
error
;
/* this was checked at iget time, but double check for good measure */
if
((
EXT4_GOOD_OLD_INODE_SIZE
+
ei
->
i_extra_isize
>
inode_size
)
||
(
ei
->
i_extra_isize
&
3
))
{
EXT4_ERROR_INODE
(
inode
,
"bad extra_isize %u (inode size %u)"
,
ei
->
i_extra_isize
,
EXT4_INODE_SIZE
(
inode
->
i_sb
));
return
-
EFSCORRUPTED
;
}
if
((
new_extra_isize
<
ei
->
i_extra_isize
)
||
(
new_extra_isize
<
4
)
||
(
new_extra_isize
>
inode_size
-
EXT4_GOOD_OLD_INODE_SIZE
))
return
-
EINVAL
;
/* Should never happen */
raw_inode
=
ext4_raw_inode
(
iloc
);
raw_inode
=
ext4_raw_inode
(
iloc
);
header
=
IHDR
(
inode
,
raw_inode
);
header
=
IHDR
(
inode
,
raw_inode
);
...
...
fs/ext4/namei.c
View file @
dfdeeb41
...
@@ -3196,18 +3196,17 @@ static int ext4_unlink(struct inode *dir, struct dentry *dentry)
...
@@ -3196,18 +3196,17 @@ static int ext4_unlink(struct inode *dir, struct dentry *dentry)
if
(
IS_DIRSYNC
(
dir
))
if
(
IS_DIRSYNC
(
dir
))
ext4_handle_sync
(
handle
);
ext4_handle_sync
(
handle
);
if
(
inode
->
i_nlink
==
0
)
{
ext4_warning_inode
(
inode
,
"Deleting file '%.*s' with no links"
,
dentry
->
d_name
.
len
,
dentry
->
d_name
.
name
);
set_nlink
(
inode
,
1
);
}
retval
=
ext4_delete_entry
(
handle
,
dir
,
de
,
bh
);
retval
=
ext4_delete_entry
(
handle
,
dir
,
de
,
bh
);
if
(
retval
)
if
(
retval
)
goto
end_unlink
;
goto
end_unlink
;
dir
->
i_ctime
=
dir
->
i_mtime
=
current_time
(
dir
);
dir
->
i_ctime
=
dir
->
i_mtime
=
current_time
(
dir
);
ext4_update_dx_flag
(
dir
);
ext4_update_dx_flag
(
dir
);
ext4_mark_inode_dirty
(
handle
,
dir
);
ext4_mark_inode_dirty
(
handle
,
dir
);
drop_nlink
(
inode
);
if
(
inode
->
i_nlink
==
0
)
ext4_warning_inode
(
inode
,
"Deleting file '%.*s' with no links"
,
dentry
->
d_name
.
len
,
dentry
->
d_name
.
name
);
else
drop_nlink
(
inode
);
if
(
!
inode
->
i_nlink
)
if
(
!
inode
->
i_nlink
)
ext4_orphan_add
(
handle
,
inode
);
ext4_orphan_add
(
handle
,
inode
);
inode
->
i_ctime
=
current_time
(
inode
);
inode
->
i_ctime
=
current_time
(
inode
);
...
...
fs/ext4/super.c
View file @
dfdeeb41
...
@@ -3544,12 +3544,15 @@ static void ext4_clamp_want_extra_isize(struct super_block *sb)
...
@@ -3544,12 +3544,15 @@ static void ext4_clamp_want_extra_isize(struct super_block *sb)
{
{
struct
ext4_sb_info
*
sbi
=
EXT4_SB
(
sb
);
struct
ext4_sb_info
*
sbi
=
EXT4_SB
(
sb
);
struct
ext4_super_block
*
es
=
sbi
->
s_es
;
struct
ext4_super_block
*
es
=
sbi
->
s_es
;
unsigned
def_extra_isize
=
sizeof
(
struct
ext4_inode
)
-
EXT4_GOOD_OLD_INODE_SIZE
;
/* determine the minimum size of new large inodes, if present */
if
(
sbi
->
s_inode_size
==
EXT4_GOOD_OLD_INODE_SIZE
)
{
if
(
sbi
->
s_inode_size
>
EXT4_GOOD_OLD_INODE_SIZE
&&
sbi
->
s_want_extra_isize
=
0
;
sbi
->
s_want_extra_isize
==
0
)
{
return
;
sbi
->
s_want_extra_isize
=
sizeof
(
struct
ext4_inode
)
-
}
EXT4_GOOD_OLD_INODE_SIZE
;
if
(
sbi
->
s_want_extra_isize
<
4
)
{
sbi
->
s_want_extra_isize
=
def_extra_isize
;
if
(
ext4_has_feature_extra_isize
(
sb
))
{
if
(
ext4_has_feature_extra_isize
(
sb
))
{
if
(
sbi
->
s_want_extra_isize
<
if
(
sbi
->
s_want_extra_isize
<
le16_to_cpu
(
es
->
s_want_extra_isize
))
le16_to_cpu
(
es
->
s_want_extra_isize
))
...
@@ -3562,10 +3565,10 @@ static void ext4_clamp_want_extra_isize(struct super_block *sb)
...
@@ -3562,10 +3565,10 @@ static void ext4_clamp_want_extra_isize(struct super_block *sb)
}
}
}
}
/* Check if enough inode space is available */
/* Check if enough inode space is available */
if
(
EXT4_GOOD_OLD_INODE_SIZE
+
sbi
->
s_want_extra_isize
>
if
(
(
sbi
->
s_want_extra_isize
>
sbi
->
s_inode_size
)
||
sbi
->
s_inode_size
)
{
(
EXT4_GOOD_OLD_INODE_SIZE
+
sbi
->
s_want_extra_isize
>
sbi
->
s_want_extra_isize
=
sizeof
(
struct
ext4_inode
)
-
sbi
->
s_inode_size
))
{
EXT4_GOOD_OLD_INODE_SIZE
;
sbi
->
s_want_extra_isize
=
def_extra_isize
;
ext4_msg
(
sb
,
KERN_INFO
,
ext4_msg
(
sb
,
KERN_INFO
,
"required extra inode space not available"
);
"required extra inode space not available"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment