aboutsummaryrefslogtreecommitdiffstats
path: root/fs/quota/quota.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/quota/quota.c')
-rw-r--r--fs/quota/quota.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/quota/quota.c b/fs/quota/quota.c
index d0efe302b1c1..3d31228082ea 100644
--- a/fs/quota/quota.c
+++ b/fs/quota/quota.c
@@ -18,6 +18,7 @@
18#include <linux/capability.h> 18#include <linux/capability.h>
19#include <linux/quotaops.h> 19#include <linux/quotaops.h>
20#include <linux/types.h> 20#include <linux/types.h>
21#include <linux/writeback.h>
21#include <net/netlink.h> 22#include <net/netlink.h>
22#include <net/genetlink.h> 23#include <net/genetlink.h>
23 24
@@ -52,7 +53,7 @@ void sync_quota_sb(struct super_block *sb, int type)
52{ 53{
53 int cnt; 54 int cnt;
54 55
55 if (!sb->s_qcop->quota_sync) 56 if (!sb->s_qcop || !sb->s_qcop->quota_sync)
56 return; 57 return;
57 58
58 sb->s_qcop->quota_sync(sb, type); 59 sb->s_qcop->quota_sync(sb, type);
@@ -318,9 +319,11 @@ static int do_quotactl(struct super_block *sb, int type, int cmd, qid_t id,
318 case Q_XGETQUOTA: 319 case Q_XGETQUOTA:
319 return quota_getxquota(sb, type, id, addr); 320 return quota_getxquota(sb, type, id, addr);
320 case Q_XQUOTASYNC: 321 case Q_XQUOTASYNC:
321 if (!sb->s_qcop->quota_sync) 322 /* caller already holds s_umount */
322 return -ENOSYS; 323 if (sb->s_flags & MS_RDONLY)
323 return sb->s_qcop->quota_sync(sb, type); 324 return -EROFS;
325 writeback_inodes_sb(sb);
326 return 0;
324 default: 327 default:
325 return -EINVAL; 328 return -EINVAL;
326 } 329 }