ext4: clear lockdep subtype for quota files on quota off
[sfrench/cifs-2.6.git] / fs / ext4 / super.c
index c90edf09b0c3172f94737ed1e926464fd2e8b156..8f05c72bc4ec7c08361513b5689334fa6a71ae77 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/ctype.h>
 #include <linux/log2.h>
 #include <linux/crc16.h>
+#include <linux/dax.h>
 #include <linux/cleancache.h>
 #include <linux/uaccess.h>
 
@@ -847,14 +848,9 @@ static inline void ext4_quota_off_umount(struct super_block *sb)
 {
        int type;
 
-       if (ext4_has_feature_quota(sb)) {
-               dquot_disable(sb, -1,
-                             DQUOT_USAGE_ENABLED | DQUOT_LIMITS_ENABLED);
-       } else {
-               /* Use our quota_off function to clear inode flags etc. */
-               for (type = 0; type < EXT4_MAXQUOTAS; type++)
-                       ext4_quota_off(sb, type);
-       }
+       /* Use our quota_off function to clear inode flags etc. */
+       for (type = 0; type < EXT4_MAXQUOTAS; type++)
+               ext4_quota_off(sb, type);
 }
 #else
 static inline void ext4_quota_off_umount(struct super_block *sb)
@@ -5484,7 +5480,7 @@ static int ext4_quota_off(struct super_block *sb, int type)
                goto out;
 
        err = dquot_quota_off(sb, type);
-       if (err)
+       if (err || ext4_has_feature_quota(sb))
                goto out_put;
 
        inode_lock(inode);
@@ -5504,6 +5500,7 @@ static int ext4_quota_off(struct super_block *sb, int type)
 out_unlock:
        inode_unlock(inode);
 out_put:
+       lockdep_set_quota_inode(inode, I_DATA_SEM_NORMAL);
        iput(inode);
        return err;
 out: