summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/dquot.c10
-rw-r--r--include/linux/quotaops.h6
2 files changed, 10 insertions, 6 deletions
diff --git a/fs/dquot.c b/fs/dquot.c
index c88330602dd..22340c610e1 100644
--- a/fs/dquot.c
+++ b/fs/dquot.c
@@ -1570,18 +1570,20 @@ static inline void reset_enable_flags(struct quota_info *dqopt, int type,
{
switch (type) {
case USRQUOTA:
- dqopt->flags &= ~DQUOT_USR_ENABLED;
if (remount)
dqopt->flags |= DQUOT_USR_SUSPENDED;
- else
+ else {
+ dqopt->flags &= ~DQUOT_USR_ENABLED;
dqopt->flags &= ~DQUOT_USR_SUSPENDED;
+ }
break;
case GRPQUOTA:
- dqopt->flags &= ~DQUOT_GRP_ENABLED;
if (remount)
dqopt->flags |= DQUOT_GRP_SUSPENDED;
- else
+ else {
+ dqopt->flags &= ~DQUOT_GRP_ENABLED;
dqopt->flags &= ~DQUOT_GRP_SUSPENDED;
+ }
break;
}
}
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index adcc7ba3acc..ffd97071cd1 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -67,8 +67,10 @@ static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type)
static inline int sb_has_quota_enabled(struct super_block *sb, int type)
{
if (type == USRQUOTA)
- return sb_dqopt(sb)->flags & DQUOT_USR_ENABLED;
- return sb_dqopt(sb)->flags & DQUOT_GRP_ENABLED;
+ return (sb_dqopt(sb)->flags & DQUOT_USR_ENABLED)
+ && !(sb_dqopt(sb)->flags & DQUOT_USR_SUSPENDED);
+ return (sb_dqopt(sb)->flags & DQUOT_GRP_ENABLED)
+ && !(sb_dqopt(sb)->flags & DQUOT_GROUP_SUSPENDED);
}
static inline int sb_any_quota_enabled(struct super_block *sb)