Commit 241a4349 authored by Dave Kleikamp's avatar Dave Kleikamp

JFS: Fix off-by one error when symlink size == 256 bytes

parent 65b5db50
...@@ -59,7 +59,7 @@ struct inode *jfs_iget(struct super_block *sb, ino_t ino) ...@@ -59,7 +59,7 @@ struct inode *jfs_iget(struct super_block *sb, ino_t ino)
inode->i_mapping->a_ops = &jfs_aops; inode->i_mapping->a_ops = &jfs_aops;
inode->i_mapping->gfp_mask = GFP_NOFS; inode->i_mapping->gfp_mask = GFP_NOFS;
} else if (S_ISLNK(inode->i_mode)) { } else if (S_ISLNK(inode->i_mode)) {
if (inode->i_size > IDATASIZE) { if (inode->i_size >= IDATASIZE) {
inode->i_op = &page_symlink_inode_operations; inode->i_op = &page_symlink_inode_operations;
inode->i_mapping->a_ops = &jfs_aops; inode->i_mapping->a_ops = &jfs_aops;
} else } else
......
...@@ -602,7 +602,7 @@ s64 commitZeroLink(tid_t tid, struct inode *ip) ...@@ -602,7 +602,7 @@ s64 commitZeroLink(tid_t tid, struct inode *ip)
break; break;
case S_IFLNK: case S_IFLNK:
/* fast symbolic link */ /* fast symbolic link */
if (ip->i_size <= 256) { if (ip->i_size < IDATASIZE) {
ip->i_size = 0; ip->i_size = 0;
return 0; return 0;
} }
...@@ -674,7 +674,7 @@ int freeZeroLink(struct inode *ip) ...@@ -674,7 +674,7 @@ int freeZeroLink(struct inode *ip)
break; break;
case S_IFLNK: case S_IFLNK:
/* if its contained in inode nothing to do */ /* if its contained in inode nothing to do */
if (ip->i_size <= 256) if (ip->i_size < IDATASIZE)
return 0; return 0;
break; break;
default: default:
......
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