diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-27 15:22:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-27 15:22:12 -0400 |
commit | 9cd6681cb1169e815c41af0265165dd1b872f228 (patch) | |
tree | 9c2c26d366be9cc5cbb1888da24bf0343813b71d | |
parent | 225d3b67482930ff5a9f49ad307deffd97ce04c1 (diff) | |
parent | 4c6bb69663b3a3f2db8f488356e96acb5460f25f (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull quota and isofs fixes from Jan Kara:
"Two quota fixes (fallout of the quota locking changes) and an isofs
build fix"
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
quota: Fix quota corruption with generic/232 test
isofs: fix build regression
quota: add missing lock into __dquot_transfer()
-rw-r--r-- | fs/isofs/inode.c | 2 | ||||
-rw-r--r-- | fs/quota/dquot.c | 2 | ||||
-rw-r--r-- | fs/quota/quota_v2.c | 4 |
3 files changed, 8 insertions, 0 deletions
diff --git a/fs/isofs/inode.c b/fs/isofs/inode.c index db692f554158..447a24d77b89 100644 --- a/fs/isofs/inode.c +++ b/fs/isofs/inode.c | |||
@@ -514,9 +514,11 @@ static int isofs_show_options(struct seq_file *m, struct dentry *root) | |||
514 | if (sbi->s_fmode != ISOFS_INVALID_MODE) | 514 | if (sbi->s_fmode != ISOFS_INVALID_MODE) |
515 | seq_printf(m, ",fmode=%o", sbi->s_fmode); | 515 | seq_printf(m, ",fmode=%o", sbi->s_fmode); |
516 | 516 | ||
517 | #ifdef CONFIG_JOLIET | ||
517 | if (sbi->s_nls_iocharset && | 518 | if (sbi->s_nls_iocharset && |
518 | strcmp(sbi->s_nls_iocharset->charset, CONFIG_NLS_DEFAULT) != 0) | 519 | strcmp(sbi->s_nls_iocharset->charset, CONFIG_NLS_DEFAULT) != 0) |
519 | seq_printf(m, ",iocharset=%s", sbi->s_nls_iocharset->charset); | 520 | seq_printf(m, ",iocharset=%s", sbi->s_nls_iocharset->charset); |
521 | #endif | ||
520 | return 0; | 522 | return 0; |
521 | } | 523 | } |
522 | 524 | ||
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 8381db9db6d9..50b0556a124f 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c | |||
@@ -1980,7 +1980,9 @@ int __dquot_transfer(struct inode *inode, struct dquot **transfer_to) | |||
1980 | ret = dquot_add_space(transfer_to[cnt], cur_space, rsv_space, 0, | 1980 | ret = dquot_add_space(transfer_to[cnt], cur_space, rsv_space, 0, |
1981 | &warn_to[cnt]); | 1981 | &warn_to[cnt]); |
1982 | if (ret) { | 1982 | if (ret) { |
1983 | spin_lock(&transfer_to[cnt]->dq_dqb_lock); | ||
1983 | dquot_decr_inodes(transfer_to[cnt], inode_usage); | 1984 | dquot_decr_inodes(transfer_to[cnt], inode_usage); |
1985 | spin_unlock(&transfer_to[cnt]->dq_dqb_lock); | ||
1984 | goto over_quota; | 1986 | goto over_quota; |
1985 | } | 1987 | } |
1986 | } | 1988 | } |
diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c index c0187cda2c1e..a73e5b34db41 100644 --- a/fs/quota/quota_v2.c +++ b/fs/quota/quota_v2.c | |||
@@ -328,12 +328,16 @@ static int v2_write_dquot(struct dquot *dquot) | |||
328 | if (!dquot->dq_off) { | 328 | if (!dquot->dq_off) { |
329 | alloc = true; | 329 | alloc = true; |
330 | down_write(&dqopt->dqio_sem); | 330 | down_write(&dqopt->dqio_sem); |
331 | } else { | ||
332 | down_read(&dqopt->dqio_sem); | ||
331 | } | 333 | } |
332 | ret = qtree_write_dquot( | 334 | ret = qtree_write_dquot( |
333 | sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv, | 335 | sb_dqinfo(dquot->dq_sb, dquot->dq_id.type)->dqi_priv, |
334 | dquot); | 336 | dquot); |
335 | if (alloc) | 337 | if (alloc) |
336 | up_write(&dqopt->dqio_sem); | 338 | up_write(&dqopt->dqio_sem); |
339 | else | ||
340 | up_read(&dqopt->dqio_sem); | ||
337 | return ret; | 341 | return ret; |
338 | } | 342 | } |
339 | 343 | ||