Commit a9913f23 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents b39a07a5 52b9666e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -758,6 +758,7 @@ extern int ext2_write_inode (struct inode *, struct writeback_control *);
extern void ext2_evict_inode(struct inode *);
extern int ext2_get_block(struct inode *, sector_t, struct buffer_head *, int);
extern int ext2_setattr (struct dentry *, struct iattr *);
extern int ext2_getattr (const struct path *, struct kstat *, u32, unsigned int);
extern void ext2_set_inode_flags(struct inode *inode);
extern int ext2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
		       u64 start, u64 len);
+1 −0
Original line number Diff line number Diff line
@@ -199,6 +199,7 @@ const struct inode_operations ext2_file_inode_operations = {
#ifdef CONFIG_EXT2_FS_XATTR
	.listxattr	= ext2_listxattr,
#endif
	.getattr	= ext2_getattr,
	.setattr	= ext2_setattr,
	.get_acl	= ext2_get_acl,
	.set_acl	= ext2_set_acl,
+0 −2
Original line number Diff line number Diff line
@@ -222,8 +222,6 @@ static int find_group_dir(struct super_block *sb, struct inode *parent)
			best_desc = desc;
		}
	}
	if (!best_desc)
		return -1;

	return best_group;
}
+29 −1
Original line number Diff line number Diff line
@@ -717,7 +717,7 @@ static int ext2_get_blocks(struct inode *inode,
	/* the number of blocks need to allocate for [d,t]indirect blocks */
	indirect_blks = (chain + depth) - partial - 1;
	/*
	 * Next look up the indirect map to count the totoal number of
	 * Next look up the indirect map to count the total number of
	 * direct blocks to allocate for this branch.
	 */
	count = ext2_blks_to_allocate(partial, indirect_blks,
@@ -1239,6 +1239,7 @@ do_indirects:
				mark_inode_dirty(inode);
				ext2_free_branches(inode, &nr, &nr+1, 1);
			}
			/* fall through */
		case EXT2_IND_BLOCK:
			nr = i_data[EXT2_DIND_BLOCK];
			if (nr) {
@@ -1246,6 +1247,7 @@ do_indirects:
				mark_inode_dirty(inode);
				ext2_free_branches(inode, &nr, &nr+1, 2);
			}
			/* fall through */
		case EXT2_DIND_BLOCK:
			nr = i_data[EXT2_TIND_BLOCK];
			if (nr) {
@@ -1635,6 +1637,32 @@ int ext2_write_inode(struct inode *inode, struct writeback_control *wbc)
	return __ext2_write_inode(inode, wbc->sync_mode == WB_SYNC_ALL);
}

int ext2_getattr(const struct path *path, struct kstat *stat,
		u32 request_mask, unsigned int query_falgs)
{
	struct inode *inode = d_inode(path->dentry);
	struct ext2_inode_info *ei = EXT2_I(inode);
	unsigned int flags;

	flags = ei->i_flags & EXT2_FL_USER_VISIBLE;
	if (flags & EXT2_APPEND_FL)
		stat->attributes |= STATX_ATTR_APPEND;
	if (flags & EXT2_COMPR_FL)
		stat->attributes |= STATX_ATTR_COMPRESSED;
	if (flags & EXT2_IMMUTABLE_FL)
		stat->attributes |= STATX_ATTR_IMMUTABLE;
	if (flags & EXT2_NODUMP_FL)
		stat->attributes |= STATX_ATTR_NODUMP;
	stat->attributes_mask |= (STATX_ATTR_APPEND |
			STATX_ATTR_COMPRESSED |
			STATX_ATTR_ENCRYPTED |
			STATX_ATTR_IMMUTABLE |
			STATX_ATTR_NODUMP);

	generic_fillattr(inode, stat);
	return 0;
}

int ext2_setattr(struct dentry *dentry, struct iattr *iattr)
{
	struct inode *inode = d_inode(dentry);
+2 −0
Original line number Diff line number Diff line
@@ -416,6 +416,7 @@ const struct inode_operations ext2_dir_inode_operations = {
#ifdef CONFIG_EXT2_FS_XATTR
	.listxattr	= ext2_listxattr,
#endif
	.getattr	= ext2_getattr,
	.setattr	= ext2_setattr,
	.get_acl	= ext2_get_acl,
	.set_acl	= ext2_set_acl,
@@ -426,6 +427,7 @@ const struct inode_operations ext2_special_inode_operations = {
#ifdef CONFIG_EXT2_FS_XATTR
	.listxattr	= ext2_listxattr,
#endif
	.getattr	= ext2_getattr,
	.setattr	= ext2_setattr,
	.get_acl	= ext2_get_acl,
	.set_acl	= ext2_set_acl,
Loading