diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-04-29 17:02:18 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2015-05-28 15:41:55 -0700 |
commit | e7d5545285ededcf73dc7cbb9b7c65d0259f2b44 (patch) | |
tree | e326305090c249a5cfe26e1347bc63cba6ba898d /fs/f2fs/dir.c | |
parent | 6e22c691ba0a63ba89f516f0bf1828cf6dce372d (diff) | |
download | linux-e7d5545285ededcf73dc7cbb9b7c65d0259f2b44.tar.bz2 |
f2fs crypto: add filename encryption for roll-forward recovery
This patch adds a bit flag to indicate whether or not i_name in the inode
is encrypted.
If this name is encrypted, we can't do recover_dentry during roll-forward.
So, f2fs_sync_file() needs to do checkpoint, if this will be needed in future.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/dir.c')
-rw-r--r-- | fs/f2fs/dir.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index 5e10d9d8099c..12f686914d38 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -314,10 +314,14 @@ static void init_dent_inode(const struct qstr *name, struct page *ipage) set_page_dirty(ipage); } -int update_dent_inode(struct inode *inode, const struct qstr *name) +int update_dent_inode(struct inode *inode, struct inode *to, + const struct qstr *name) { struct page *page; + if (file_enc_name(to)) + return 0; + page = get_node_page(F2FS_I_SB(inode), inode->i_ino); if (IS_ERR(page)) return PTR_ERR(page); @@ -597,6 +601,8 @@ add_dentry: err = PTR_ERR(page); goto fail; } + if (f2fs_encrypted_inode(dir)) + file_set_enc_name(inode); } make_dentry_ptr(NULL, &d, (void *)dentry_blk, 1); |