ext4: Properly count journal credits for long symlinks
[deliverable/linux.git] / fs / ext4 / namei.c
index 565a154e22d4bee058d8853cb02539e02509bc2f..f8068c7bae9fd05c7d94880dd909c1f17df7dad5 100644 (file)
@@ -2253,9 +2253,11 @@ static int ext4_symlink(struct inode *dir,
                /*
                 * For non-fast symlinks, we just allocate inode and put it on
                 * orphan list in the first transaction => we need bitmap,
-                * group descriptor, sb, inode block, quota blocks.
+                * group descriptor, sb, inode block, quota blocks, and
+                * possibly selinux xattr blocks.
                 */
-               credits = 4 + EXT4_MAXQUOTAS_INIT_BLOCKS(dir->i_sb);
+               credits = 4 + EXT4_MAXQUOTAS_INIT_BLOCKS(dir->i_sb) +
+                         EXT4_XATTR_TRANS_BLOCKS;
        } else {
                /*
                 * Fast symlink. We have to add entry to directory
This page took 0.029415 seconds and 5 git commands to generate.