]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ovl: fix warnings caused by WRITE_ONCE
authorShan Hai <shan.hai@oracle.com>
Mon, 24 Jul 2017 09:10:51 +0000 (17:10 +0800)
committerShan Hai <shan.hai@oracle.com>
Fri, 4 Aug 2017 05:52:56 +0000 (13:52 +0800)
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 <shan.hai@oracle.com>
Reviewed-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
fs/overlayfs/super.c

index 3672db4617c8e2bb81511a9c12b9d2397357c063..6d770506eed078f36324f75d2159eb8960d6f69a 100644 (file)
@@ -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;