From 52bc1efa69e0bb001a78a249f021884ee0e75c88 Mon Sep 17 00:00:00 2001 From: Seth Forshee Date: Tue, 6 Dec 2016 09:51:01 -0600 Subject: [PATCH] UBUNTU: SAUCE: aufs -- Add flags argument to aufs_rename() Starting with Linux 4.9-rc1 the rename2 inode operation has replaced the rename op, so filesystem rename implementations require an extra flags argument. Add the argument to fix the FTBFS with Linux 4.9, but since aufs doesn't support any of the flags return an error if it is non-zero. Fixes FTBFS with 4.9 kernels. Signed-off-by: Seth Forshee --- fs/aufs/i_op_ren.c | 7 ++++++- fs/aufs/inode.h | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fs/aufs/i_op_ren.c b/fs/aufs/i_op_ren.c index 200b4d547240..8c763590aec1 100644 --- a/fs/aufs/i_op_ren.c +++ b/fs/aufs/i_op_ren.c @@ -802,7 +802,8 @@ static void au_ren_rev_dt(int err, struct au_ren_args *a) /* ---------------------------------------------------------------------- */ int aufs_rename(struct inode *_src_dir, struct dentry *_src_dentry, - struct inode *_dst_dir, struct dentry *_dst_dentry) + struct inode *_dst_dir, struct dentry *_dst_dentry, + unsigned int rename_flags) { int err, flags; /* reduce stack space */ @@ -812,6 +813,10 @@ int aufs_rename(struct inode *_src_dir, struct dentry *_src_dentry, IMustLock(_src_dir); IMustLock(_dst_dir); + err = -EINVAL; + if (rename_flags) + goto out; + err = -ENOMEM; BUILD_BUG_ON(sizeof(*a) > PAGE_SIZE); a = kzalloc(sizeof(*a), GFP_NOFS); diff --git a/fs/aufs/inode.h b/fs/aufs/inode.h index 94d217ff609a..70b4ea8f815f 100644 --- a/fs/aufs/inode.h +++ b/fs/aufs/inode.h @@ -238,7 +238,8 @@ int aufs_rmdir(struct inode *dir, struct dentry *dentry); /* i_op_ren.c */ int au_wbr(struct dentry *dentry, aufs_bindex_t btgt); int aufs_rename(struct inode *src_dir, struct dentry *src_dentry, - struct inode *dir, struct dentry *dentry); + struct inode *dir, struct dentry *dentry, + unsigned int rename_flags); /* iinfo.c */ struct inode *au_h_iptr(struct inode *inode, aufs_bindex_t bindex); -- 2.39.2