Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185869
b: refs/heads/master
c: f39490b
h: refs/heads/master
i:
  185867: abe8101
v: v3
  • Loading branch information
Dmitry Monakhov authored and Theodore Ts'o committed Mar 2, 2010
1 parent 72d48b3 commit a6ec659
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 437ca0fda3b442dff9e591581b5e1ffdfec24660
refs/heads/master: f39490bcd1691d65dc33689222a12e1fc13dd824
29 changes: 14 additions & 15 deletions trunk/fs/ext4/migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -503,14 +503,10 @@ int ext4_ext_migrate(struct inode *inode)
}
i_size_write(tmp_inode, i_size_read(inode));
/*
* We don't want the inode to be reclaimed
* if we got interrupted in between. We have
* this tmp inode carrying reference to the
* data blocks of the original file. We set
* the i_nlink to zero at the last stage after
* switching the original file to extent format
* Set the i_nlink to zero so it will be deleted later
* when we drop inode reference.
*/
tmp_inode->i_nlink = 1;
tmp_inode->i_nlink = 0;

ext4_ext_tree_init(handle, tmp_inode);
ext4_orphan_add(handle, tmp_inode);
Expand All @@ -537,6 +533,16 @@ int ext4_ext_migrate(struct inode *inode)
up_read((&EXT4_I(inode)->i_data_sem));

handle = ext4_journal_start(inode, 1);
if (IS_ERR(handle)) {
/*
* It is impossible to update on-disk structures without
* a handle, so just rollback in-core changes and live other
* work to orphan_list_cleanup()
*/
ext4_orphan_del(NULL, tmp_inode);
retval = PTR_ERR(handle);
goto out;
}

ei = EXT4_I(inode);
i_data = ei->i_data;
Expand Down Expand Up @@ -618,15 +624,8 @@ int ext4_ext_migrate(struct inode *inode)

/* Reset the extent details */
ext4_ext_tree_init(handle, tmp_inode);

/*
* Set the i_nlink to zero so that
* generic_drop_inode really deletes the
* inode
*/
tmp_inode->i_nlink = 0;

ext4_journal_stop(handle);
out:
unlock_new_inode(tmp_inode);
iput(tmp_inode);

Expand Down

0 comments on commit a6ec659

Please sign in to comment.