Skip to content

Commit 74b5cab

Browse files
committed
fat: use prandom_u32() for i_generation
Similar to commit 46c9a94 ("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>
1 parent e42617b commit 74b5cab

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎fs/fat/inode.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <linux/blkdev.h>
2222
#include <linux/backing-dev.h>
2323
#include <asm/unaligned.h>
24+
#include <linux/random.h>
2425
#include <linux/iversion.h>
2526
#include "fat.h"
2627

@@ -521,7 +522,7 @@ int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de)
521522
inode->i_uid = sbi->options.fs_uid;
522523
inode->i_gid = sbi->options.fs_gid;
523524
inode_inc_iversion(inode);
524-
inode->i_generation = get_seconds();
525+
inode->i_generation = prandom_u32();
525526

526527
if ((de->attr & ATTR_DIR) && !IS_FREE(de->name)) {
527528
inode->i_generation &= ~1;

0 commit comments

Comments
 (0)