staging: exfat: use prandom_u32() for i_generation
authorArnd Bergmann <arnd@arndb.de>
Fri, 8 Nov 2019 21:32:39 +0000 (22:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 Nov 2019 15:37:59 +0000 (16:37 +0100)
Similar to commit 46c9a946d766 ("shmem: use monotonic time for i_generation")
we should not use the deprecated get_seconds() interface for i_generation.

prandom_u32() is the replacement used in other file systems.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
Link: https://lore.kernel.org/r/20191108213257.3097633-2-arnd@arndb.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/exfat/exfat_super.c

index 1ae5a77503487220f20dbb67960ab3b7f82339f6..ee3d64178069ca14931f94e3ba2840a48ad541dc 100644 (file)
@@ -26,7 +26,7 @@
 #include <linux/sched.h>
 #include <linux/fs_struct.h>
 #include <linux/namei.h>
-
+#include <linux/random.h>
 #include <linux/string.h>
 #include <linux/nls.h>
 #include <linux/mutex.h>
@@ -3363,7 +3363,7 @@ static int exfat_fill_inode(struct inode *inode, struct file_id_t *fid)
        inode->i_uid = sbi->options.fs_uid;
        inode->i_gid = sbi->options.fs_gid;
        INC_IVERSION(inode);
-       inode->i_generation = get_seconds();
+       inode->i_generation = prandom_u32();
 
        if (info.Attr & ATTR_SUBDIR) { /* directory */
                inode->i_generation &= ~1;