summaryrefslogtreecommitdiffstats
path: root/fs/ext2/inode.c
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2012-06-12 16:20:46 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2012-07-31 09:45:53 +0400
commit1e8b212fe5dcee9d3dbb152d235f3c33458fb26e (patch)
treec21036f86f455c6289704b35c58c8d01d7821f12 /fs/ext2/inode.c
parentb2b5ef5c8e89f19b68c174bf246f3ca212dbf0bc (diff)
downloadblackbird-op-linux-1e8b212fe5dcee9d3dbb152d235f3c33458fb26e.tar.gz
blackbird-op-linux-1e8b212fe5dcee9d3dbb152d235f3c33458fb26e.zip
ext2: Implement freezing
The only missing piece to make freezing work reliably with ext2 is to stop iput() of unlinked inode from deleting the inode on frozen filesystem. So add a necessary protection to ext2_evict_inode(). We also provide appropriate ->freeze_fs and ->unfreeze_fs functions. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ext2/inode.c')
-rw-r--r--fs/ext2/inode.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index 264d315f6c47..6363ac66fafa 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -79,6 +79,7 @@ void ext2_evict_inode(struct inode * inode)
truncate_inode_pages(&inode->i_data, 0);
if (want_delete) {
+ sb_start_intwrite(inode->i_sb);
/* set dtime */
EXT2_I(inode)->i_dtime = get_seconds();
mark_inode_dirty(inode);
@@ -98,8 +99,10 @@ void ext2_evict_inode(struct inode * inode)
if (unlikely(rsv))
kfree(rsv);
- if (want_delete)
+ if (want_delete) {
ext2_free_inode(inode);
+ sb_end_intwrite(inode->i_sb);
+ }
}
typedef struct {
OpenPOWER on IntegriCloud