Re: [v9 2/5] ext4: adds project ID support
From: Jan Kara <hidden>
Date: 2015-03-16 14:37:56
Also in:
linux-ext4, linux-fsdevel
On Wed 11-03-15 12:03:20, Li Xi wrote:
This patch adds a new internal field of ext4 inode to save project identifier. Also a new flag EXT4_INODE_PROJINHERIT is added for inheriting project ID from parent directory. Signed-off-by: Li Xi <redacted> Reviewed-by: Jan Kara <redacted>
...
quoted hunk
@@ -3395,6 +3405,13 @@ static int ext4_cross_rename(struct inode *old_dir, struct dentry *old_dentry, u8 new_file_type; int retval; + if ((ext4_test_inode_flag(new_dir, EXT4_INODE_PROJINHERIT)) && + ((!projid_eq(EXT4_I(new_dir)->i_projid, + EXT4_I(old_dentry->d_inode)->i_projid)) || + (!projid_eq(EXT4_I(old_dir)->i_projid, + EXT4_I(new_dentry->d_inode)->i_projid)))) + return -EXDEV; +
I believe this needs to also check EXT4_INODE_PROJINHERIT on old_dir. So something like: if ((ext4_test_inode_flag(new_dir, EXT4_INODE_PROJINHERIT) && !projid_eq(EXT4_I(new_dir)->i_projid, EXT4_I(old_dentry->d_inode)->i_projid)) || (ext4_test_inode_flag(old_dir, EXT4_INODE_PROJINHERIT) && !projid_eq(EXT4_I(old_dir)->i_projid, EXT4_I(new_dentry->d_inode)->i_projid))) return -EXDEV; Honza -- Jan Kara [off-list ref] SUSE Labs, CR