summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/namei.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/namei.c')
-rw-r--r--fs/f2fs/namei.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 2a8d84b727ce..e7587fce1b80 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -316,12 +316,14 @@ fail:
316} 316}
317 317
318static const char *f2fs_get_link(struct dentry *dentry, 318static const char *f2fs_get_link(struct dentry *dentry,
319 struct inode *inode, void **cookie) 319 struct inode *inode,
320 struct delayed_call *done)
320{ 321{
321 const char *link = page_get_link(dentry, inode, cookie); 322 const char *link = page_get_link(dentry, inode, done);
322 if (!IS_ERR(link) && !*link) { 323 if (!IS_ERR(link) && !*link) {
323 /* this is broken symlink case */ 324 /* this is broken symlink case */
324 page_put_link(NULL, *cookie); 325 do_delayed_call(done);
326 clear_delayed_call(done);
325 link = ERR_PTR(-ENOENT); 327 link = ERR_PTR(-ENOENT);
326 } 328 }
327 return link; 329 return link;
@@ -926,7 +928,8 @@ static int f2fs_rename2(struct inode *old_dir, struct dentry *old_dentry,
926 928
927#ifdef CONFIG_F2FS_FS_ENCRYPTION 929#ifdef CONFIG_F2FS_FS_ENCRYPTION
928static const char *f2fs_encrypted_get_link(struct dentry *dentry, 930static const char *f2fs_encrypted_get_link(struct dentry *dentry,
929 struct inode *inode, void **cookie) 931 struct inode *inode,
932 struct delayed_call *done)
930{ 933{
931 struct page *cpage = NULL; 934 struct page *cpage = NULL;
932 char *caddr, *paddr = NULL; 935 char *caddr, *paddr = NULL;
@@ -988,7 +991,8 @@ static const char *f2fs_encrypted_get_link(struct dentry *dentry,
988 paddr[res] = '\0'; 991 paddr[res] = '\0';
989 992
990 page_cache_release(cpage); 993 page_cache_release(cpage);
991 return *cookie = paddr; 994 set_delayed_call(done, kfree_link, paddr);
995 return paddr;
992errout: 996errout:
993 kfree(cstr.name); 997 kfree(cstr.name);
994 f2fs_fname_crypto_free_buffer(&pstr); 998 f2fs_fname_crypto_free_buffer(&pstr);
@@ -999,7 +1003,6 @@ errout:
999const struct inode_operations f2fs_encrypted_symlink_inode_operations = { 1003const struct inode_operations f2fs_encrypted_symlink_inode_operations = {
1000 .readlink = generic_readlink, 1004 .readlink = generic_readlink,
1001 .get_link = f2fs_encrypted_get_link, 1005 .get_link = f2fs_encrypted_get_link,
1002 .put_link = kfree_put_link,
1003 .getattr = f2fs_getattr, 1006 .getattr = f2fs_getattr,
1004 .setattr = f2fs_setattr, 1007 .setattr = f2fs_setattr,
1005 .setxattr = generic_setxattr, 1008 .setxattr = generic_setxattr,
@@ -1035,7 +1038,6 @@ const struct inode_operations f2fs_dir_inode_operations = {
1035const struct inode_operations f2fs_symlink_inode_operations = { 1038const struct inode_operations f2fs_symlink_inode_operations = {
1036 .readlink = generic_readlink, 1039 .readlink = generic_readlink,
1037 .get_link = f2fs_get_link, 1040 .get_link = f2fs_get_link,
1038 .put_link = page_put_link,
1039 .getattr = f2fs_getattr, 1041 .getattr = f2fs_getattr,
1040 .setattr = f2fs_setattr, 1042 .setattr = f2fs_setattr,
1041#ifdef CONFIG_F2FS_FS_XATTR 1043#ifdef CONFIG_F2FS_FS_XATTR