diff options
Diffstat (limited to 'fs/ext4/inline.c')
| -rw-r--r-- | fs/ext4/inline.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index 645205d8ada6..bea662bd0ca6 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c | |||
| @@ -120,12 +120,6 @@ int ext4_get_max_inline_size(struct inode *inode) | |||
| 120 | return max_inline_size + EXT4_MIN_INLINE_DATA_SIZE; | 120 | return max_inline_size + EXT4_MIN_INLINE_DATA_SIZE; |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | int ext4_has_inline_data(struct inode *inode) | ||
| 124 | { | ||
| 125 | return ext4_test_inode_flag(inode, EXT4_INODE_INLINE_DATA) && | ||
| 126 | EXT4_I(inode)->i_inline_off; | ||
| 127 | } | ||
| 128 | |||
| 129 | /* | 123 | /* |
| 130 | * this function does not take xattr_sem, which is OK because it is | 124 | * this function does not take xattr_sem, which is OK because it is |
| 131 | * currently only used in a code path coming form ext4_iget, before | 125 | * currently only used in a code path coming form ext4_iget, before |
| @@ -1178,6 +1172,18 @@ static int ext4_convert_inline_data_nolock(handle_t *handle, | |||
| 1178 | if (error < 0) | 1172 | if (error < 0) |
| 1179 | goto out; | 1173 | goto out; |
| 1180 | 1174 | ||
| 1175 | /* | ||
| 1176 | * Make sure the inline directory entries pass checks before we try to | ||
| 1177 | * convert them, so that we avoid touching stuff that needs fsck. | ||
| 1178 | */ | ||
| 1179 | if (S_ISDIR(inode->i_mode)) { | ||
| 1180 | error = ext4_check_all_de(inode, iloc->bh, | ||
| 1181 | buf + EXT4_INLINE_DOTDOT_SIZE, | ||
| 1182 | inline_size - EXT4_INLINE_DOTDOT_SIZE); | ||
| 1183 | if (error) | ||
| 1184 | goto out; | ||
| 1185 | } | ||
| 1186 | |||
| 1181 | error = ext4_destroy_inline_data_nolock(handle, inode); | 1187 | error = ext4_destroy_inline_data_nolock(handle, inode); |
| 1182 | if (error) | 1188 | if (error) |
| 1183 | goto out; | 1189 | goto out; |
