Skip to content
Snippets Groups Projects
Unverified Commit 5d0464cd authored by Evan Anderson's avatar Evan Anderson
Browse files

exfat_super: Update for kernel 4.9 compatibility


The following changes have been made in kernel 4.9 that necessitate
changes

* inode_change_ok has been replaced by setattr_prepare, which takes a
dentry as its argument for security reasons

* rename's interface has changed to require an additional argument for
flags. Since we do not support rename flags, passing flags will always
return -EINVAL

Signed-off-by: default avatarEvan Anderson <evan@eaanderson.com>
parent fa66ce3e
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -1101,8 +1101,14 @@ out:
return err;
}
 
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
static int exfat_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry,
unsigned int flags)
#else
static int exfat_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry)
#endif
{
struct inode *old_inode, *new_inode;
struct super_block *sb = old_dir->i_sb;
Loading
Loading
@@ -1110,6 +1116,11 @@ static int exfat_rename(struct inode *old_dir, struct dentry *old_dentry,
loff_t i_pos;
int err;
 
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
if (flags)
return -EINVAL;
#endif
__lock_super(sb);
 
DPRINTK("exfat_rename entered\n");
Loading
Loading
@@ -1293,7 +1304,11 @@ static int exfat_setattr(struct dentry *dentry, struct iattr *attr)
attr->ia_valid &= ~(ATTR_MTIME_SET | ATTR_ATIME_SET | ATTR_TIMES_SET);
}
 
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
error = setattr_prepare(dentry, attr);
#else
error = inode_change_ok(inode, attr);
#endif
attr->ia_valid = ia_valid;
if (error)
return error;
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment