diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-04-12 21:36:49 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-04-12 21:36:49 -0400 |
| commit | 6a945f38be5f2c198853069a336c887a51d1a238 (patch) | |
| tree | 439a2082a75d8496dbc9cfe6f661df4b86ea43ba | |
| parent | 50fc88cb03786a79e9982d9d8dfb3fd225de9099 (diff) | |
| parent | 08261673cb6dc638c39f44d69b76fffb57b92a8b (diff) | |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6:
quota: Fix possible dq_flags corruption
quota: Hide warnings about writes to the filesystem before quota was turned on
ext3: symlink must be handled via filesystem specific operation
ext2: symlink must be handled via filesystem specific operation
| -rw-r--r-- | fs/ext2/symlink.c | 2 | ||||
| -rw-r--r-- | fs/ext3/symlink.c | 2 | ||||
| -rw-r--r-- | fs/quota/dquot.c | 18 |
3 files changed, 16 insertions, 6 deletions
diff --git a/fs/ext2/symlink.c b/fs/ext2/symlink.c index 4e2426e22bbe..565cf817bbf1 100644 --- a/fs/ext2/symlink.c +++ b/fs/ext2/symlink.c | |||
| @@ -32,6 +32,7 @@ const struct inode_operations ext2_symlink_inode_operations = { | |||
| 32 | .readlink = generic_readlink, | 32 | .readlink = generic_readlink, |
| 33 | .follow_link = page_follow_link_light, | 33 | .follow_link = page_follow_link_light, |
| 34 | .put_link = page_put_link, | 34 | .put_link = page_put_link, |
| 35 | .setattr = ext2_setattr, | ||
| 35 | #ifdef CONFIG_EXT2_FS_XATTR | 36 | #ifdef CONFIG_EXT2_FS_XATTR |
| 36 | .setxattr = generic_setxattr, | 37 | .setxattr = generic_setxattr, |
| 37 | .getxattr = generic_getxattr, | 38 | .getxattr = generic_getxattr, |
| @@ -43,6 +44,7 @@ const struct inode_operations ext2_symlink_inode_operations = { | |||
| 43 | const struct inode_operations ext2_fast_symlink_inode_operations = { | 44 | const struct inode_operations ext2_fast_symlink_inode_operations = { |
| 44 | .readlink = generic_readlink, | 45 | .readlink = generic_readlink, |
| 45 | .follow_link = ext2_follow_link, | 46 | .follow_link = ext2_follow_link, |
| 47 | .setattr = ext2_setattr, | ||
| 46 | #ifdef CONFIG_EXT2_FS_XATTR | 48 | #ifdef CONFIG_EXT2_FS_XATTR |
| 47 | .setxattr = generic_setxattr, | 49 | .setxattr = generic_setxattr, |
| 48 | .getxattr = generic_getxattr, | 50 | .getxattr = generic_getxattr, |
diff --git a/fs/ext3/symlink.c b/fs/ext3/symlink.c index ff7b4ccd8983..7c4898207776 100644 --- a/fs/ext3/symlink.c +++ b/fs/ext3/symlink.c | |||
| @@ -34,6 +34,7 @@ const struct inode_operations ext3_symlink_inode_operations = { | |||
| 34 | .readlink = generic_readlink, | 34 | .readlink = generic_readlink, |
| 35 | .follow_link = page_follow_link_light, | 35 | .follow_link = page_follow_link_light, |
| 36 | .put_link = page_put_link, | 36 | .put_link = page_put_link, |
| 37 | .setattr = ext3_setattr, | ||
| 37 | #ifdef CONFIG_EXT3_FS_XATTR | 38 | #ifdef CONFIG_EXT3_FS_XATTR |
| 38 | .setxattr = generic_setxattr, | 39 | .setxattr = generic_setxattr, |
| 39 | .getxattr = generic_getxattr, | 40 | .getxattr = generic_getxattr, |
| @@ -45,6 +46,7 @@ const struct inode_operations ext3_symlink_inode_operations = { | |||
| 45 | const struct inode_operations ext3_fast_symlink_inode_operations = { | 46 | const struct inode_operations ext3_fast_symlink_inode_operations = { |
| 46 | .readlink = generic_readlink, | 47 | .readlink = generic_readlink, |
| 47 | .follow_link = ext3_follow_link, | 48 | .follow_link = ext3_follow_link, |
| 49 | .setattr = ext3_setattr, | ||
| 48 | #ifdef CONFIG_EXT3_FS_XATTR | 50 | #ifdef CONFIG_EXT3_FS_XATTR |
| 49 | .setxattr = generic_setxattr, | 51 | .setxattr = generic_setxattr, |
| 50 | .getxattr = generic_getxattr, | 52 | .getxattr = generic_getxattr, |
diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index e0b870f4749f..a0a9405b202a 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) { |
