summary refs log tree commit diff
path: root/fs/quota
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2017-11-14 11:09:53 +0100
committerJan Kara <jack@suse.cz>2017-11-14 11:09:53 +0100
commit838bee9e756ec46e9b5be25f9e44388d7e185a2a (patch)
treeebabacacc94478173d2707ea3f931a79b7bae214 /fs/quota
parentac3d79392f8c2728f7600dd32ed88b3a1bfdc1af (diff)
parent88d8ff976abdad043cc37dc1b4f01d93603842d7 (diff)
downloadlinux-838bee9e756ec46e9b5be25f9e44388d7e185a2a.tar.gz
Merge udf, isofs, quota, ext2 changes for 4.15-rc1.
Diffstat (limited to 'fs/quota')
-rw-r--r--fs/quota/dquot.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
index 52ad15192e72..5db18c0582c8 100644
--- a/fs/quota/dquot.c
+++ b/fs/quota/dquot.c
@@ -644,8 +644,15 @@ int dquot_writeback_dquots(struct super_block *sb, int type)
 			spin_unlock(&dq_list_lock);
 			dqstats_inc(DQST_LOOKUPS);
 			err = sb->dq_op->write_dquot(dquot);
-			if (!ret && err)
-				ret = err;
+			if (err) {
+				/*
+				 * Clear dirty bit anyway to avoid infinite
+				 * loop here.
+				 */
+				clear_dquot_dirty(dquot);
+				if (!ret)
+					ret = err;
+			}
 			dqput(dquot);
 			spin_lock(&dq_list_lock);
 		}
@@ -2138,7 +2145,7 @@ int dquot_file_open(struct inode *inode, struct file *file)
 
 	error = generic_file_open(inode, file);
 	if (!error && (file->f_mode & FMODE_WRITE))
-		dquot_initialize(inode);
+		error = dquot_initialize(inode);
 	return error;
 }
 EXPORT_SYMBOL(dquot_file_open);