ext4: Don't set EXTENTS_FL flag for fast symlinks

For fast symbolic links, the file content is stored in the i_block[]
array, which is not compatible with the new file extents format.
e2fsck reports error on such files because EXTENTS_FL is set.
Don't set the EXTENTS_FL flag when creating fast symlinks.

In the case of file migration, skip fast symbolic links.

Signed-off-by: Valerie Clement <valerie.clement@bull.net>
Signed-off-by: Mingming Cao <cmm@us.ibm.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

authored by Valerie Clement and committed by Theodore Ts'o b8356c46 4d605179

+7
+6
fs/ext4/migrate.c
··· 414 414 if ((EXT4_I(inode)->i_flags & EXT4_EXTENTS_FL)) 415 415 return -EINVAL; 416 416 417 + if (S_ISLNK(inode->i_mode) && inode->i_blocks == 0) 418 + /* 419 + * don't migrate fast symlink 420 + */ 421 + return retval; 422 + 417 423 down_write(&EXT4_I(inode)->i_data_sem); 418 424 handle = ext4_journal_start(inode, 419 425 EXT4_DATA_TRANS_BLOCKS(inode->i_sb) +
+1
fs/ext4/namei.c
··· 2223 2223 inode->i_op = &ext4_fast_symlink_inode_operations; 2224 2224 memcpy((char*)&EXT4_I(inode)->i_data,symname,l); 2225 2225 inode->i_size = l-1; 2226 + EXT4_I(inode)->i_flags &= ~EXT4_EXTENTS_FL; 2226 2227 } 2227 2228 EXT4_I(inode)->i_disksize = inode->i_size; 2228 2229 err = ext4_add_nondir(handle, dentry, inode);