[Devel,RHEL7,COMMIT] ext4: ext4_mkdir must set S_IOPS_WRAPPER bit

Submitted by Konstantin Khorenko on July 29, 2016, 3:16 p.m.


Message ID 201607291516.u6TFGX9A017065@finist_cl7.x64_64.work.ct
State New
Series "ext4: ext4_mkdir must set S_IOPS_WRAPPER bit"
Headers show

Commit Message

Konstantin Khorenko July 29, 2016, 3:16 p.m.
The commit is pushed to "branch-rh7-3.10.0-327.22.2.vz7.16.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.22.2.vz7.16.1
commit e8421e9d99ccbc3c8d2b3e79e1ebf3c70f9ec43c
Author: Maxim Patlasov <mpatlasov@virtuozzo.com>
Date:   Fri Jul 29 19:16:33 2016 +0400

    ext4: ext4_mkdir must set S_IOPS_WRAPPER bit
    ext4_iget() sets this bit for directories. Let's do the same in ext4_mkdir().
    Otherwise, the behaviour of vfs_rename (on top of ext4) varies depending on
    how the in-core inode was born: via lookup or mkdir.
    The key place in vfs_rename sensible to the change is:
    >	if (flags && !rename2)
    >		return -EINVAL;
    Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
 fs/ext4/namei.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index 0adc6df..bebe698 100644
--- a/fs/ext4/namei.c
+++ b/fs/ext4/namei.c
@@ -2413,6 +2413,7 @@  retry:
 	inode->i_op = &ext4_dir_inode_operations.ops;
 	inode->i_fop = &ext4_dir_operations;
+	inode->i_flags |= S_IOPS_WRAPPER;
 	err = ext4_init_new_dir(handle, dir, inode);
 	if (err)
 		goto out_clear_inode;