Commit b77a69b8 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull UDF, reiserfs, ext2, quota fixes from Jan Kara:

 - a couple of UDF fixes for issues found by syzbot fuzzing

 - a couple of reiserfs fixes for issues found by syzbot fuzzing

 - some minor ext2 cleanups

 - quota patches to support grace times beyond year 2038 for XFS quota
   APIs

* tag 'fs_for_v5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  reiserfs: Fix oops during mount
  udf: Limit sparing table size
  udf: Remove pointless union in udf_inode_info
  udf: Avoid accessing uninitialized data on failed inode read
  quota: clear padding in v2r1_mem2diskdqb()
  reiserfs: Initialize inode keys properly
  udf: Fix memory leak when mounting
  udf: Remove redundant initialization of variable ret
  reiserfs: only call unlock_new_inode() if I_NEW
  ext2: Fix some kernel-doc warnings in balloc.c
  quota: Expand comment describing d_itimer
  quota: widen timestamps for the fs_disk_quota structure
  reiserfs: Fix memory leak in reiserfs_parse_options()
  udf: Use kvzalloc() in udf_sb_alloc_bitmap()
  ext2: remove duplicate include
parents ca5387e4 c2bb80b8
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -189,7 +189,7 @@ static void group_adjust_blocks(struct super_block *sb, int group_no,

/**
 * __rsv_window_dump() -- Dump the filesystem block allocation reservation map
 * @rb_root:		root of per-filesystem reservation rb tree
 * @root:		root of per-filesystem reservation rb tree
 * @verbose:		verbose mode
 * @fn:			function which wishes to dump the reservation map
 *
@@ -282,7 +282,7 @@ goal_in_my_reservation(struct ext2_reserve_window *rsv, ext2_grpblk_t grp_goal,

/**
 * search_reserve_window()
 * @rb_root:		root of reservation tree
 * @root:		root of reservation tree
 * @goal:		target allocation block
 *
 * Find the reserved window which includes the goal, or the previous one
@@ -859,7 +859,7 @@ static int find_next_reservable_window(
 *
 *	failed: we failed to find a reservation window in this group
 *
 *	@rsv: the reservation
 *	@my_rsv: the reservation
 *
 *	@grp_goal: The goal (group-relative).  It is where the search for a
 *		free reservable space should start from.
+0 −1
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@
#include <linux/iomap.h>
#include <linux/namei.h>
#include <linux/uio.h>
#include <linux/fiemap.h>
#include "ext2.h"
#include "acl.h"
#include "xattr.h"
+36 −6
Original line number Diff line number Diff line
@@ -532,6 +532,14 @@ static inline u64 quota_btobb(u64 bytes)
	return (bytes + (1 << XFS_BB_SHIFT) - 1) >> XFS_BB_SHIFT;
}

static inline s64 copy_from_xfs_dqblk_ts(const struct fs_disk_quota *d,
		__s32 timer, __s8 timer_hi)
{
	if (d->d_fieldmask & FS_DQ_BIGTIME)
		return (u32)timer | (s64)timer_hi << 32;
	return timer;
}

static void copy_from_xfs_dqblk(struct qc_dqblk *dst, struct fs_disk_quota *src)
{
	dst->d_spc_hardlimit = quota_bbtob(src->d_blk_hardlimit);
@@ -540,14 +548,17 @@ static void copy_from_xfs_dqblk(struct qc_dqblk *dst, struct fs_disk_quota *src)
	dst->d_ino_softlimit = src->d_ino_softlimit;
	dst->d_space = quota_bbtob(src->d_bcount);
	dst->d_ino_count = src->d_icount;
	dst->d_ino_timer = src->d_itimer;
	dst->d_spc_timer = src->d_btimer;
	dst->d_ino_timer = copy_from_xfs_dqblk_ts(src, src->d_itimer,
						  src->d_itimer_hi);
	dst->d_spc_timer = copy_from_xfs_dqblk_ts(src, src->d_btimer,
						  src->d_btimer_hi);
	dst->d_ino_warns = src->d_iwarns;
	dst->d_spc_warns = src->d_bwarns;
	dst->d_rt_spc_hardlimit = quota_bbtob(src->d_rtb_hardlimit);
	dst->d_rt_spc_softlimit = quota_bbtob(src->d_rtb_softlimit);
	dst->d_rt_space = quota_bbtob(src->d_rtbcount);
	dst->d_rt_spc_timer = src->d_rtbtimer;
	dst->d_rt_spc_timer = copy_from_xfs_dqblk_ts(src, src->d_rtbtimer,
						     src->d_rtbtimer_hi);
	dst->d_rt_spc_warns = src->d_rtbwarns;
	dst->d_fieldmask = 0;
	if (src->d_fieldmask & FS_DQ_ISOFT)
@@ -639,10 +650,26 @@ static int quota_setxquota(struct super_block *sb, int type, qid_t id,
	return sb->s_qcop->set_dqblk(sb, qid, &qdq);
}

static inline void copy_to_xfs_dqblk_ts(const struct fs_disk_quota *d,
		__s32 *timer_lo, __s8 *timer_hi, s64 timer)
{
	*timer_lo = timer;
	if (d->d_fieldmask & FS_DQ_BIGTIME)
		*timer_hi = timer >> 32;
}

static inline bool want_bigtime(s64 timer)
{
	return timer > S32_MAX || timer < S32_MIN;
}

static void copy_to_xfs_dqblk(struct fs_disk_quota *dst, struct qc_dqblk *src,
			      int type, qid_t id)
{
	memset(dst, 0, sizeof(*dst));
	if (want_bigtime(src->d_ino_timer) || want_bigtime(src->d_spc_timer) ||
	    want_bigtime(src->d_rt_spc_timer))
		dst->d_fieldmask |= FS_DQ_BIGTIME;
	dst->d_version = FS_DQUOT_VERSION;
	dst->d_id = id;
	if (type == USRQUOTA)
@@ -657,14 +684,17 @@ static void copy_to_xfs_dqblk(struct fs_disk_quota *dst, struct qc_dqblk *src,
	dst->d_ino_softlimit = src->d_ino_softlimit;
	dst->d_bcount = quota_btobb(src->d_space);
	dst->d_icount = src->d_ino_count;
	dst->d_itimer = src->d_ino_timer;
	dst->d_btimer = src->d_spc_timer;
	copy_to_xfs_dqblk_ts(dst, &dst->d_itimer, &dst->d_itimer_hi,
			     src->d_ino_timer);
	copy_to_xfs_dqblk_ts(dst, &dst->d_btimer, &dst->d_btimer_hi,
			     src->d_spc_timer);
	dst->d_iwarns = src->d_ino_warns;
	dst->d_bwarns = src->d_spc_warns;
	dst->d_rtb_hardlimit = quota_btobb(src->d_rt_spc_hardlimit);
	dst->d_rtb_softlimit = quota_btobb(src->d_rt_spc_softlimit);
	dst->d_rtbcount = quota_btobb(src->d_rt_space);
	dst->d_rtbtimer = src->d_rt_spc_timer;
	copy_to_xfs_dqblk_ts(dst, &dst->d_rtbtimer, &dst->d_rtbtimer_hi,
			     src->d_rt_spc_timer);
	dst->d_rtbwarns = src->d_rt_spc_warns;
}

+1 −0
Original line number Diff line number Diff line
@@ -282,6 +282,7 @@ static void v2r1_mem2diskdqb(void *dp, struct dquot *dquot)
	d->dqb_curspace = cpu_to_le64(m->dqb_curspace);
	d->dqb_btime = cpu_to_le64(m->dqb_btime);
	d->dqb_id = cpu_to_le32(from_kqid(&init_user_ns, dquot->dq_id));
	d->dqb_pad = 0;
	if (qtree_entry_unused(info, dp))
		d->dqb_itime = cpu_to_le64(1);
}
+3 −6
Original line number Diff line number Diff line
@@ -1551,11 +1551,7 @@ void reiserfs_read_locked_inode(struct inode *inode,
	 * set version 1, version 2 could be used too, because stat data
	 * key is the same in both versions
	 */
	key.version = KEY_FORMAT_3_5;
	key.on_disk_key.k_dir_id = dirino;
	key.on_disk_key.k_objectid = inode->i_ino;
	key.on_disk_key.k_offset = 0;
	key.on_disk_key.k_type = 0;
	_make_cpu_key(&key, KEY_FORMAT_3_5, dirino, inode->i_ino, 0, 0, 3);

	/* look for the object's stat data */
	retval = search_item(inode->i_sb, &key, &path_to_sd);
@@ -2163,7 +2159,8 @@ out_end_trans:
out_inserted_sd:
	clear_nlink(inode);
	th->t_trans_id = 0;	/* so the caller can't use this handle later */
	unlock_new_inode(inode); /* OK to do even if we hadn't locked it */
	if (inode->i_state & I_NEW)
		unlock_new_inode(inode);
	iput(inode);
	return err;
}
Loading