Commit 2d78c209 authored by Gao Xiang's avatar Gao Xiang Committed by Greg Kroah-Hartman
parent ea559e7b
...@@ -147,7 +147,7 @@ static int fill_inline_data(struct inode *inode, void *data, ...@@ -147,7 +147,7 @@ static int fill_inline_data(struct inode *inode, void *data,
if (vi->datalayout != EROFS_INODE_FLAT_INLINE) if (vi->datalayout != EROFS_INODE_FLAT_INLINE)
return 0; return 0;
/* fast symlink (following ext4) */ /* fast symlink */
if (S_ISLNK(inode->i_mode) && inode->i_size < PAGE_SIZE) { if (S_ISLNK(inode->i_mode) && inode->i_size < PAGE_SIZE) {
char *lnk = erofs_kmalloc(sbi, inode->i_size + 1, GFP_KERNEL); char *lnk = erofs_kmalloc(sbi, inode->i_size + 1, GFP_KERNEL);
...@@ -156,7 +156,7 @@ static int fill_inline_data(struct inode *inode, void *data, ...@@ -156,7 +156,7 @@ static int fill_inline_data(struct inode *inode, void *data,
m_pofs += vi->inode_isize + vi->xattr_isize; m_pofs += vi->inode_isize + vi->xattr_isize;
/* inline symlink data shouldn't across page boundary as well */ /* inline symlink data shouldn't cross page boundary as well */
if (m_pofs + inode->i_size > PAGE_SIZE) { if (m_pofs + inode->i_size > PAGE_SIZE) {
kfree(lnk); kfree(lnk);
errln("inline data cross block boundary @ nid %llu", errln("inline data cross block boundary @ nid %llu",
...@@ -165,7 +165,6 @@ static int fill_inline_data(struct inode *inode, void *data, ...@@ -165,7 +165,6 @@ static int fill_inline_data(struct inode *inode, void *data,
return -EFSCORRUPTED; return -EFSCORRUPTED;
} }
/* get in-page inline data */
memcpy(lnk, data + m_pofs, inode->i_size); memcpy(lnk, data + m_pofs, inode->i_size);
lnk[inode->i_size] = '\0'; lnk[inode->i_size] = '\0';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment