Commit 6a945f38 authored by Linus Torvalds's avatar Linus Torvalds

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
parents 50fc88cb 08261673
...@@ -32,6 +32,7 @@ const struct inode_operations ext2_symlink_inode_operations = { ...@@ -32,6 +32,7 @@ const struct inode_operations ext2_symlink_inode_operations = {
.readlink = generic_readlink, .readlink = generic_readlink,
.follow_link = page_follow_link_light, .follow_link = page_follow_link_light,
.put_link = page_put_link, .put_link = page_put_link,
.setattr = ext2_setattr,
#ifdef CONFIG_EXT2_FS_XATTR #ifdef CONFIG_EXT2_FS_XATTR
.setxattr = generic_setxattr, .setxattr = generic_setxattr,
.getxattr = generic_getxattr, .getxattr = generic_getxattr,
...@@ -43,6 +44,7 @@ const struct inode_operations ext2_symlink_inode_operations = { ...@@ -43,6 +44,7 @@ const struct inode_operations ext2_symlink_inode_operations = {
const struct inode_operations ext2_fast_symlink_inode_operations = { const struct inode_operations ext2_fast_symlink_inode_operations = {
.readlink = generic_readlink, .readlink = generic_readlink,
.follow_link = ext2_follow_link, .follow_link = ext2_follow_link,
.setattr = ext2_setattr,
#ifdef CONFIG_EXT2_FS_XATTR #ifdef CONFIG_EXT2_FS_XATTR
.setxattr = generic_setxattr, .setxattr = generic_setxattr,
.getxattr = generic_getxattr, .getxattr = generic_getxattr,
......
...@@ -34,6 +34,7 @@ const struct inode_operations ext3_symlink_inode_operations = { ...@@ -34,6 +34,7 @@ const struct inode_operations ext3_symlink_inode_operations = {
.readlink = generic_readlink, .readlink = generic_readlink,
.follow_link = page_follow_link_light, .follow_link = page_follow_link_light,
.put_link = page_put_link, .put_link = page_put_link,
.setattr = ext3_setattr,
#ifdef CONFIG_EXT3_FS_XATTR #ifdef CONFIG_EXT3_FS_XATTR
.setxattr = generic_setxattr, .setxattr = generic_setxattr,
.getxattr = generic_getxattr, .getxattr = generic_getxattr,
...@@ -45,6 +46,7 @@ const struct inode_operations ext3_symlink_inode_operations = { ...@@ -45,6 +46,7 @@ const struct inode_operations ext3_symlink_inode_operations = {
const struct inode_operations ext3_fast_symlink_inode_operations = { const struct inode_operations ext3_fast_symlink_inode_operations = {
.readlink = generic_readlink, .readlink = generic_readlink,
.follow_link = ext3_follow_link, .follow_link = ext3_follow_link,
.setattr = ext3_setattr,
#ifdef CONFIG_EXT3_FS_XATTR #ifdef CONFIG_EXT3_FS_XATTR
.setxattr = generic_setxattr, .setxattr = generic_setxattr,
.getxattr = generic_getxattr, .getxattr = generic_getxattr,
......
...@@ -874,14 +874,18 @@ static int dqinit_needed(struct inode *inode, int type) ...@@ -874,14 +874,18 @@ static int dqinit_needed(struct inode *inode, int type)
static void add_dquot_ref(struct super_block *sb, int type) static void add_dquot_ref(struct super_block *sb, int type)
{ {
struct inode *inode, *old_inode = NULL; struct inode *inode, *old_inode = NULL;
#ifdef __DQUOT_PARANOIA
int reserved = 0; int reserved = 0;
#endif
spin_lock(&inode_lock); spin_lock(&inode_lock);
list_for_each_entry(inode, &sb->s_inodes, i_sb_list) { list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW)) if (inode->i_state & (I_FREEING|I_CLEAR|I_WILL_FREE|I_NEW))
continue; continue;
#ifdef __DQUOT_PARANOIA
if (unlikely(inode_get_rsv_space(inode) > 0)) if (unlikely(inode_get_rsv_space(inode) > 0))
reserved = 1; reserved = 1;
#endif
if (!atomic_read(&inode->i_writecount)) if (!atomic_read(&inode->i_writecount))
continue; continue;
if (!dqinit_needed(inode, type)) if (!dqinit_needed(inode, type))
...@@ -903,11 +907,13 @@ static void add_dquot_ref(struct super_block *sb, int type) ...@@ -903,11 +907,13 @@ static void add_dquot_ref(struct super_block *sb, int type)
spin_unlock(&inode_lock); spin_unlock(&inode_lock);
iput(old_inode); iput(old_inode);
#ifdef __DQUOT_PARANOIA
if (reserved) { if (reserved) {
printk(KERN_WARNING "VFS (%s): Writes happened before quota" printk(KERN_WARNING "VFS (%s): Writes happened before quota"
" was turned on thus quota information is probably " " was turned on thus quota information is probably "
"inconsistent. Please run quotacheck(8).\n", sb->s_id); "inconsistent. Please run quotacheck(8).\n", sb->s_id);
} }
#endif
} }
/* /*
...@@ -2322,34 +2328,34 @@ static int do_set_dqblk(struct dquot *dquot, struct if_dqblk *di) ...@@ -2322,34 +2328,34 @@ static int do_set_dqblk(struct dquot *dquot, struct if_dqblk *di)
if (di->dqb_valid & QIF_SPACE) { if (di->dqb_valid & QIF_SPACE) {
dm->dqb_curspace = di->dqb_curspace - dm->dqb_rsvspace; dm->dqb_curspace = di->dqb_curspace - dm->dqb_rsvspace;
check_blim = 1; check_blim = 1;
__set_bit(DQ_LASTSET_B + QIF_SPACE_B, &dquot->dq_flags); set_bit(DQ_LASTSET_B + QIF_SPACE_B, &dquot->dq_flags);
} }
if (di->dqb_valid & QIF_BLIMITS) { if (di->dqb_valid & QIF_BLIMITS) {
dm->dqb_bsoftlimit = qbtos(di->dqb_bsoftlimit); dm->dqb_bsoftlimit = qbtos(di->dqb_bsoftlimit);
dm->dqb_bhardlimit = qbtos(di->dqb_bhardlimit); dm->dqb_bhardlimit = qbtos(di->dqb_bhardlimit);
check_blim = 1; check_blim = 1;
__set_bit(DQ_LASTSET_B + QIF_BLIMITS_B, &dquot->dq_flags); set_bit(DQ_LASTSET_B + QIF_BLIMITS_B, &dquot->dq_flags);
} }
if (di->dqb_valid & QIF_INODES) { if (di->dqb_valid & QIF_INODES) {
dm->dqb_curinodes = di->dqb_curinodes; dm->dqb_curinodes = di->dqb_curinodes;
check_ilim = 1; check_ilim = 1;
__set_bit(DQ_LASTSET_B + QIF_INODES_B, &dquot->dq_flags); set_bit(DQ_LASTSET_B + QIF_INODES_B, &dquot->dq_flags);
} }
if (di->dqb_valid & QIF_ILIMITS) { if (di->dqb_valid & QIF_ILIMITS) {
dm->dqb_isoftlimit = di->dqb_isoftlimit; dm->dqb_isoftlimit = di->dqb_isoftlimit;
dm->dqb_ihardlimit = di->dqb_ihardlimit; dm->dqb_ihardlimit = di->dqb_ihardlimit;
check_ilim = 1; check_ilim = 1;
__set_bit(DQ_LASTSET_B + QIF_ILIMITS_B, &dquot->dq_flags); set_bit(DQ_LASTSET_B + QIF_ILIMITS_B, &dquot->dq_flags);
} }
if (di->dqb_valid & QIF_BTIME) { if (di->dqb_valid & QIF_BTIME) {
dm->dqb_btime = di->dqb_btime; dm->dqb_btime = di->dqb_btime;
check_blim = 1; check_blim = 1;
__set_bit(DQ_LASTSET_B + QIF_BTIME_B, &dquot->dq_flags); set_bit(DQ_LASTSET_B + QIF_BTIME_B, &dquot->dq_flags);
} }
if (di->dqb_valid & QIF_ITIME) { if (di->dqb_valid & QIF_ITIME) {
dm->dqb_itime = di->dqb_itime; dm->dqb_itime = di->dqb_itime;
check_ilim = 1; check_ilim = 1;
__set_bit(DQ_LASTSET_B + QIF_ITIME_B, &dquot->dq_flags); set_bit(DQ_LASTSET_B + QIF_ITIME_B, &dquot->dq_flags);
} }
if (check_blim) { if (check_blim) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment