From: Shan Hai Date: Mon, 24 Jul 2017 09:10:51 +0000 (+0800) Subject: ovl: fix warnings caused by WRITE_ONCE X-Git-Tag: v4.1.12-108.0.20170806_1300~23 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=27e68e0d0f3e0ae42d719273e62bd2d0b38132da;p=users%2Fjedix%2Flinux-maple.git ovl: fix warnings caused by WRITE_ONCE Orabug: 26401569 The commit 39b681f80(ovl: store real inode pointer in ->i_private) adds a call to the WRITE_ONCE which generates "initialization makes pointer from integer without a cast" warnings, fix it by coverting to the required type. Signed-off-by: Shan Hai Reviewed-by: Somasundaram Krishnasamy --- diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c index 3672db4617c8e..6d770506eed07 100644 --- a/fs/overlayfs/super.c +++ b/fs/overlayfs/super.c @@ -148,8 +148,8 @@ struct dentry *ovl_dentry_real(struct dentry *dentry) static void ovl_inode_init(struct inode *inode, struct inode *realinode, bool is_upper) { - WRITE_ONCE(inode->i_private, (unsigned long) realinode | - (is_upper ? OVL_ISUPPER_MASK : 0)); + WRITE_ONCE(inode->i_private, (void *)((unsigned long) realinode | + (is_upper ? OVL_ISUPPER_MASK : 0))); } struct vfsmount *ovl_entry_mnt_real(struct ovl_entry *oe, struct inode *inode, @@ -234,7 +234,7 @@ void ovl_inode_update(struct inode *inode, struct inode *upperinode) WARN_ON(!upperinode); WARN_ON(!inode_unhashed(inode)); WRITE_ONCE(inode->i_private, - (unsigned long) upperinode | OVL_ISUPPER_MASK); + (void *)((unsigned long) upperinode | OVL_ISUPPER_MASK)); if (!S_ISDIR(upperinode->i_mode)) __insert_inode_hash(inode, (unsigned long) upperinode); } @@ -317,7 +317,7 @@ static struct ovl_entry *ovl_alloc_entry(unsigned int numlower) static inline struct dentry *ovl_lookup_real(struct super_block *ovl_sb, struct dentry *dir, - const struct qstr *name) + struct qstr *name) { const struct cred *old_cred; struct dentry *dentry;