diff options
Diffstat (limited to 'fs/quota')
-rw-r--r-- | fs/quota/dquot.c | 18 | ||||
-rw-r--r-- | fs/quota/netlink.c | 1 |
2 files changed, 13 insertions, 6 deletions
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index e0b870f4749..a0a9405b202 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c | |||
@@ -874,14 +874,18 @@ static int dqinit_needed(struct inode *inode, int type) | |||
874 | static void add_dquot_ref(struct super_block *sb, int type) | 874 | static void add_dquot_ref(struct super_block *sb, int type) |
875 | { | 875 | { |
876 | struct inode *inode, *old_inode = NULL; | 876 | struct inode *inode, *old_inode = NULL; |
877 | #ifdef __DQUOT_PARANOIA | ||
877 | int reserved = 0; | 878 | int reserved = 0; |
879 | #endif | ||
878 | 880 | ||
879 | spin_lock(&inode_lock); | 881 | spin_lock(&inode_lock); |
880 | list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { | 882 | list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { |
881 | if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW)) | 883 | if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW)) |
882 | continue; | 884 | continue; |
885 | #ifdef __DQUOT_PARANOIA | ||
883 | if (unlikely(inode_get_rsv_space(inode) > 0)) | 886 | if (unlikely(inode_get_rsv_space(inode) > 0)) |
884 | reserved = 1; | 887 | reserved = 1; |
888 | #endif | ||
885 | if (!atomic_read(&inode->i_writecount)) | 889 | if (!atomic_read(&inode->i_writecount)) |
886 | continue; | 890 | continue; |
887 | if (!dqinit_needed(inode, type)) | 891 | if (!dqinit_needed(inode, type)) |
@@ -903,11 +907,13 @@ static void add_dquot_ref(struct super_block *sb, int type) | |||
903 | spin_unlock(&inode_lock); | 907 | spin_unlock(&inode_lock); |
904 | iput(old_inode); | 908 | iput(old_inode); |
905 | 909 | ||
910 | #ifdef __DQUOT_PARANOIA | ||
906 | if (reserved) { | 911 | if (reserved) { |
907 | printk(KERN_WARNING "VFS (%s): Writes happened before quota" | 912 | printk(KERN_WARNING "VFS (%s): Writes happened before quota" |
908 | " was turned on thus quota information is probably " | 913 | " was turned on thus quota information is probably " |
909 | "inconsistent. Please run quotacheck(8).\n", sb->s_id); | 914 | "inconsistent. Please run quotacheck(8).\n", sb->s_id); |
910 | } | 915 | } |
916 | #endif | ||
911 | } | 917 | } |
912 | 918 | ||
913 | /* | 919 | /* |
@@ -2322,34 +2328,34 @@ static int do_set_dqblk(struct dquot *dquot, struct if_dqblk *di) | |||
2322 | if (di->dqb_valid & QIF_SPACE) { | 2328 | if (di->dqb_valid & QIF_SPACE) { |
2323 | dm->dqb_curspace = di->dqb_curspace - dm->dqb_rsvspace; | 2329 | dm->dqb_curspace = di->dqb_curspace - dm->dqb_rsvspace; |
2324 | check_blim = 1; | 2330 | check_blim = 1; |
2325 | __set_bit(DQ_LASTSET_B + QIF_SPACE_B, &dquot->dq_flags); | 2331 | set_bit(DQ_LASTSET_B + QIF_SPACE_B, &dquot->dq_flags); |
2326 | } | 2332 | } |
2327 | if (di->dqb_valid & QIF_BLIMITS) { | 2333 | if (di->dqb_valid & QIF_BLIMITS) { |
2328 | dm->dqb_bsoftlimit = qbtos(di->dqb_bsoftlimit); | 2334 | dm->dqb_bsoftlimit = qbtos(di->dqb_bsoftlimit); |
2329 | dm->dqb_bhardlimit = qbtos(di->dqb_bhardlimit); | 2335 | dm->dqb_bhardlimit = qbtos(di->dqb_bhardlimit); |
2330 | check_blim = 1; | 2336 | check_blim = 1; |
2331 | __set_bit(DQ_LASTSET_B + QIF_BLIMITS_B, &dquot->dq_flags); | 2337 | set_bit(DQ_LASTSET_B + QIF_BLIMITS_B, &dquot->dq_flags); |
2332 | } | 2338 | } |
2333 | if (di->dqb_valid & QIF_INODES) { | 2339 | if (di->dqb_valid & QIF_INODES) { |
2334 | dm->dqb_curinodes = di->dqb_curinodes; | 2340 | dm->dqb_curinodes = di->dqb_curinodes; |
2335 | check_ilim = 1; | 2341 | check_ilim = 1; |
2336 | __set_bit(DQ_LASTSET_B + QIF_INODES_B, &dquot->dq_flags); | 2342 | set_bit(DQ_LASTSET_B + QIF_INODES_B, &dquot->dq_flags); |
2337 | } | 2343 | } |
2338 | if (di->dqb_valid & QIF_ILIMITS) { | 2344 | if (di->dqb_valid & QIF_ILIMITS) { |
2339 | dm->dqb_isoftlimit = di->dqb_isoftlimit; | 2345 | dm->dqb_isoftlimit = di->dqb_isoftlimit; |
2340 | dm->dqb_ihardlimit = di->dqb_ihardlimit; | 2346 | dm->dqb_ihardlimit = di->dqb_ihardlimit; |
2341 | check_ilim = 1; | 2347 | check_ilim = 1; |
2342 | __set_bit(DQ_LASTSET_B + QIF_ILIMITS_B, &dquot->dq_flags); | 2348 | set_bit(DQ_LASTSET_B + QIF_ILIMITS_B, &dquot->dq_flags); |
2343 | } | 2349 | } |
2344 | if (di->dqb_valid & QIF_BTIME) { | 2350 | if (di->dqb_valid & QIF_BTIME) { |
2345 | dm->dqb_btime = di->dqb_btime; | 2351 | dm->dqb_btime = di->dqb_btime; |
2346 | check_blim = 1; | 2352 | check_blim = 1; |
2347 | __set_bit(DQ_LASTSET_B + QIF_BTIME_B, &dquot->dq_flags); | 2353 | set_bit(DQ_LASTSET_B + QIF_BTIME_B, &dquot->dq_flags); |
2348 | } | 2354 | } |
2349 | if (di->dqb_valid & QIF_ITIME) { | 2355 | if (di->dqb_valid & QIF_ITIME) { |
2350 | dm->dqb_itime = di->dqb_itime; | 2356 | dm->dqb_itime = di->dqb_itime; |
2351 | check_ilim = 1; | 2357 | check_ilim = 1; |
2352 | __set_bit(DQ_LASTSET_B + QIF_ITIME_B, &dquot->dq_flags); | 2358 | set_bit(DQ_LASTSET_B + QIF_ITIME_B, &dquot->dq_flags); |
2353 | } | 2359 | } |
2354 | 2360 | ||
2355 | if (check_blim) { | 2361 | if (check_blim) { |
diff --git a/fs/quota/netlink.c b/fs/quota/netlink.c index 2663ed90fb0..d67908b407d 100644 --- a/fs/quota/netlink.c +++ b/fs/quota/netlink.c | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
6 | #include <linux/quotaops.h> | 6 | #include <linux/quotaops.h> |
7 | #include <linux/sched.h> | 7 | #include <linux/sched.h> |
8 | #include <linux/slab.h> | ||
8 | #include <net/netlink.h> | 9 | #include <net/netlink.h> |
9 | #include <net/genetlink.h> | 10 | #include <net/genetlink.h> |
10 | 11 | ||