diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-07 12:01:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2019-03-07 12:01:33 -0500 |
commit | a9913f23f39f4aa74956587a03e78b758a10c314 (patch) | |
tree | 55bbe50b2417009fc20d4fcaa248bebd1d2bf887 /fs/ext2/inode.c | |
parent | b39a07a5e073ba783cd86b60c77044587ddbf8a1 (diff) | |
parent | 52b9666efd8b0874d334de718a7d561e7b0eb1cc (diff) |
Merge tag 'fs_for_v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull ext2 and udf fixes from Jan Kara:
"A couple of fixes for udf and ext2. Namely:
- fix making ext2 mountable (again) with 64k blocksize
- fix for ext2 statx(2) handling
- fix for udf handling of corrupted filesystem so that it doesn't get
corrupted even further
- couple smaller ext2 and udf cleanups"
* tag 'fs_for_v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
udf: Drop pointless check from udf_sync_fs()
ext2: support statx syscall
udf: disallow RW mount without valid integrity descriptor
udf: finalize integrity descriptor before writeback
udf: factor out LVID finalization for reuse
ext2: Fix underflow in ext2_max_size()
ext2: Fix a typo in comment
ext2: Remove redundant check for finding no group
ext2: Annotate implicit fall through in __ext2_truncate_blocks
ext2: Set superblock revision when enabling xattr feature
ext2: Remove redundant check on s_inode_size
ext2: set proper return code
Diffstat (limited to 'fs/ext2/inode.c')
-rw-r--r-- | fs/ext2/inode.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index e4bb9386c045..c27c27300d95 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c | |||
@@ -717,7 +717,7 @@ static int ext2_get_blocks(struct inode *inode, | |||
717 | /* the number of blocks need to allocate for [d,t]indirect blocks */ | 717 | /* the number of blocks need to allocate for [d,t]indirect blocks */ |
718 | indirect_blks = (chain + depth) - partial - 1; | 718 | indirect_blks = (chain + depth) - partial - 1; |
719 | /* | 719 | /* |
720 | * Next look up the indirect map to count the totoal number of | 720 | * Next look up the indirect map to count the total number of |
721 | * direct blocks to allocate for this branch. | 721 | * direct blocks to allocate for this branch. |
722 | */ | 722 | */ |
723 | count = ext2_blks_to_allocate(partial, indirect_blks, | 723 | count = ext2_blks_to_allocate(partial, indirect_blks, |
@@ -1239,6 +1239,7 @@ do_indirects: | |||
1239 | mark_inode_dirty(inode); | 1239 | mark_inode_dirty(inode); |
1240 | ext2_free_branches(inode, &nr, &nr+1, 1); | 1240 | ext2_free_branches(inode, &nr, &nr+1, 1); |
1241 | } | 1241 | } |
1242 | /* fall through */ | ||
1242 | case EXT2_IND_BLOCK: | 1243 | case EXT2_IND_BLOCK: |
1243 | nr = i_data[EXT2_DIND_BLOCK]; | 1244 | nr = i_data[EXT2_DIND_BLOCK]; |
1244 | if (nr) { | 1245 | if (nr) { |
@@ -1246,6 +1247,7 @@ do_indirects: | |||
1246 | mark_inode_dirty(inode); | 1247 | mark_inode_dirty(inode); |
1247 | ext2_free_branches(inode, &nr, &nr+1, 2); | 1248 | ext2_free_branches(inode, &nr, &nr+1, 2); |
1248 | } | 1249 | } |
1250 | /* fall through */ | ||
1249 | case EXT2_DIND_BLOCK: | 1251 | case EXT2_DIND_BLOCK: |
1250 | nr = i_data[EXT2_TIND_BLOCK]; | 1252 | nr = i_data[EXT2_TIND_BLOCK]; |
1251 | if (nr) { | 1253 | if (nr) { |
@@ -1635,6 +1637,32 @@ int ext2_write_inode(struct inode *inode, struct writeback_control *wbc) | |||
1635 | return __ext2_write_inode(inode, wbc->sync_mode == WB_SYNC_ALL); | 1637 | return __ext2_write_inode(inode, wbc->sync_mode == WB_SYNC_ALL); |
1636 | } | 1638 | } |
1637 | 1639 | ||
1640 | int ext2_getattr(const struct path *path, struct kstat *stat, | ||
1641 | u32 request_mask, unsigned int query_falgs) | ||
1642 | { | ||
1643 | struct inode *inode = d_inode(path->dentry); | ||
1644 | struct ext2_inode_info *ei = EXT2_I(inode); | ||
1645 | unsigned int flags; | ||
1646 | |||
1647 | flags = ei->i_flags & EXT2_FL_USER_VISIBLE; | ||
1648 | if (flags & EXT2_APPEND_FL) | ||
1649 | stat->attributes |= STATX_ATTR_APPEND; | ||
1650 | if (flags & EXT2_COMPR_FL) | ||
1651 | stat->attributes |= STATX_ATTR_COMPRESSED; | ||
1652 | if (flags & EXT2_IMMUTABLE_FL) | ||
1653 | stat->attributes |= STATX_ATTR_IMMUTABLE; | ||
1654 | if (flags & EXT2_NODUMP_FL) | ||
1655 | stat->attributes |= STATX_ATTR_NODUMP; | ||
1656 | stat->attributes_mask |= (STATX_ATTR_APPEND | | ||
1657 | STATX_ATTR_COMPRESSED | | ||
1658 | STATX_ATTR_ENCRYPTED | | ||
1659 | STATX_ATTR_IMMUTABLE | | ||
1660 | STATX_ATTR_NODUMP); | ||
1661 | |||
1662 | generic_fillattr(inode, stat); | ||
1663 | return 0; | ||
1664 | } | ||
1665 | |||
1638 | int ext2_setattr(struct dentry *dentry, struct iattr *iattr) | 1666 | int ext2_setattr(struct dentry *dentry, struct iattr *iattr) |
1639 | { | 1667 | { |
1640 | struct inode *inode = d_inode(dentry); | 1668 | struct inode *inode = d_inode(dentry); |