]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Merge tag 'fs_for_v5.2-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 13 May 2019 21:59:55 +0000 (14:59 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 13 May 2019 21:59:55 +0000 (14:59 -0700)
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

fs/ext2/inode.c
fs/quota/dquot.c
fs/quota/quota_v1.c
fs/quota/quota_v2.c
fs/reiserfs/journal.c
fs/udf/namei.c
fs/udf/super.c

index c27c27300d95894c9de2ae0614e36c3df11bad47..e474127dd255605df4ab498997111ac1cf63fafa 100644 (file)
@@ -451,7 +451,9 @@ failed_out:
 /**
  *     ext2_alloc_branch - allocate and set up a chain of blocks.
  *     @inode: owner
- *     @num: depth of the chain (number of blocks to allocate)
+ *     @indirect_blks: depth of the chain (number of blocks to allocate)
+ *     @blks: number of allocated direct blocks
+ *     @goal: preferred place for allocation
  *     @offsets: offsets (in the blocks) to store the pointers to next.
  *     @branch: place to store the chain in.
  *
index fc20e06c56ba55bf229db78cb5b5077c21935931..9ad72ea7f71f5d71608c470992c871aa7bbe2f15 100644 (file)
@@ -9,7 +9,7 @@
  * on the Melbourne quota system as used on BSD derived systems. The internal
  * implementation is based on one of the several variants of the LINUX
  * inode-subsystem with added complexity of the diskquota system.
- * 
+ *
  * Author:     Marco van Wieringen <mvw@planets.elm.net>
  *
  * Fixes:   Dmitry Gorodchanin <pgmdsg@ibi.com>, 11 Feb 96
@@ -51,7 +51,7 @@
  *             Added journalled quota support, fix lock inversion problems
  *             Jan Kara, <jack@suse.cz>, 2003,2004
  *
- * (C) Copyright 1994 - 1997 Marco van Wieringen 
+ * (C) Copyright 1994 - 1997 Marco van Wieringen
  */
 
 #include <linux/errno.h>
@@ -197,7 +197,7 @@ static struct quota_format_type *find_quota_format(int id)
                int qm;
 
                spin_unlock(&dq_list_lock);
-               
+
                for (qm = 0; module_names[qm].qm_fmt_id &&
                             module_names[qm].qm_fmt_id != id; qm++)
                        ;
@@ -424,10 +424,11 @@ int dquot_acquire(struct dquot *dquot)
        struct quota_info *dqopt = sb_dqopt(dquot->dq_sb);
 
        mutex_lock(&dquot->dq_lock);
-       if (!test_bit(DQ_READ_B, &dquot->dq_flags))
+       if (!test_bit(DQ_READ_B, &dquot->dq_flags)) {
                ret = dqopt->ops[dquot->dq_id.type]->read_dqblk(dquot);
-       if (ret < 0)
-               goto out_iolock;
+               if (ret < 0)
+                       goto out_iolock;
+       }
        /* Make sure flags update is visible after dquot has been filled */
        smp_mb__before_atomic();
        set_bit(DQ_READ_B, &dquot->dq_flags);
@@ -1049,7 +1050,9 @@ static void remove_dquot_ref(struct super_block *sb, int type,
                struct list_head *tofree_head)
 {
        struct inode *inode;
+#ifdef CONFIG_QUOTA_DEBUG
        int reserved = 0;
+#endif
 
        spin_lock(&sb->s_inode_list_lock);
        list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
@@ -1061,8 +1064,10 @@ static void remove_dquot_ref(struct super_block *sb, int type,
                 */
                spin_lock(&dq_data_lock);
                if (!IS_NOQUOTA(inode)) {
+#ifdef CONFIG_QUOTA_DEBUG
                        if (unlikely(inode_get_rsv_space(inode) > 0))
                                reserved = 1;
+#endif
                        remove_inode_dquot_ref(inode, type, tofree_head);
                }
                spin_unlock(&dq_data_lock);
@@ -1663,7 +1668,7 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags)
        for (cnt = 0; cnt < MAXQUOTAS; cnt++) {
                if (!dquots[cnt])
                        continue;
-               if (flags & DQUOT_SPACE_RESERVE) {
+               if (reserve) {
                        ret = dquot_add_space(dquots[cnt], 0, number, flags,
                                              &warn[cnt]);
                } else {
@@ -1676,13 +1681,11 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags)
                                if (!dquots[cnt])
                                        continue;
                                spin_lock(&dquots[cnt]->dq_dqb_lock);
-                               if (flags & DQUOT_SPACE_RESERVE) {
-                                       dquots[cnt]->dq_dqb.dqb_rsvspace -=
-                                                                       number;
-                               } else {
-                                       dquots[cnt]->dq_dqb.dqb_curspace -=
-                                                                       number;
-                               }
+                               if (reserve)
+                                       dquot_free_reserved_space(dquots[cnt],
+                                                                 number);
+                               else
+                                       dquot_decr_space(dquots[cnt], number);
                                spin_unlock(&dquots[cnt]->dq_dqb_lock);
                        }
                        spin_unlock(&inode->i_lock);
@@ -1733,7 +1736,7 @@ int dquot_alloc_inode(struct inode *inode)
                                        continue;
                                /* Back out changes we already did */
                                spin_lock(&dquots[cnt]->dq_dqb_lock);
-                               dquots[cnt]->dq_dqb.dqb_curinodes--;
+                               dquot_decr_inodes(dquots[cnt], 1);
                                spin_unlock(&dquots[cnt]->dq_dqb_lock);
                        }
                        goto warn_put_all;
@@ -2397,7 +2400,7 @@ out_file_flags:
 out_fmt:
        put_quota_format(fmt);
 
-       return error; 
+       return error;
 }
 
 /* Reenable quotas on remount RW */
@@ -2775,7 +2778,7 @@ int dquot_get_state(struct super_block *sb, struct qc_state *state)
        struct qc_type_state *tstate;
        struct quota_info *dqopt = sb_dqopt(sb);
        int type;
-  
+
        memset(state, 0, sizeof(*state));
        for (type = 0; type < MAXQUOTAS; type++) {
                if (!sb_has_quota_active(sb, type))
index 7ac5298aba70bc7d48c96d85fae88759a7680eb8..9f2b2573b83cc1bf90e35cfdf656636d9224075e 100644 (file)
@@ -127,7 +127,7 @@ static int v1_check_quota_file(struct super_block *sb, int type)
 {
        struct inode *inode = sb_dqopt(sb)->files[type];
        ulong blocks;
-       size_t off; 
+       size_t off;
        struct v2_disk_dqheader dqhead;
        ssize_t size;
        loff_t isize;
index a73e5b34db4181272bc943c4e0ea406797ff0311..3c30034e733f40abcc8f26849afde4ee1b3df4ae 100644 (file)
@@ -78,7 +78,7 @@ static int v2_check_quota_file(struct super_block *sb, int type)
        struct v2_disk_dqheader dqhead;
        static const uint quota_magics[] = V2_INITQMAGICS;
        static const uint quota_versions[] = V2_INITQVERSIONS;
+
        if (v2_read_header(sb, type, &dqhead))
                return 0;
        if (le32_to_cpu(dqhead.dqh_magic) != quota_magics[type] ||
index 8a76f9d14bc661c5a6760d7815ac1e97352f8e0c..36346dc4cec0ee5a144c1394850ef4f526885d47 100644 (file)
@@ -1844,7 +1844,7 @@ static int flush_used_journal_lists(struct super_block *s,
  * removes any nodes in table with name block and dev as bh.
  * only touchs the hnext and hprev pointers.
  */
-void remove_journal_hash(struct super_block *sb,
+static void remove_journal_hash(struct super_block *sb,
                         struct reiserfs_journal_cnode **table,
                         struct reiserfs_journal_list *jl,
                         unsigned long block, int remove_freed)
index 58cc2414992b673296ff2d9408c62f3bd07b6f35..77b6d89b9bcdd154c14768afd5aa458ece5f9234 100644 (file)
@@ -304,21 +304,6 @@ static struct dentry *udf_lookup(struct inode *dir, struct dentry *dentry,
        if (dentry->d_name.len > UDF_NAME_LEN)
                return ERR_PTR(-ENAMETOOLONG);
 
-#ifdef UDF_RECOVERY
-       /* temporary shorthand for specifying files by inode number */
-       if (!strncmp(dentry->d_name.name, ".B=", 3)) {
-               struct kernel_lb_addr lb = {
-                       .logicalBlockNum = 0,
-                       .partitionReferenceNum =
-                               simple_strtoul(dentry->d_name.name + 3,
-                                               NULL, 0),
-               };
-               inode = udf_iget(dir->i_sb, lb);
-               if (IS_ERR(inode))
-                       return inode;
-       } else
-#endif /* UDF_RECOVERY */
-
        fi = udf_find_entry(dir, &dentry->d_name, &fibh, &cfi);
        if (IS_ERR(fi))
                return ERR_CAST(fi);
index f64691f2168a3b8d8e1515f89e7ef5e60fefd7b5..a143461373614bd295f37739036a6edb54a48885 100644 (file)
@@ -566,6 +566,11 @@ static int udf_parse_options(char *options, struct udf_options *uopt,
                        if (!remount) {
                                if (uopt->nls_map)
                                        unload_nls(uopt->nls_map);
+                               /*
+                                * load_nls() failure is handled later in
+                                * udf_fill_super() after all options are
+                                * parsed.
+                                */
                                uopt->nls_map = load_nls(args[0].from);
                                uopt->flags |= (1 << UDF_FLAG_NLS_MAP);
                        }