From: Wang Shilong Date: Wed, 19 Aug 2015 09:56:09 +0000 (-0400) Subject: LU-4017 ldiskfs: export __ext4_ioctl_setproject for lustre X-Git-Tag: 2.9.56~41 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F45%2F23945%2F12;p=fs%2Flustre-release.git LU-4017 ldiskfs: export __ext4_ioctl_setproject for lustre Export this helper so that lustre can save project id to MDS and OST objects Signed-off-by: Wang Shilong Change-Id: I5c374e6dc7a509c0cbd46ac383b8d99f7f67d6b6 Reviewed-on: https://review.whamcloud.com/23945 Reviewed-by: Niu Yawei Reviewed-by: Li Xi Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/ldiskfs/kernel_patches/patches/rhel7/ext4-export-__ext4_ioctl_setproject-for-lustre.patch b/ldiskfs/kernel_patches/patches/rhel7/ext4-export-__ext4_ioctl_setproject-for-lustre.patch new file mode 100644 index 0000000..35a5379 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/rhel7/ext4-export-__ext4_ioctl_setproject-for-lustre.patch @@ -0,0 +1,62 @@ +diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h +index 8fa347b..92b4101 100644 +--- a/fs/ext4/ext4.h ++++ b/fs/ext4/ext4.h +@@ -2178,6 +2178,7 @@ extern int ext4_ind_remove_space(handle_t *handle, struct inode *inode, + /* ioctl.c */ + extern long ext4_ioctl(struct file *, unsigned int, unsigned long); + extern long ext4_compat_ioctl(struct file *, unsigned int, unsigned long); ++extern int __ext4_ioctl_setproject(struct inode *inode, __u32 projid); + + /* migrate.c */ + extern int ext4_ext_migrate(struct inode *); +diff --git a/fs/ext4/ioctl.c b/fs/ext4/ioctl.c +index 890f21e..a4443e9 100644 +--- a/fs/ext4/ioctl.c ++++ b/fs/ext4/ioctl.c +@@ -294,9 +294,8 @@ flags_out: + } + + #ifdef CONFIG_QUOTA +-static int ext4_ioctl_setproject(struct file *filp, __u32 projid) ++int __ext4_ioctl_setproject(struct inode *inode, __u32 projid) + { +- struct inode *inode = file_inode(filp); + struct super_block *sb = inode->i_sb; + struct ext4_inode_info *ei = EXT4_I(inode); + int err, rc; +@@ -324,10 +323,6 @@ static int ext4_ioctl_setproject(struct file *filp, __u32 projid) + if (projid_eq(kprojid, EXT4_I(inode)->i_projid)) + return 0; + +- err = mnt_want_write_file(filp); +- if (err) +- return err; +- + err = -EPERM; + mutex_lock(&inode->i_mutex); + /* Is it quota file? Do not allow user to mess with it */ +@@ -378,6 +373,23 @@ out_stop: + ext4_journal_stop(handle); + out_unlock: + mutex_unlock(&inode->i_mutex); ++ return err; ++ ++ ++} ++EXPORT_SYMBOL(__ext4_ioctl_setproject); ++ ++static int ext4_ioctl_setproject(struct file *filp, __u32 projid) ++{ ++ int err; ++ struct inode *inode = file_inode(filp); ++ ++ err = mnt_want_write_file(filp); ++ if (err) ++ return err; ++ ++ err = __ext4_ioctl_setproject(inode, projid); ++ + mnt_drop_write_file(filp); + return err; + } diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.2.series b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.2.series index 5b728e3..7adfeea 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.2.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.2.series @@ -28,4 +28,5 @@ rhel7.2/ext4-remove-i_data_sem-from-xattr.patch rhel7/ext4-projid-ignore-maxquotas.patch rhel7/ext4-projid-feature-support.patch rhel7/ext4-projid-quotas.patch -rhel7ext4-projid-xfs-ioctls.patch +rhel7/ext4-projid-xfs-ioctls.patch +rhel7/ext4-export-__ext4_ioctl_setproject-for-lustre.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.3.series b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.3.series index 3103ded..9c6dd5e 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.3.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-3.10-rhel7.3.series @@ -27,3 +27,4 @@ rhel7/ext4-projid-ignore-maxquotas.patch rhel7/ext4-projid-feature-support.patch rhel7/ext4-projid-quotas.patch rhel7/ext4-projid-xfs-ioctls.patch +rhel7/ext4-export-__ext4_ioctl_setproject-for-lustre.patch