aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext2')
-rw-r--r--fs/ext2/namei.c8
-rw-r--r--fs/ext2/super.c12
2 files changed, 13 insertions, 7 deletions
diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c
index f663a67d7bf0..73b0d9519836 100644
--- a/fs/ext2/namei.c
+++ b/fs/ext2/namei.c
@@ -41,8 +41,8 @@ static inline int ext2_add_nondir(struct dentry *dentry, struct inode *inode)
41{ 41{
42 int err = ext2_add_link(dentry, inode); 42 int err = ext2_add_link(dentry, inode);
43 if (!err) { 43 if (!err) {
44 d_instantiate(dentry, inode);
45 unlock_new_inode(inode); 44 unlock_new_inode(inode);
45 d_instantiate(dentry, inode);
46 return 0; 46 return 0;
47 } 47 }
48 inode_dec_link_count(inode); 48 inode_dec_link_count(inode);
@@ -55,7 +55,7 @@ static inline int ext2_add_nondir(struct dentry *dentry, struct inode *inode)
55 * Methods themselves. 55 * Methods themselves.
56 */ 56 */
57 57
58static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, struct nameidata *nd) 58static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, unsigned int flags)
59{ 59{
60 struct inode * inode; 60 struct inode * inode;
61 ino_t ino; 61 ino_t ino;
@@ -94,7 +94,7 @@ struct dentry *ext2_get_parent(struct dentry *child)
94 * If the create succeeds, we fill in the inode information 94 * If the create succeeds, we fill in the inode information
95 * with d_instantiate(). 95 * with d_instantiate().
96 */ 96 */
97static int ext2_create (struct inode * dir, struct dentry * dentry, umode_t mode, struct nameidata *nd) 97static int ext2_create (struct inode * dir, struct dentry * dentry, umode_t mode, bool excl)
98{ 98{
99 struct inode *inode; 99 struct inode *inode;
100 100
@@ -242,8 +242,8 @@ static int ext2_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode)
242 if (err) 242 if (err)
243 goto out_fail; 243 goto out_fail;
244 244
245 d_instantiate(dentry, inode);
246 unlock_new_inode(inode); 245 unlock_new_inode(inode);
246 d_instantiate(dentry, inode);
247out: 247out:
248 return err; 248 return err;
249 249
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index b3621cb7ea31..9f311d27b16f 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -771,13 +771,13 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
771 err = -ENOMEM; 771 err = -ENOMEM;
772 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); 772 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
773 if (!sbi) 773 if (!sbi)
774 goto failed_unlock; 774 goto failed;
775 775
776 sbi->s_blockgroup_lock = 776 sbi->s_blockgroup_lock =
777 kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL); 777 kzalloc(sizeof(struct blockgroup_lock), GFP_KERNEL);
778 if (!sbi->s_blockgroup_lock) { 778 if (!sbi->s_blockgroup_lock) {
779 kfree(sbi); 779 kfree(sbi);
780 goto failed_unlock; 780 goto failed;
781 } 781 }
782 sb->s_fs_info = sbi; 782 sb->s_fs_info = sbi;
783 sbi->s_sb_block = sb_block; 783 sbi->s_sb_block = sb_block;
@@ -1130,7 +1130,7 @@ failed_sbi:
1130 sb->s_fs_info = NULL; 1130 sb->s_fs_info = NULL;
1131 kfree(sbi->s_blockgroup_lock); 1131 kfree(sbi->s_blockgroup_lock);
1132 kfree(sbi); 1132 kfree(sbi);
1133failed_unlock: 1133failed:
1134 return ret; 1134 return ret;
1135} 1135}
1136 1136
@@ -1184,6 +1184,12 @@ static int ext2_sync_fs(struct super_block *sb, int wait)
1184 struct ext2_sb_info *sbi = EXT2_SB(sb); 1184 struct ext2_sb_info *sbi = EXT2_SB(sb);
1185 struct ext2_super_block *es = EXT2_SB(sb)->s_es; 1185 struct ext2_super_block *es = EXT2_SB(sb)->s_es;
1186 1186
1187 /*
1188 * Write quota structures to quota file, sync_blockdev() will write
1189 * them to disk later
1190 */
1191 dquot_writeback_dquots(sb, -1);
1192
1187 spin_lock(&sbi->s_lock); 1193 spin_lock(&sbi->s_lock);
1188 if (es->s_state & cpu_to_le16(EXT2_VALID_FS)) { 1194 if (es->s_state & cpu_to_le16(EXT2_VALID_FS)) {
1189 ext2_debug("setting valid to 0\n"); 1195 ext2_debug("setting valid to 0\n");