Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ce1e15d authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull ext2, quota, udf fixes and cleanups from Jan Kara:

 - two small quota fixes (in grace time handling and possible missed
   accounting of preallocated blocks beyond EOF).

 - some ext2 cleanups

 - udf fixes for better compatibility with Windows 10 generated media
   (named streams, write-protection using domain-identifier, placement
   of volume recognition sequence)

 - some udf cleanups

* tag 'for_v5.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  quota: fix wrong condition in is_quota_modification()
  fs-udf: Delete an unnecessary check before brelse()
  ext2: Delete an unnecessary check before brelse()
  udf: Drop forward function declarations
  udf: Verify domain identifier fields
  udf: augment UDF permissions on new inodes
  udf: Use dynamic debug infrastructure
  udf: reduce leakage of blocks related to named streams
  udf: prevent allocation beyond UDF partition
  quota: fix condition for resetting time limit in do_set_dqblk()
  ext2: code cleanup for ext2_free_blocks()
  ext2: fix block range in ext2_data_block_valid()
  udf: support 2048-byte spacing of VRS descriptors on 4K media
  udf: refactor VRS descriptor identification
parents 70cb0d02 6565c182
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -490,9 +490,7 @@ void ext2_free_blocks (struct inode * inode, unsigned long block,
	struct ext2_super_block * es = sbi->s_es;
	unsigned freed = 0, group_freed;

	if (block < le32_to_cpu(es->s_first_data_block) ||
	    block + count < block ||
	    block + count > le32_to_cpu(es->s_blocks_count)) {
	if (!ext2_data_block_valid(sbi, block, count)) {
		ext2_error (sb, "ext2_free_blocks",
			    "Freeing blocks not in datazone - "
			    "block = %lu, count = %lu", block, count);
@@ -1203,13 +1201,13 @@ int ext2_data_block_valid(struct ext2_sb_info *sbi, ext2_fsblk_t start_blk,
			  unsigned int count)
{
	if ((start_blk <= le32_to_cpu(sbi->s_es->s_first_data_block)) ||
	    (start_blk + count < start_blk) ||
	    (start_blk > le32_to_cpu(sbi->s_es->s_blocks_count)))
	    (start_blk + count - 1 < start_blk) ||
	    (start_blk + count - 1 >= le32_to_cpu(sbi->s_es->s_blocks_count)))
		return 0;

	/* Ensure we do not step over superblock */
	if ((start_blk <= sbi->s_sb_block) &&
	    (start_blk + count >= sbi->s_sb_block))
	    (start_blk + count - 1 >= sbi->s_sb_block))
		return 0;

	return 1;
+1 −2
Original line number Diff line number Diff line
@@ -162,7 +162,6 @@ static void ext2_put_super (struct super_block * sb)
	}
	db_count = sbi->s_gdb_count;
	for (i = 0; i < db_count; i++)
		if (sbi->s_group_desc[i])
		brelse(sbi->s_group_desc[i]);
	kfree(sbi->s_group_desc);
	kfree(sbi->s_debts);
+1 −1
Original line number Diff line number Diff line
@@ -794,7 +794,7 @@ ext2_xattr_delete_inode(struct inode *inode)
	if (!EXT2_I(inode)->i_file_acl)
		goto cleanup;

	if (!ext2_data_block_valid(sbi, EXT2_I(inode)->i_file_acl, 0)) {
	if (!ext2_data_block_valid(sbi, EXT2_I(inode)->i_file_acl, 1)) {
		ext2_error(inode->i_sb, "ext2_xattr_delete_inode",
			"inode %ld: xattr block %d is out of data blocks range",
			inode->i_ino, EXT2_I(inode)->i_file_acl);
+2 −2
Original line number Diff line number Diff line
@@ -2731,7 +2731,7 @@ static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di)

	if (check_blim) {
		if (!dm->dqb_bsoftlimit ||
		    dm->dqb_curspace + dm->dqb_rsvspace < dm->dqb_bsoftlimit) {
		    dm->dqb_curspace + dm->dqb_rsvspace <= dm->dqb_bsoftlimit) {
			dm->dqb_btime = 0;
			clear_bit(DQ_BLKS_B, &dquot->dq_flags);
		} else if (!(di->d_fieldmask & QC_SPC_TIMER))
@@ -2740,7 +2740,7 @@ static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di)
	}
	if (check_ilim) {
		if (!dm->dqb_isoftlimit ||
		    dm->dqb_curinodes < dm->dqb_isoftlimit) {
		    dm->dqb_curinodes <= dm->dqb_isoftlimit) {
			dm->dqb_itime = 0;
			clear_bit(DQ_INODES_B, &dquot->dq_flags);
		} else if (!(di->d_fieldmask & QC_INO_TIMER))
+11 −0
Original line number Diff line number Diff line
@@ -325,6 +325,17 @@ static udf_pblk_t udf_bitmap_new_block(struct super_block *sb,
	newblock = bit + (block_group << (sb->s_blocksize_bits + 3)) -
		(sizeof(struct spaceBitmapDesc) << 3);

	if (newblock >= sbi->s_partmaps[partition].s_partition_len) {
		/*
		 * Ran off the end of the bitmap, and bits following are
		 * non-compliant (not all zero)
		 */
		udf_err(sb, "bitmap for partition %d corrupted (block %u marked"
			" as free, partition length is %u)\n", partition,
			newblock, sbi->s_partmaps[partition].s_partition_len);
		goto error_return;
	}

	if (!udf_clear_bit(bit, bh->b_data)) {
		udf_debug("bit already cleared for block %d\n", bit);
		goto repeat;
Loading