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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull quota fix from Jan Kara:
"A fix for a regression in handling of quota grace times and warnings"

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
quota: Generate warnings for DQUOT_SPACE_NOFAIL allocations

+16 -11
+16 -11
fs/quota/dquot.c
··· 1297 1297 spin_lock(&dquot->dq_dqb_lock); 1298 1298 if (!sb_has_quota_limits_enabled(sb, dquot->dq_id.type) || 1299 1299 test_bit(DQ_FAKE_B, &dquot->dq_flags)) 1300 - goto add; 1300 + goto finish; 1301 1301 1302 1302 tspace = dquot->dq_dqb.dqb_curspace + dquot->dq_dqb.dqb_rsvspace 1303 1303 + space + rsv_space; 1304 - 1305 - if (flags & DQUOT_SPACE_NOFAIL) 1306 - goto add; 1307 1304 1308 1305 if (dquot->dq_dqb.dqb_bhardlimit && 1309 1306 tspace > dquot->dq_dqb.dqb_bhardlimit && ··· 1308 1311 if (flags & DQUOT_SPACE_WARN) 1309 1312 prepare_warning(warn, dquot, QUOTA_NL_BHARDWARN); 1310 1313 ret = -EDQUOT; 1311 - goto out; 1314 + goto finish; 1312 1315 } 1313 1316 1314 1317 if (dquot->dq_dqb.dqb_bsoftlimit && ··· 1319 1322 if (flags & DQUOT_SPACE_WARN) 1320 1323 prepare_warning(warn, dquot, QUOTA_NL_BSOFTLONGWARN); 1321 1324 ret = -EDQUOT; 1322 - goto out; 1325 + goto finish; 1323 1326 } 1324 1327 1325 1328 if (dquot->dq_dqb.dqb_bsoftlimit && ··· 1335 1338 * be always printed 1336 1339 */ 1337 1340 ret = -EDQUOT; 1338 - goto out; 1341 + goto finish; 1339 1342 } 1340 1343 } 1341 - add: 1342 - dquot->dq_dqb.dqb_rsvspace += rsv_space; 1343 - dquot->dq_dqb.dqb_curspace += space; 1344 - out: 1344 + finish: 1345 + /* 1346 + * We have to be careful and go through warning generation & grace time 1347 + * setting even if DQUOT_SPACE_NOFAIL is set. That's why we check it 1348 + * only here... 1349 + */ 1350 + if (flags & DQUOT_SPACE_NOFAIL) 1351 + ret = 0; 1352 + if (!ret) { 1353 + dquot->dq_dqb.dqb_rsvspace += rsv_space; 1354 + dquot->dq_dqb.dqb_curspace += space; 1355 + } 1345 1356 spin_unlock(&dquot->dq_dqb_lock); 1346 1357 return ret; 1347 1358 }