Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'fs_for_v5.2-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull misc filesystem updates from Jan Kara:
"A couple of small bugfixes and cleanups for quota, udf, ext2, and
reiserfs"

* tag 'fs_for_v5.2-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
quota: check time limit when back out space/inode change
fs/quota: erase unused but set variable warning
quota: fix wrong indentation
udf: fix an uninitialized read bug and remove dead code
fs/reiserfs/journal.c: Make remove_journal_hash static
quota: remove trailing whitespaces
quota: code cleanup for __dquot_alloc_space()
ext2: Adjust the comment of function ext2_alloc_branch
udf: Explain handling of load_nls() failure

+31 -36
+3 -1
fs/ext2/inode.c
··· 451 451 /** 452 452 * ext2_alloc_branch - allocate and set up a chain of blocks. 453 453 * @inode: owner 454 - * @num: depth of the chain (number of blocks to allocate) 454 + * @indirect_blks: depth of the chain (number of blocks to allocate) 455 + * @blks: number of allocated direct blocks 456 + * @goal: preferred place for allocation 455 457 * @offsets: offsets (in the blocks) to store the pointers to next. 456 458 * @branch: place to store the chain in. 457 459 *
+20 -17
fs/quota/dquot.c
··· 9 9 * on the Melbourne quota system as used on BSD derived systems. The internal 10 10 * implementation is based on one of the several variants of the LINUX 11 11 * inode-subsystem with added complexity of the diskquota system. 12 - * 12 + * 13 13 * Author: Marco van Wieringen <mvw@planets.elm.net> 14 14 * 15 15 * Fixes: Dmitry Gorodchanin <pgmdsg@ibi.com>, 11 Feb 96 ··· 51 51 * Added journalled quota support, fix lock inversion problems 52 52 * Jan Kara, <jack@suse.cz>, 2003,2004 53 53 * 54 - * (C) Copyright 1994 - 1997 Marco van Wieringen 54 + * (C) Copyright 1994 - 1997 Marco van Wieringen 55 55 */ 56 56 57 57 #include <linux/errno.h> ··· 197 197 int qm; 198 198 199 199 spin_unlock(&dq_list_lock); 200 - 200 + 201 201 for (qm = 0; module_names[qm].qm_fmt_id && 202 202 module_names[qm].qm_fmt_id != id; qm++) 203 203 ; ··· 424 424 struct quota_info *dqopt = sb_dqopt(dquot->dq_sb); 425 425 426 426 mutex_lock(&dquot->dq_lock); 427 - if (!test_bit(DQ_READ_B, &dquot->dq_flags)) 427 + if (!test_bit(DQ_READ_B, &dquot->dq_flags)) { 428 428 ret = dqopt->ops[dquot->dq_id.type]->read_dqblk(dquot); 429 - if (ret < 0) 430 - goto out_iolock; 429 + if (ret < 0) 430 + goto out_iolock; 431 + } 431 432 /* Make sure flags update is visible after dquot has been filled */ 432 433 smp_mb__before_atomic(); 433 434 set_bit(DQ_READ_B, &dquot->dq_flags); ··· 1050 1049 struct list_head *tofree_head) 1051 1050 { 1052 1051 struct inode *inode; 1052 + #ifdef CONFIG_QUOTA_DEBUG 1053 1053 int reserved = 0; 1054 + #endif 1054 1055 1055 1056 spin_lock(&sb->s_inode_list_lock); 1056 1057 list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { ··· 1064 1061 */ 1065 1062 spin_lock(&dq_data_lock); 1066 1063 if (!IS_NOQUOTA(inode)) { 1064 + #ifdef CONFIG_QUOTA_DEBUG 1067 1065 if (unlikely(inode_get_rsv_space(inode) > 0)) 1068 1066 reserved = 1; 1067 + #endif 1069 1068 remove_inode_dquot_ref(inode, type, tofree_head); 1070 1069 } 1071 1070 spin_unlock(&dq_data_lock); ··· 1668 1663 for (cnt = 0; cnt < MAXQUOTAS; cnt++) { 1669 1664 if (!dquots[cnt]) 1670 1665 continue; 1671 - if (flags & DQUOT_SPACE_RESERVE) { 1666 + if (reserve) { 1672 1667 ret = dquot_add_space(dquots[cnt], 0, number, flags, 1673 1668 &warn[cnt]); 1674 1669 } else { ··· 1681 1676 if (!dquots[cnt]) 1682 1677 continue; 1683 1678 spin_lock(&dquots[cnt]->dq_dqb_lock); 1684 - if (flags & DQUOT_SPACE_RESERVE) { 1685 - dquots[cnt]->dq_dqb.dqb_rsvspace -= 1686 - number; 1687 - } else { 1688 - dquots[cnt]->dq_dqb.dqb_curspace -= 1689 - number; 1690 - } 1679 + if (reserve) 1680 + dquot_free_reserved_space(dquots[cnt], 1681 + number); 1682 + else 1683 + dquot_decr_space(dquots[cnt], number); 1691 1684 spin_unlock(&dquots[cnt]->dq_dqb_lock); 1692 1685 } 1693 1686 spin_unlock(&inode->i_lock); ··· 1736 1733 continue; 1737 1734 /* Back out changes we already did */ 1738 1735 spin_lock(&dquots[cnt]->dq_dqb_lock); 1739 - dquots[cnt]->dq_dqb.dqb_curinodes--; 1736 + dquot_decr_inodes(dquots[cnt], 1); 1740 1737 spin_unlock(&dquots[cnt]->dq_dqb_lock); 1741 1738 } 1742 1739 goto warn_put_all; ··· 2400 2397 out_fmt: 2401 2398 put_quota_format(fmt); 2402 2399 2403 - return error; 2400 + return error; 2404 2401 } 2405 2402 2406 2403 /* Reenable quotas on remount RW */ ··· 2778 2775 struct qc_type_state *tstate; 2779 2776 struct quota_info *dqopt = sb_dqopt(sb); 2780 2777 int type; 2781 - 2778 + 2782 2779 memset(state, 0, sizeof(*state)); 2783 2780 for (type = 0; type < MAXQUOTAS; type++) { 2784 2781 if (!sb_has_quota_active(sb, type))
+1 -1
fs/quota/quota_v1.c
··· 127 127 { 128 128 struct inode *inode = sb_dqopt(sb)->files[type]; 129 129 ulong blocks; 130 - size_t off; 130 + size_t off; 131 131 struct v2_disk_dqheader dqhead; 132 132 ssize_t size; 133 133 loff_t isize;
+1 -1
fs/quota/quota_v2.c
··· 78 78 struct v2_disk_dqheader dqhead; 79 79 static const uint quota_magics[] = V2_INITQMAGICS; 80 80 static const uint quota_versions[] = V2_INITQVERSIONS; 81 - 81 + 82 82 if (v2_read_header(sb, type, &dqhead)) 83 83 return 0; 84 84 if (le32_to_cpu(dqhead.dqh_magic) != quota_magics[type] ||
+1 -1
fs/reiserfs/journal.c
··· 1844 1844 * removes any nodes in table with name block and dev as bh. 1845 1845 * only touchs the hnext and hprev pointers. 1846 1846 */ 1847 - void remove_journal_hash(struct super_block *sb, 1847 + static void remove_journal_hash(struct super_block *sb, 1848 1848 struct reiserfs_journal_cnode **table, 1849 1849 struct reiserfs_journal_list *jl, 1850 1850 unsigned long block, int remove_freed)
-15
fs/udf/namei.c
··· 304 304 if (dentry->d_name.len > UDF_NAME_LEN) 305 305 return ERR_PTR(-ENAMETOOLONG); 306 306 307 - #ifdef UDF_RECOVERY 308 - /* temporary shorthand for specifying files by inode number */ 309 - if (!strncmp(dentry->d_name.name, ".B=", 3)) { 310 - struct kernel_lb_addr lb = { 311 - .logicalBlockNum = 0, 312 - .partitionReferenceNum = 313 - simple_strtoul(dentry->d_name.name + 3, 314 - NULL, 0), 315 - }; 316 - inode = udf_iget(dir->i_sb, lb); 317 - if (IS_ERR(inode)) 318 - return inode; 319 - } else 320 - #endif /* UDF_RECOVERY */ 321 - 322 307 fi = udf_find_entry(dir, &dentry->d_name, &fibh, &cfi); 323 308 if (IS_ERR(fi)) 324 309 return ERR_CAST(fi);
+5
fs/udf/super.c
··· 566 566 if (!remount) { 567 567 if (uopt->nls_map) 568 568 unload_nls(uopt->nls_map); 569 + /* 570 + * load_nls() failure is handled later in 571 + * udf_fill_super() after all options are 572 + * parsed. 573 + */ 569 574 uopt->nls_map = load_nls(args[0].from); 570 575 uopt->flags |= (1 << UDF_FLAG_NLS_MAP); 571 576 }