@@ -410,7 +410,7 @@ static inline int mark_all_dquot_dirty(struct dquot __rcu * const *dquots)
410
410
if (dquot )
411
411
/* Even in case of error we have to continue */
412
412
ret = mark_dquot_dirty (dquot );
413
- if (!err )
413
+ if (!err && ret < 0 )
414
414
err = ret ;
415
415
}
416
416
return err ;
@@ -1737,7 +1737,7 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags)
1737
1737
1738
1738
if (reserve )
1739
1739
goto out_flush_warn ;
1740
- mark_all_dquot_dirty (dquots );
1740
+ ret = mark_all_dquot_dirty (dquots );
1741
1741
out_flush_warn :
1742
1742
srcu_read_unlock (& dquot_srcu , index );
1743
1743
flush_warnings (warn );
@@ -1786,7 +1786,7 @@ int dquot_alloc_inode(struct inode *inode)
1786
1786
warn_put_all :
1787
1787
spin_unlock (& inode -> i_lock );
1788
1788
if (ret == 0 )
1789
- mark_all_dquot_dirty (dquots );
1789
+ ret = mark_all_dquot_dirty (dquots );
1790
1790
srcu_read_unlock (& dquot_srcu , index );
1791
1791
flush_warnings (warn );
1792
1792
return ret ;
@@ -1990,7 +1990,7 @@ int __dquot_transfer(struct inode *inode, struct dquot **transfer_to)
1990
1990
qsize_t inode_usage = 1 ;
1991
1991
struct dquot __rcu * * dquots ;
1992
1992
struct dquot * transfer_from [MAXQUOTAS ] = {};
1993
- int cnt , index , ret = 0 ;
1993
+ int cnt , index , ret = 0 , err ;
1994
1994
char is_valid [MAXQUOTAS ] = {};
1995
1995
struct dquot_warn warn_to [MAXQUOTAS ];
1996
1996
struct dquot_warn warn_from_inodes [MAXQUOTAS ];
@@ -2087,8 +2087,12 @@ int __dquot_transfer(struct inode *inode, struct dquot **transfer_to)
2087
2087
* mark_all_dquot_dirty().
2088
2088
*/
2089
2089
index = srcu_read_lock (& dquot_srcu );
2090
- mark_all_dquot_dirty ((struct dquot __rcu * * )transfer_from );
2091
- mark_all_dquot_dirty ((struct dquot __rcu * * )transfer_to );
2090
+ err = mark_all_dquot_dirty ((struct dquot __rcu * * )transfer_from );
2091
+ if (err < 0 )
2092
+ ret = err ;
2093
+ err = mark_all_dquot_dirty ((struct dquot __rcu * * )transfer_to );
2094
+ if (err < 0 )
2095
+ ret = err ;
2092
2096
srcu_read_unlock (& dquot_srcu , index );
2093
2097
2094
2098
flush_warnings (warn_to );
@@ -2098,7 +2102,7 @@ int __dquot_transfer(struct inode *inode, struct dquot **transfer_to)
2098
2102
for (cnt = 0 ; cnt < MAXQUOTAS ; cnt ++ )
2099
2103
if (is_valid [cnt ])
2100
2104
transfer_to [cnt ] = transfer_from [cnt ];
2101
- return 0 ;
2105
+ return ret ;
2102
2106
over_quota :
2103
2107
/* Back out changes we already did */
2104
2108
for (cnt -- ; cnt >= 0 ; cnt -- ) {
@@ -2726,6 +2730,7 @@ static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di)
2726
2730
struct mem_dqblk * dm = & dquot -> dq_dqb ;
2727
2731
int check_blim = 0 , check_ilim = 0 ;
2728
2732
struct mem_dqinfo * dqi = & sb_dqopt (dquot -> dq_sb )-> info [dquot -> dq_id .type ];
2733
+ int ret ;
2729
2734
2730
2735
if (di -> d_fieldmask & ~VFS_QC_MASK )
2731
2736
return - EINVAL ;
@@ -2807,8 +2812,9 @@ static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di)
2807
2812
else
2808
2813
set_bit (DQ_FAKE_B , & dquot -> dq_flags );
2809
2814
spin_unlock (& dquot -> dq_dqb_lock );
2810
- mark_dquot_dirty (dquot );
2811
-
2815
+ ret = mark_dquot_dirty (dquot );
2816
+ if (ret < 0 )
2817
+ return ret ;
2812
2818
return 0 ;
2813
2819
}
2814
2820
0 commit comments