Skip to content

Commit a251c17

Browse files
committed
treewide: use get_random_u32() when possible
The prandom_u32() function has been a deprecated inline wrapper around get_random_u32() for several releases now, and compiles down to the exact same code. Replace the deprecated wrapper with a direct call to the real function. The same also applies to get_random_int(), which is just a wrapper around get_random_u32(). This was done as a basic find and replace. Reviewed-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Kees Cook <[email protected]> Reviewed-by: Yury Norov <[email protected]> Reviewed-by: Jan Kara <[email protected]> # for ext4 Acked-by: Toke Høiland-Jørgensen <[email protected]> # for sch_cake Acked-by: Chuck Lever <[email protected]> # for nfsd Acked-by: Jakub Kicinski <[email protected]> Acked-by: Mika Westerberg <[email protected]> # for thunderbolt Acked-by: Darrick J. Wong <[email protected]> # for xfs Acked-by: Helge Deller <[email protected]> # for parisc Acked-by: Heiko Carstens <[email protected]> # for s390 Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent f743f16 commit a251c17

File tree

71 files changed

+100
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+100
-100
lines changed

Documentation/networking/filter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ Possible BPF extensions are shown in the following table:
305305
vlan_tci skb_vlan_tag_get(skb)
306306
vlan_avail skb_vlan_tag_present(skb)
307307
vlan_tpid skb->vlan_proto
308-
rand prandom_u32()
308+
rand get_random_u32()
309309
=================================== =================================================
310310

311311
These extensions can also be prefixed with '#'.

arch/parisc/kernel/process.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ __get_wchan(struct task_struct *p)
288288

289289
static inline unsigned long brk_rnd(void)
290290
{
291-
return (get_random_int() & BRK_RND_MASK) << PAGE_SHIFT;
291+
return (get_random_u32() & BRK_RND_MASK) << PAGE_SHIFT;
292292
}
293293

294294
unsigned long arch_randomize_brk(struct mm_struct *mm)

arch/parisc/kernel/sys_parisc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,14 +239,14 @@ static unsigned long mmap_rnd(void)
239239
unsigned long rnd = 0;
240240

241241
if (current->flags & PF_RANDOMIZE)
242-
rnd = get_random_int() & MMAP_RND_MASK;
242+
rnd = get_random_u32() & MMAP_RND_MASK;
243243

244244
return rnd << PAGE_SHIFT;
245245
}
246246

247247
unsigned long arch_mmap_rnd(void)
248248
{
249-
return (get_random_int() & MMAP_RND_MASK) << PAGE_SHIFT;
249+
return (get_random_u32() & MMAP_RND_MASK) << PAGE_SHIFT;
250250
}
251251

252252
static unsigned long mmap_legacy_base(void)

arch/s390/mm/mmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static inline int mmap_is_legacy(struct rlimit *rlim_stack)
3737

3838
unsigned long arch_mmap_rnd(void)
3939
{
40-
return (get_random_int() & MMAP_RND_MASK) << PAGE_SHIFT;
40+
return (get_random_u32() & MMAP_RND_MASK) << PAGE_SHIFT;
4141
}
4242

4343
static unsigned long mmap_base_legacy(unsigned long rnd)

arch/x86/kernel/cpu/amd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ static void bsp_init_amd(struct cpuinfo_x86 *c)
503503
va_align.flags = ALIGN_VA_32 | ALIGN_VA_64;
504504

505505
/* A random value per boot for bit slice [12:upper_bit) */
506-
va_align.bits = get_random_int() & va_align.mask;
506+
va_align.bits = get_random_u32() & va_align.mask;
507507
}
508508

509509
if (cpu_has(c, X86_FEATURE_MWAITX))

drivers/gpu/drm/i915/i915_gem_gtt.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ static u64 random_offset(u64 start, u64 end, u64 len, u64 align)
137137
range = round_down(end - len, align) - round_up(start, align);
138138
if (range) {
139139
if (sizeof(unsigned long) == sizeof(u64)) {
140-
addr = get_random_long();
140+
addr = get_random_u64();
141141
} else {
142-
addr = get_random_int();
142+
addr = get_random_u32();
143143
if (range > U32_MAX) {
144144
addr <<= 32;
145-
addr |= get_random_int();
145+
addr |= get_random_u32();
146146
}
147147
}
148148
div64_u64_rem(addr, range, &addr);

drivers/gpu/drm/i915/selftests/i915_selftest.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ static int __run_selftests(const char *name,
135135
int err = 0;
136136

137137
while (!i915_selftest.random_seed)
138-
i915_selftest.random_seed = get_random_int();
138+
i915_selftest.random_seed = get_random_u32();
139139

140140
i915_selftest.timeout_jiffies =
141141
i915_selftest.timeout_ms ?

drivers/gpu/drm/tests/drm_buddy_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ static void drm_test_buddy_alloc_limit(struct kunit *test)
729729
static int drm_buddy_init_test(struct kunit *test)
730730
{
731731
while (!random_seed)
732-
random_seed = get_random_int();
732+
random_seed = get_random_u32();
733733

734734
return 0;
735735
}

drivers/gpu/drm/tests/drm_mm_test.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2212,7 +2212,7 @@ static void drm_test_mm_color_evict_range(struct kunit *test)
22122212
static int drm_mm_init_test(struct kunit *test)
22132213
{
22142214
while (!random_seed)
2215-
random_seed = get_random_int();
2215+
random_seed = get_random_u32();
22162216

22172217
return 0;
22182218
}

drivers/infiniband/hw/cxgb4/cm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ static int send_connect(struct c4iw_ep *ep)
734734
&ep->com.remote_addr;
735735
int ret;
736736
enum chip_type adapter_type = ep->com.dev->rdev.lldi.adapter_type;
737-
u32 isn = (prandom_u32() & ~7UL) - 1;
737+
u32 isn = (get_random_u32() & ~7UL) - 1;
738738
struct net_device *netdev;
739739
u64 params;
740740

@@ -2469,7 +2469,7 @@ static int accept_cr(struct c4iw_ep *ep, struct sk_buff *skb,
24692469
}
24702470

24712471
if (!is_t4(adapter_type)) {
2472-
u32 isn = (prandom_u32() & ~7UL) - 1;
2472+
u32 isn = (get_random_u32() & ~7UL) - 1;
24732473

24742474
skb = get_skb(skb, roundup(sizeof(*rpl5), 16), GFP_KERNEL);
24752475
rpl5 = __skb_put_zero(skb, roundup(sizeof(*rpl5), 16));

drivers/infiniband/hw/hfi1/tid_rdma.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ void hfi1_kern_init_ctxt_generations(struct hfi1_ctxtdata *rcd)
850850
int i;
851851

852852
for (i = 0; i < RXE_NUM_TID_FLOWS; i++) {
853-
rcd->flows[i].generation = mask_generation(prandom_u32());
853+
rcd->flows[i].generation = mask_generation(get_random_u32());
854854
kern_set_hw_flow(rcd, KERN_GENERATION_RESERVED, i);
855855
}
856856
}

drivers/infiniband/hw/mlx4/mad.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static void __propagate_pkey_ev(struct mlx4_ib_dev *dev, int port_num,
9696
__be64 mlx4_ib_gen_node_guid(void)
9797
{
9898
#define NODE_GUID_HI ((u64) (((u64)IB_OPENIB_OUI) << 40))
99-
return cpu_to_be64(NODE_GUID_HI | prandom_u32());
99+
return cpu_to_be64(NODE_GUID_HI | get_random_u32());
100100
}
101101

102102
__be64 mlx4_ib_get_new_demux_tid(struct mlx4_ib_demux_ctx *ctx)

drivers/infiniband/ulp/ipoib/ipoib_cm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ static int ipoib_cm_req_handler(struct ib_cm_id *cm_id,
465465
goto err_qp;
466466
}
467467

468-
psn = prandom_u32() & 0xffffff;
468+
psn = get_random_u32() & 0xffffff;
469469
ret = ipoib_cm_modify_rx_qp(dev, cm_id, p->qp, psn);
470470
if (ret)
471471
goto err_modify;

drivers/md/raid5-cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2994,7 +2994,7 @@ static int r5l_load_log(struct r5l_log *log)
29942994
}
29952995
create:
29962996
if (create_super) {
2997-
log->last_cp_seq = prandom_u32();
2997+
log->last_cp_seq = get_random_u32();
29982998
cp = 0;
29992999
r5l_log_write_empty_meta_block(log, cp, log->last_cp_seq);
30003000
/*

drivers/media/test-drivers/vivid/vivid-touch-cap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static void vivid_fill_buff_noise(__s16 *tch_buf, int size)
210210

211211
/* Fill 10% of the values within range -3 and 3, zero the others */
212212
for (i = 0; i < size; i++) {
213-
unsigned int rand = get_random_int();
213+
unsigned int rand = get_random_u32();
214214

215215
if (rand % 10)
216216
tch_buf[i] = 0;
@@ -272,7 +272,7 @@ void vivid_fillbuff_tch(struct vivid_dev *dev, struct vivid_buffer *buf)
272272
return;
273273

274274
if (test_pat_idx == 0)
275-
dev->tch_pat_random = get_random_int();
275+
dev->tch_pat_random = get_random_u32();
276276
rand = dev->tch_pat_random;
277277

278278
switch (test_pattern) {

drivers/misc/habanalabs/gaudi2/gaudi2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2948,7 +2948,7 @@ static void gaudi2_user_interrupt_setup(struct hl_device *hdev)
29482948

29492949
static inline int gaudi2_get_non_zero_random_int(void)
29502950
{
2951-
int rand = get_random_int();
2951+
int rand = get_random_u32();
29522952

29532953
return rand ? rand : 1;
29542954
}

drivers/net/bonding/bond_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4806,7 +4806,7 @@ static u32 bond_rr_gen_slave_id(struct bonding *bond)
48064806

48074807
switch (packets_per_slave) {
48084808
case 0:
4809-
slave_id = prandom_u32();
4809+
slave_id = get_random_u32();
48104810
break;
48114811
case 1:
48124812
slave_id = this_cpu_inc_return(*bond->rr_tx_counter);

drivers/net/ethernet/broadcom/cnic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4164,7 +4164,7 @@ static int cnic_cm_init_bnx2_hw(struct cnic_dev *dev)
41644164
{
41654165
u32 seed;
41664166

4167-
seed = prandom_u32();
4167+
seed = get_random_u32();
41684168
cnic_ctx_wr(dev, 45, 0, seed);
41694169
return 0;
41704170
}

drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,7 @@ static void chtls_pass_accept_rpl(struct sk_buff *skb,
10631063
opt2 |= WND_SCALE_EN_V(WSCALE_OK(tp));
10641064
rpl5->opt0 = cpu_to_be64(opt0);
10651065
rpl5->opt2 = cpu_to_be32(opt2);
1066-
rpl5->iss = cpu_to_be32((prandom_u32() & ~7UL) - 1);
1066+
rpl5->iss = cpu_to_be32((get_random_u32() & ~7UL) - 1);
10671067
set_wr_txq(skb, CPL_PRIORITY_SETUP, csk->port_id);
10681068
t4_set_arp_err_handler(skb, sk, chtls_accept_rpl_arp_failure);
10691069
cxgb4_l2t_send(csk->egress_dev, skb, csk->l2t_entry);

drivers/net/ethernet/rocker/rocker_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ static int rocker_reg_test(const struct rocker *rocker)
129129
u64 test_reg;
130130
u64 rnd;
131131

132-
rnd = prandom_u32();
132+
rnd = get_random_u32();
133133
rnd >>= 1;
134134
rocker_write32(rocker, TEST_REG, rnd);
135135
test_reg = rocker_read32(rocker, TEST_REG);
@@ -139,9 +139,9 @@ static int rocker_reg_test(const struct rocker *rocker)
139139
return -EIO;
140140
}
141141

142-
rnd = prandom_u32();
142+
rnd = get_random_u32();
143143
rnd <<= 31;
144-
rnd |= prandom_u32();
144+
rnd |= get_random_u32();
145145
rocker_write64(rocker, TEST_REG64, rnd);
146146
test_reg = rocker_read64(rocker, TEST_REG64);
147147
if (test_reg != rnd * 2) {

drivers/net/wireless/marvell/mwifiex/cfg80211.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ mwifiex_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
239239
tx_info->pkt_len = pkt_len;
240240

241241
mwifiex_form_mgmt_frame(skb, buf, len);
242-
*cookie = prandom_u32() | 1;
242+
*cookie = get_random_u32() | 1;
243243

244244
if (ieee80211_is_action(mgmt->frame_control))
245245
skb = mwifiex_clone_skb_for_tx_status(priv,
@@ -303,7 +303,7 @@ mwifiex_cfg80211_remain_on_channel(struct wiphy *wiphy,
303303
duration);
304304

305305
if (!ret) {
306-
*cookie = prandom_u32() | 1;
306+
*cookie = get_random_u32() | 1;
307307
priv->roc_cfg.cookie = *cookie;
308308
priv->roc_cfg.chan = *chan;
309309

drivers/net/wireless/microchip/wilc1000/cfg80211.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ static int mgmt_tx(struct wiphy *wiphy,
11611161
const u8 *vendor_ie;
11621162
int ret = 0;
11631163

1164-
*cookie = prandom_u32();
1164+
*cookie = get_random_u32();
11651165
priv->tx_cookie = *cookie;
11661166
mgmt = (const struct ieee80211_mgmt *)buf;
11671167

drivers/net/wireless/quantenna/qtnfmac/cfg80211.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ qtnf_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
449449
{
450450
struct qtnf_vif *vif = qtnf_netdev_get_priv(wdev->netdev);
451451
const struct ieee80211_mgmt *mgmt_frame = (void *)params->buf;
452-
u32 short_cookie = prandom_u32();
452+
u32 short_cookie = get_random_u32();
453453
u16 flags = 0;
454454
u16 freq;
455455

drivers/net/wireless/ti/wlcore/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6100,7 +6100,7 @@ static int wl1271_register_hw(struct wl1271 *wl)
61006100
wl1271_warning("Fuse mac address is zero. using random mac");
61016101
/* Use TI oui and a random nic */
61026102
oui_addr = WLCORE_TI_OUI_ADDRESS;
6103-
nic_addr = get_random_int();
6103+
nic_addr = get_random_u32();
61046104
} else {
61056105
oui_addr = wl->fuse_oui_addr;
61066106
/* fuse has the BD_ADDR, the WLAN addresses are the next two */

drivers/nvme/common/auth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ u32 nvme_auth_get_seqnum(void)
2323

2424
mutex_lock(&nvme_dhchap_mutex);
2525
if (!nvme_dhchap_seqnum)
26-
nvme_dhchap_seqnum = prandom_u32();
26+
nvme_dhchap_seqnum = get_random_u32();
2727
else {
2828
nvme_dhchap_seqnum++;
2929
if (!nvme_dhchap_seqnum)

drivers/scsi/cxgbi/cxgb4i/cxgb4i.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static void send_act_open_req(struct cxgbi_sock *csk, struct sk_buff *skb,
254254
} else if (is_t5(lldi->adapter_type)) {
255255
struct cpl_t5_act_open_req *req =
256256
(struct cpl_t5_act_open_req *)skb->head;
257-
u32 isn = (prandom_u32() & ~7UL) - 1;
257+
u32 isn = (get_random_u32() & ~7UL) - 1;
258258

259259
INIT_TP_WR(req, 0);
260260
OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ,
@@ -282,7 +282,7 @@ static void send_act_open_req(struct cxgbi_sock *csk, struct sk_buff *skb,
282282
} else {
283283
struct cpl_t6_act_open_req *req =
284284
(struct cpl_t6_act_open_req *)skb->head;
285-
u32 isn = (prandom_u32() & ~7UL) - 1;
285+
u32 isn = (get_random_u32() & ~7UL) - 1;
286286

287287
INIT_TP_WR(req, 0);
288288
OPCODE_TID(req) = cpu_to_be32(MK_OPCODE_TID(CPL_ACT_OPEN_REQ,

drivers/target/iscsi/cxgbit/cxgbit_cm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1202,7 +1202,7 @@ cxgbit_pass_accept_rpl(struct cxgbit_sock *csk, struct cpl_pass_accept_req *req)
12021202
opt2 |= CONG_CNTRL_V(CONG_ALG_NEWRENO);
12031203

12041204
opt2 |= T5_ISS_F;
1205-
rpl5->iss = cpu_to_be32((prandom_u32() & ~7UL) - 1);
1205+
rpl5->iss = cpu_to_be32((get_random_u32() & ~7UL) - 1);
12061206

12071207
opt2 |= T5_OPT_2_VALID_F;
12081208

drivers/thunderbolt/xdomain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2437,7 +2437,7 @@ int tb_xdomain_init(void)
24372437
tb_property_add_immediate(xdomain_property_dir, "deviceid", 0x1);
24382438
tb_property_add_immediate(xdomain_property_dir, "devicerv", 0x80000100);
24392439

2440-
xdomain_property_block_gen = prandom_u32();
2440+
xdomain_property_block_gen = get_random_u32();
24412441
return 0;
24422442
}
24432443

drivers/video/fbdev/uvesafb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static int uvesafb_exec(struct uvesafb_ktask *task)
167167
memcpy(&m->id, &uvesafb_cn_id, sizeof(m->id));
168168
m->seq = seq;
169169
m->len = len;
170-
m->ack = prandom_u32();
170+
m->ack = get_random_u32();
171171

172172
/* uvesafb_task structure */
173173
memcpy(m + 1, &task->t, sizeof(task->t));

fs/exfat/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ static int exfat_fill_inode(struct inode *inode, struct exfat_dir_entry *info)
552552
inode->i_uid = sbi->options.fs_uid;
553553
inode->i_gid = sbi->options.fs_gid;
554554
inode_inc_iversion(inode);
555-
inode->i_generation = prandom_u32();
555+
inode->i_generation = get_random_u32();
556556

557557
if (info->attr & ATTR_SUBDIR) { /* directory */
558558
inode->i_generation &= ~1;

fs/ext4/ialloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1279,7 +1279,7 @@ struct inode *__ext4_new_inode(struct user_namespace *mnt_userns,
12791279
EXT4_GROUP_INFO_IBITMAP_CORRUPT);
12801280
goto out;
12811281
}
1282-
inode->i_generation = prandom_u32();
1282+
inode->i_generation = get_random_u32();
12831283

12841284
/* Precompute checksum seed for inode metadata */
12851285
if (ext4_has_metadata_csum(sb)) {

fs/ext4/ioctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,8 @@ static long swap_inode_boot_loader(struct super_block *sb,
454454
inode->i_ctime = inode_bl->i_ctime = current_time(inode);
455455
inode_inc_iversion(inode);
456456

457-
inode->i_generation = prandom_u32();
458-
inode_bl->i_generation = prandom_u32();
457+
inode->i_generation = get_random_u32();
458+
inode_bl->i_generation = get_random_u32();
459459
ext4_reset_inode_seed(inode);
460460
ext4_reset_inode_seed(inode_bl);
461461

fs/ext4/mmp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ static unsigned int mmp_new_seq(void)
265265
u32 new_seq;
266266

267267
do {
268-
new_seq = prandom_u32();
268+
new_seq = get_random_u32();
269269
} while (new_seq > EXT4_MMP_SEQ_MAX);
270270

271271
return new_seq;

fs/f2fs/namei.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ static struct inode *f2fs_new_inode(struct user_namespace *mnt_userns,
5050
inode->i_blocks = 0;
5151
inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
5252
F2FS_I(inode)->i_crtime = inode->i_mtime;
53-
inode->i_generation = prandom_u32();
53+
inode->i_generation = get_random_u32();
5454

5555
if (S_ISDIR(inode->i_mode))
5656
F2FS_I(inode)->i_current_depth = 1;

fs/fat/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de)
523523
inode->i_uid = sbi->options.fs_uid;
524524
inode->i_gid = sbi->options.fs_gid;
525525
inode_inc_iversion(inode);
526-
inode->i_generation = prandom_u32();
526+
inode->i_generation = get_random_u32();
527527

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

fs/nfsd/nfs4state.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4375,8 +4375,8 @@ nfsd4_init_leases_net(struct nfsd_net *nn)
43754375
nn->nfsd4_grace = 90;
43764376
nn->somebody_reclaimed = false;
43774377
nn->track_reclaim_completes = false;
4378-
nn->clverifier_counter = prandom_u32();
4379-
nn->clientid_base = prandom_u32();
4378+
nn->clverifier_counter = get_random_u32();
4379+
nn->clientid_base = get_random_u32();
43804380
nn->clientid_counter = nn->clientid_base + 1;
43814381
nn->s2s_cp_cl_id = nn->clientid_counter++;
43824382

0 commit comments

Comments
 (0)