Import of kernel-4.18.0-553.87.1.el8_10

This commit is contained in:
almalinux-bot-kernel 2025-12-06 04:06:17 +00:00
parent b8906f1e90
commit be886766a2
29 changed files with 206 additions and 43 deletions

View File

@ -12,7 +12,7 @@ RHEL_MINOR = 10
# #
# Use this spot to avoid future merge conflicts. # Use this spot to avoid future merge conflicts.
# Do not trim this comment. # Do not trim this comment.
RHEL_RELEASE = 553.85.1 RHEL_RELEASE = 553.87.1
# #
# ZSTREAM # ZSTREAM

View File

@ -486,6 +486,9 @@ static inline void cpu_feature_keys_init(void) { }
CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_ARCH_207S | \ CPU_FTR_DBELL | CPU_FTR_HAS_PPR | CPU_FTR_ARCH_207S | \
CPU_FTR_ARCH_300 | CPU_FTR_PKEY | \ CPU_FTR_ARCH_300 | CPU_FTR_PKEY | \
CPU_FTR_ARCH_31 | CPU_FTR_DAWR | CPU_FTR_DAWR1) CPU_FTR_ARCH_31 | CPU_FTR_DAWR | CPU_FTR_DAWR1)
#define CPU_FTRS_POWER11 CPU_FTRS_POWER10
#define CPU_FTRS_CELL (CPU_FTR_LWSYNC | \ #define CPU_FTRS_CELL (CPU_FTR_LWSYNC | \
CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \ CPU_FTR_PPCAS_ARCH_V2 | CPU_FTR_CTRL | \
CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \ CPU_FTR_ALTIVEC_COMP | CPU_FTR_MMCRA | CPU_FTR_SMT | \

View File

@ -125,6 +125,7 @@
#define MMU_FTRS_POWER8 MMU_FTRS_POWER6 #define MMU_FTRS_POWER8 MMU_FTRS_POWER6
#define MMU_FTRS_POWER9 MMU_FTRS_POWER6 #define MMU_FTRS_POWER9 MMU_FTRS_POWER6
#define MMU_FTRS_POWER10 MMU_FTRS_POWER6 #define MMU_FTRS_POWER10 MMU_FTRS_POWER6
#define MMU_FTRS_POWER11 MMU_FTRS_POWER6
#define MMU_FTRS_CELL MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ #define MMU_FTRS_CELL MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \
MMU_FTR_CI_LARGE_PAGE MMU_FTR_CI_LARGE_PAGE
#define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \ #define MMU_FTRS_PA6T MMU_FTRS_DEFAULT_HPTE_ARCH_V2 | \

View File

@ -102,7 +102,7 @@ struct power_pmu {
#define PPMU_LIMITED_PMC_REQD 2 /* have to put this on a limited PMC */ #define PPMU_LIMITED_PMC_REQD 2 /* have to put this on a limited PMC */
#define PPMU_ONLY_COUNT_RUN 4 /* only counting in run state */ #define PPMU_ONLY_COUNT_RUN 4 /* only counting in run state */
extern int register_power_pmu(struct power_pmu *); int __init register_power_pmu(struct power_pmu *pmu);
struct pt_regs; struct pt_regs;
extern unsigned long perf_misc_flags(struct pt_regs *regs); extern unsigned long perf_misc_flags(struct pt_regs *regs);

View File

@ -1346,6 +1346,7 @@
#define PVR_POWER8 0x004D #define PVR_POWER8 0x004D
#define PVR_POWER9 0x004E #define PVR_POWER9 0x004E
#define PVR_POWER10 0x0080 #define PVR_POWER10 0x0080
#define PVR_POWER11 0x0082
#define PVR_BE 0x0070 #define PVR_BE 0x0070
#define PVR_PA6T 0x0090 #define PVR_PA6T 0x0090
@ -1357,6 +1358,7 @@
#define PVR_ARCH_207 0x0f000004 #define PVR_ARCH_207 0x0f000004
#define PVR_ARCH_300 0x0f000005 #define PVR_ARCH_300 0x0f000005
#define PVR_ARCH_31 0x0f000006 #define PVR_ARCH_31 0x0f000006
#define PVR_ARCH_31_P11 0x0f000007
/* Macros for setting and retrieving special purpose registers */ /* Macros for setting and retrieving special purpose registers */
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__

View File

@ -130,6 +130,10 @@ extern void __restore_cpu_e6500(void);
PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | \ PPC_FEATURE2_ISEL | PPC_FEATURE2_TAR | \
PPC_FEATURE2_VEC_CRYPTO) PPC_FEATURE2_VEC_CRYPTO)
#define COMMON_USER_POWER11 COMMON_USER_POWER10
#define COMMON_USER2_POWER11 COMMON_USER2_POWER10
#ifdef CONFIG_PPC_BOOK3E_64 #ifdef CONFIG_PPC_BOOK3E_64
#define COMMON_USER_BOOKE (COMMON_USER_PPC64 | PPC_FEATURE_BOOKE) #define COMMON_USER_BOOKE (COMMON_USER_PPC64 | PPC_FEATURE_BOOKE)
#else #else
@ -393,6 +397,20 @@ static struct cpu_spec __initdata cpu_specs[] = {
.cpu_restore = __restore_cpu_power10, .cpu_restore = __restore_cpu_power10,
.platform = "power10", .platform = "power10",
}, },
{ /* 3.1-compliant processor, i.e. Power11 "architected" mode */
.pvr_mask = 0xffffffff,
.pvr_value = 0x0f000007,
.cpu_name = "Power11 (architected)",
.cpu_features = CPU_FTRS_POWER11,
.cpu_user_features = COMMON_USER_POWER11,
.cpu_user_features2 = COMMON_USER2_POWER11,
.mmu_features = MMU_FTRS_POWER11,
.icache_bsize = 128,
.dcache_bsize = 128,
.cpu_setup = __setup_cpu_power10,
.cpu_restore = __restore_cpu_power10,
.platform = "power11",
},
{ /* Power7 */ { /* Power7 */
.pvr_mask = 0xffff0000, .pvr_mask = 0xffff0000,
.pvr_value = 0x003f0000, .pvr_value = 0x003f0000,
@ -583,6 +601,23 @@ static struct cpu_spec __initdata cpu_specs[] = {
.machine_check_early = __machine_check_early_realmode_p10, .machine_check_early = __machine_check_early_realmode_p10,
.platform = "power10", .platform = "power10",
}, },
{ /* Power11 */
.pvr_mask = 0xffff0000,
.pvr_value = 0x00820000,
.cpu_name = "Power11 (raw)",
.cpu_features = CPU_FTRS_POWER11,
.cpu_user_features = COMMON_USER_POWER11,
.cpu_user_features2 = COMMON_USER2_POWER11,
.mmu_features = MMU_FTRS_POWER11,
.icache_bsize = 128,
.dcache_bsize = 128,
.num_pmcs = 6,
.pmc_type = PPC_PMC_IBM,
.cpu_setup = __setup_cpu_power10,
.cpu_restore = __restore_cpu_power10,
.machine_check_early = __machine_check_early_realmode_p10,
.platform = "power11",
},
{ /* Cell Broadband Engine */ { /* Cell Broadband Engine */
.pvr_mask = 0xffff0000, .pvr_mask = 0xffff0000,
.pvr_value = 0x00700000, .pvr_value = 0x00700000,

View File

@ -484,6 +484,14 @@ static int __init feat_enable_mce_power10(struct dt_cpu_feature *f)
return 1; return 1;
} }
static int __init feat_enable_mce_power11(struct dt_cpu_feature *f)
{
cur_cpu_spec->platform = "power11";
cur_cpu_spec->machine_check_early = __machine_check_early_realmode_p10;
return 1;
}
static int __init feat_enable_tm(struct dt_cpu_feature *f) static int __init feat_enable_tm(struct dt_cpu_feature *f)
{ {
#ifdef CONFIG_PPC_TRANSACTIONAL_MEM #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
@ -673,8 +681,10 @@ static struct dt_cpu_feature_match __initdata
{"pc-relative-addressing", feat_enable, 0}, {"pc-relative-addressing", feat_enable, 0},
{"machine-check-power9", feat_enable_mce_power9, 0}, {"machine-check-power9", feat_enable_mce_power9, 0},
{"machine-check-power10", feat_enable_mce_power10, 0}, {"machine-check-power10", feat_enable_mce_power10, 0},
{"machine-check-power11", feat_enable_mce_power11, 0},
{"performance-monitor-power9", feat_enable_pmu_power9, 0}, {"performance-monitor-power9", feat_enable_pmu_power9, 0},
{"performance-monitor-power10", feat_enable_pmu_power10, 0}, {"performance-monitor-power10", feat_enable_pmu_power10, 0},
{"performance-monitor-power11", feat_enable_pmu_power10, 0},
{"event-based-branch-v3", feat_enable, 0}, {"event-based-branch-v3", feat_enable, 0},
{"random-number-generator", feat_enable, 0}, {"random-number-generator", feat_enable, 0},
{"system-call-vectored", feat_disable, 0}, {"system-call-vectored", feat_disable, 0},

View File

@ -219,6 +219,7 @@ static int __prombss mem_reserve_cnt;
static cell_t __prombss regbuf[1024]; static cell_t __prombss regbuf[1024];
static bool __prombss rtas_has_query_cpu_stopped; static bool __prombss rtas_has_query_cpu_stopped;
static int __prombss enable_p11_val;
/* /*
@ -816,6 +817,15 @@ static void __init early_cmdline_parse(void)
} else } else
prom_radix_disable = true; prom_radix_disable = true;
} }
opt = prom_strstr(prom_cmd_line, "enable_p11");
if (opt) {
opt += 12;
enable_p11_val = 1;
} else {
enable_p11_val = 0;
}
if (prom_radix_disable) if (prom_radix_disable)
prom_debug("Radix disabled from cmdline\n"); prom_debug("Radix disabled from cmdline\n");
@ -922,7 +932,7 @@ struct option_vector6 {
} __packed; } __packed;
struct ibm_arch_vec { struct ibm_arch_vec {
struct { u32 mask, val; } pvrs[14]; struct { u32 mask, val; } pvrs[16];
u8 num_vectors; u8 num_vectors;
@ -979,6 +989,14 @@ static const struct ibm_arch_vec ibm_architecture_vec_template __initconst = {
.mask = cpu_to_be32(0xffff0000), /* POWER10 */ .mask = cpu_to_be32(0xffff0000), /* POWER10 */
.val = cpu_to_be32(0x00800000), .val = cpu_to_be32(0x00800000),
}, },
{
.mask = cpu_to_be32(0xffff0000), /* POWER11 */
.val = cpu_to_be32(0x00820000),
},
{
.mask = cpu_to_be32(0xffffffff), /* P11 compliant */
.val = cpu_to_be32(0x0f000007),
},
{ {
.mask = cpu_to_be32(0xffffffff), /* all 3.1-compliant */ .mask = cpu_to_be32(0xffffffff), /* all 3.1-compliant */
.val = cpu_to_be32(0x0f000006), .val = cpu_to_be32(0x0f000006),
@ -1308,10 +1326,19 @@ static void __init prom_check_platform_support(void)
}; };
int prop_len = prom_getproplen(prom.chosen, int prop_len = prom_getproplen(prom.chosen,
"ibm,arch-vec-5-platform-support"); "ibm,arch-vec-5-platform-support");
int i;
/* First copy the architecture vec template */ /* First copy the architecture vec template */
ibm_architecture_vec = ibm_architecture_vec_template; ibm_architecture_vec = ibm_architecture_vec_template;
if (!enable_p11_val) {
for (i=0;i<16; i++) {
if ((ibm_architecture_vec.pvrs[i].val == cpu_to_be32(0x0f000007)) ||
(ibm_architecture_vec.pvrs[i].val == cpu_to_be32(0x00820000)))
ibm_architecture_vec.pvrs[i].val = 0x0;
}
}
if (prop_len > 1) { if (prop_len > 1) {
int i; int i;
u8 vec[prop_len]; u8 vec[prop_len];

View File

@ -389,6 +389,7 @@ static int kvmppc_set_arch_compat(struct kvm_vcpu *vcpu, u32 arch_compat)
guest_pcr_bit = PCR_ARCH_300; guest_pcr_bit = PCR_ARCH_300;
break; break;
case PVR_ARCH_31: case PVR_ARCH_31:
case PVR_ARCH_31_P11:
guest_pcr_bit = PCR_ARCH_31; guest_pcr_bit = PCR_ARCH_31;
break; break;
default: default:

View File

@ -2510,7 +2510,7 @@ static int power_pmu_prepare_cpu(unsigned int cpu)
return 0; return 0;
} }
int register_power_pmu(struct power_pmu *pmu) int __init register_power_pmu(struct power_pmu *pmu)
{ {
if (ppmu) if (ppmu)
return -EBUSY; /* something's already registered */ return -EBUSY; /* something's already registered */
@ -2554,6 +2554,8 @@ static int __init init_ppc64_pmu(void)
return 0; return 0;
else if (!init_power10_pmu()) else if (!init_power10_pmu())
return 0; return 0;
else if (!init_power11_pmu())
return 0;
else if (!init_ppc970_pmu()) else if (!init_ppc970_pmu())
return 0; return 0;
else else

View File

@ -307,7 +307,7 @@ static struct power_pmu generic_compat_pmu = {
.attr_groups = generic_compat_pmu_attr_groups, .attr_groups = generic_compat_pmu_attr_groups,
}; };
int init_generic_compat_pmu(void) int __init init_generic_compat_pmu(void)
{ {
int rc = 0; int rc = 0;

View File

@ -2,12 +2,13 @@
// //
// Copyright 2019 Madhavan Srinivasan, IBM Corporation. // Copyright 2019 Madhavan Srinivasan, IBM Corporation.
extern int init_ppc970_pmu(void); int __init init_ppc970_pmu(void);
extern int init_power5_pmu(void); int __init init_power5_pmu(void);
extern int init_power5p_pmu(void); int __init init_power5p_pmu(void);
extern int init_power6_pmu(void); int __init init_power6_pmu(void);
extern int init_power7_pmu(void); int __init init_power7_pmu(void);
extern int init_power8_pmu(void); int __init init_power8_pmu(void);
extern int init_power9_pmu(void); int __init init_power9_pmu(void);
extern int init_power10_pmu(void); int __init init_power10_pmu(void);
extern int init_generic_compat_pmu(void); int __init init_power11_pmu(void);
int __init init_generic_compat_pmu(void);

View File

@ -593,7 +593,7 @@ static struct power_pmu power10_pmu = {
.check_attr_config = power10_check_attr_config, .check_attr_config = power10_check_attr_config,
}; };
int init_power10_pmu(void) int __init init_power10_pmu(void)
{ {
unsigned int pvr; unsigned int pvr;
int rc; int rc;
@ -626,3 +626,30 @@ int init_power10_pmu(void)
return 0; return 0;
} }
static struct power_pmu power11_pmu;
int __init init_power11_pmu(void)
{
unsigned int pvr;
int rc;
pvr = mfspr(SPRN_PVR);
if (PVR_VER(pvr) != PVR_POWER11)
return -ENODEV;
/* Set the PERF_REG_EXTENDED_MASK here */
PERF_REG_EXTENDED_MASK = PERF_REG_PMU_MASK_31;
power11_pmu = power10_pmu;
power11_pmu.name = "Power11";
rc = register_power_pmu(&power11_pmu);
if (rc)
return rc;
/* Tell userspace that EBB is supported */
cur_cpu_spec->cpu_user_features2 |= PPC_FEATURE2_EBB;
return 0;
}

View File

@ -679,7 +679,7 @@ static struct power_pmu power5p_pmu = {
.cache_events = &power5p_cache_events, .cache_events = &power5p_cache_events,
}; };
int init_power5p_pmu(void) int __init init_power5p_pmu(void)
{ {
if (!cur_cpu_spec->oprofile_cpu_type || if (!cur_cpu_spec->oprofile_cpu_type ||
(strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power5+") (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power5+")

View File

@ -620,7 +620,7 @@ static struct power_pmu power5_pmu = {
.flags = PPMU_HAS_SSLOT, .flags = PPMU_HAS_SSLOT,
}; };
int init_power5_pmu(void) int __init init_power5_pmu(void)
{ {
if (!cur_cpu_spec->oprofile_cpu_type || if (!cur_cpu_spec->oprofile_cpu_type ||
strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power5")) strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power5"))

View File

@ -541,7 +541,7 @@ static struct power_pmu power6_pmu = {
.cache_events = &power6_cache_events, .cache_events = &power6_cache_events,
}; };
int init_power6_pmu(void) int __init init_power6_pmu(void)
{ {
if (!cur_cpu_spec->oprofile_cpu_type || if (!cur_cpu_spec->oprofile_cpu_type ||
strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power6")) strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power6"))

View File

@ -446,7 +446,7 @@ static struct power_pmu power7_pmu = {
.cache_events = &power7_cache_events, .cache_events = &power7_cache_events,
}; };
int init_power7_pmu(void) int __init init_power7_pmu(void)
{ {
if (!cur_cpu_spec->oprofile_cpu_type || if (!cur_cpu_spec->oprofile_cpu_type ||
strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power7")) strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power7"))

View File

@ -382,7 +382,7 @@ static struct power_pmu power8_pmu = {
.bhrb_nr = 32, .bhrb_nr = 32,
}; };
int init_power8_pmu(void) int __init init_power8_pmu(void)
{ {
int rc; int rc;

View File

@ -456,7 +456,7 @@ static struct power_pmu power9_pmu = {
.check_attr_config = power9_check_attr_config, .check_attr_config = power9_check_attr_config,
}; };
int init_power9_pmu(void) int __init init_power9_pmu(void)
{ {
int rc = 0; int rc = 0;
unsigned int pvr = mfspr(SPRN_PVR); unsigned int pvr = mfspr(SPRN_PVR);

View File

@ -491,7 +491,7 @@ static struct power_pmu ppc970_pmu = {
.flags = PPMU_NO_SIPR | PPMU_NO_CONT_SAMPLING, .flags = PPMU_NO_SIPR | PPMU_NO_CONT_SAMPLING,
}; };
int init_ppc970_pmu(void) int __init init_ppc970_pmu(void)
{ {
if (!cur_cpu_spec->oprofile_cpu_type || if (!cur_cpu_spec->oprofile_cpu_type ||
(strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/970") (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/970")

View File

@ -320,6 +320,9 @@ static int nbd_set_size(struct nbd_device *nbd, loff_t bytesize,
if (blksize < 512 || blksize > PAGE_SIZE || !is_power_of_2(blksize)) if (blksize < 512 || blksize > PAGE_SIZE || !is_power_of_2(blksize))
return -EINVAL; return -EINVAL;
if (bytesize < 0)
return -EINVAL;
nbd->config->bytesize = bytesize; nbd->config->bytesize = bytesize;
nbd->config->blksize = blksize; nbd->config->blksize = blksize;
@ -1051,6 +1054,9 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg,
struct nbd_sock *nsock; struct nbd_sock *nsock;
int err; int err;
/* Arg will be cast to int, check it to avoid overflow */
if (arg > INT_MAX)
return -EINVAL;
sock = nbd_get_socket(nbd, arg, &err); sock = nbd_get_socket(nbd, arg, &err);
if (!sock) if (!sock)
return err; return err;

View File

@ -559,12 +559,13 @@ static int e1000_set_eeprom(struct net_device *netdev,
{ {
struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
__u32 total_len;
size_t max_len;
u16 *eeprom_buff; u16 *eeprom_buff;
void *ptr; int ret_val = 0;
int max_len;
int first_word; int first_word;
int last_word; int last_word;
int ret_val = 0; void *ptr;
u16 i; u16 i;
if (eeprom->len == 0) if (eeprom->len == 0)
@ -579,6 +580,10 @@ static int e1000_set_eeprom(struct net_device *netdev,
max_len = hw->nvm.word_size * 2; max_len = hw->nvm.word_size * 2;
if (check_add_overflow(eeprom->offset, eeprom->len, &total_len) ||
total_len > max_len)
return -EFBIG;
first_word = eeprom->offset >> 1; first_word = eeprom->offset >> 1;
last_word = (eeprom->offset + eeprom->len - 1) >> 1; last_word = (eeprom->offset + eeprom->len - 1) >> 1;
eeprom_buff = kmalloc(max_len, GFP_KERNEL); eeprom_buff = kmalloc(max_len, GFP_KERNEL);

View File

@ -1591,12 +1591,21 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
struct cifs_sb_info *cifs_sb = CIFS_SB(sb); struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
struct tcon_link *tlink; struct tcon_link *tlink;
struct cifs_tcon *tcon; struct cifs_tcon *tcon;
__u32 dosattr = 0, origattr = 0;
struct TCP_Server_Info *server; struct TCP_Server_Info *server;
struct iattr *attrs = NULL; struct iattr *attrs = NULL;
__u32 dosattr = 0, origattr = 0; bool rehash = false;
cifs_dbg(FYI, "cifs_unlink, dir=0x%p, dentry=0x%p\n", dir, dentry); cifs_dbg(FYI, "cifs_unlink, dir=0x%p, dentry=0x%p\n", dir, dentry);
/* Unhash dentry in advance to prevent any concurrent opens */
spin_lock(&dentry->d_lock);
if (!d_unhashed(dentry)) {
__d_drop(dentry);
rehash = true;
}
spin_unlock(&dentry->d_lock);
tlink = cifs_sb_tlink(cifs_sb); tlink = cifs_sb_tlink(cifs_sb);
if (IS_ERR(tlink)) if (IS_ERR(tlink))
return PTR_ERR(tlink); return PTR_ERR(tlink);
@ -1642,7 +1651,8 @@ psx_del_no_retry:
if (inode) if (inode)
cifs_drop_nlink(inode); cifs_drop_nlink(inode);
} else if (rc == -ENOENT) { } else if (rc == -ENOENT) {
d_drop(dentry); if (simple_positive(dentry))
d_delete(dentry);
} else if (rc == -EBUSY) { } else if (rc == -EBUSY) {
if (server->ops->rename_pending_delete) { if (server->ops->rename_pending_delete) {
rc = server->ops->rename_pending_delete(full_path, rc = server->ops->rename_pending_delete(full_path,
@ -1693,6 +1703,8 @@ unlink_out:
kfree(attrs); kfree(attrs);
free_xid(xid); free_xid(xid);
cifs_put_tlink(tlink); cifs_put_tlink(tlink);
if (rehash)
d_rehash(dentry);
return rc; return rc;
} }
@ -2066,6 +2078,7 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry,
struct cifs_sb_info *cifs_sb; struct cifs_sb_info *cifs_sb;
struct tcon_link *tlink; struct tcon_link *tlink;
struct cifs_tcon *tcon; struct cifs_tcon *tcon;
bool rehash = false;
FILE_UNIX_BASIC_INFO *info_buf_source = NULL; FILE_UNIX_BASIC_INFO *info_buf_source = NULL;
FILE_UNIX_BASIC_INFO *info_buf_target; FILE_UNIX_BASIC_INFO *info_buf_target;
unsigned int xid; unsigned int xid;
@ -2074,6 +2087,17 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry,
if (flags & ~RENAME_NOREPLACE) if (flags & ~RENAME_NOREPLACE)
return -EINVAL; return -EINVAL;
/*
* Prevent any concurrent opens on the target by unhashing the dentry.
* VFS already unhashes the target when renaming directories.
*/
if (d_is_positive(target_dentry) && !d_is_dir(target_dentry)) {
if (!d_unhashed(target_dentry)) {
d_drop(target_dentry);
rehash = true;
}
}
cifs_sb = CIFS_SB(source_dir->i_sb); cifs_sb = CIFS_SB(source_dir->i_sb);
tlink = cifs_sb_tlink(cifs_sb); tlink = cifs_sb_tlink(cifs_sb);
if (IS_ERR(tlink)) if (IS_ERR(tlink))
@ -2099,6 +2123,8 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry,
rc = cifs_do_rename(xid, source_dentry, from_name, target_dentry, rc = cifs_do_rename(xid, source_dentry, from_name, target_dentry,
to_name); to_name);
if (!rc)
rehash = false;
/* /*
* No-replace is the natural behavior for CIFS, so skip unlink hacks. * No-replace is the natural behavior for CIFS, so skip unlink hacks.
*/ */
@ -2154,6 +2180,8 @@ unlink_target:
goto cifs_rename_exit; goto cifs_rename_exit;
rc = cifs_do_rename(xid, source_dentry, from_name, rc = cifs_do_rename(xid, source_dentry, from_name,
target_dentry, to_name); target_dentry, to_name);
if (!rc)
rehash = false;
} }
/* force revalidate to go get info when needed */ /* force revalidate to go get info when needed */
@ -2163,6 +2191,8 @@ unlink_target:
target_dir->i_mtime = current_time(source_dir); target_dir->i_mtime = current_time(source_dir);
cifs_rename_exit: cifs_rename_exit:
if (rehash)
d_rehash(target_dentry);
kfree(info_buf_source); kfree(info_buf_source);
free_dentry_path(page2); free_dentry_path(page2);
free_dentry_path(page1); free_dentry_path(page1);

View File

@ -4039,10 +4039,16 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
} }
status = nfs_ok; status = nfs_ok;
if (conf) { if (conf) {
old = unconf; if (get_client_locked(conf) == nfs_ok) {
unhash_client_locked(old); old = unconf;
nfsd4_change_callback(conf, &unconf->cl_cb_conn); unhash_client_locked(old);
} else { nfsd4_change_callback(conf, &unconf->cl_cb_conn);
} else {
conf = NULL;
}
}
if (!conf) {
old = find_confirmed_client_by_name(&unconf->cl_name, nn); old = find_confirmed_client_by_name(&unconf->cl_name, nn);
if (old) { if (old) {
status = nfserr_clid_inuse; status = nfserr_clid_inuse;
@ -4059,10 +4065,14 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
} }
trace_nfsd_clid_replaced(&old->cl_clientid); trace_nfsd_clid_replaced(&old->cl_clientid);
} }
status = get_client_locked(unconf);
if (status != nfs_ok) {
old = NULL;
goto out;
}
move_to_confirmed(unconf); move_to_confirmed(unconf);
conf = unconf; conf = unconf;
} }
get_client_locked(conf);
spin_unlock(&nn->client_lock); spin_unlock(&nn->client_lock);
if (conf == unconf) if (conf == unconf)
fsnotify_parent(NULL, conf->cl_nfsd_info_dentry, FS_MODIFY); fsnotify_parent(NULL, conf->cl_nfsd_info_dentry, FS_MODIFY);

View File

@ -1776,10 +1776,9 @@ int unpoison_memory(unsigned long pfn)
static DEFINE_RATELIMIT_STATE(unpoison_rs, DEFAULT_RATELIMIT_INTERVAL, static DEFINE_RATELIMIT_STATE(unpoison_rs, DEFAULT_RATELIMIT_INTERVAL,
DEFAULT_RATELIMIT_BURST); DEFAULT_RATELIMIT_BURST);
if (!pfn_valid(pfn)) p = pfn_to_online_page(pfn);
return -ENXIO; if (!p)
return -EIO;
p = pfn_to_page(pfn);
page = compound_head(p); page = compound_head(p);
if (!PageHWPoison(p)) { if (!PageHWPoison(p)) {

View File

@ -2612,6 +2612,7 @@ int tcp_disconnect(struct sock *sk, int flags)
struct tcp_sock *tp = tcp_sk(sk); struct tcp_sock *tp = tcp_sk(sk);
int err = 0; int err = 0;
int old_state = sk->sk_state; int old_state = sk->sk_state;
struct request_sock *req;
u32 seq; u32 seq;
if (old_state != TCP_CLOSE) if (old_state != TCP_CLOSE)
@ -2715,6 +2716,10 @@ int tcp_disconnect(struct sock *sk, int flags)
/* Clean up fastopen related fields */ /* Clean up fastopen related fields */
req = rcu_dereference_protected(tp->fastopen_rsk,
lockdep_sock_is_held(sk));
if (req)
reqsk_fastopen_remove(sk, req, false);
tcp_free_fastopen_req(tp); tcp_free_fastopen_req(tp);
inet->defer_connect = 0; inet->defer_connect = 0;

View File

@ -6851,7 +6851,6 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
&foc, TCP_SYNACK_FASTOPEN, skb); &foc, TCP_SYNACK_FASTOPEN, skb);
/* Add the child socket directly into the accept queue */ /* Add the child socket directly into the accept queue */
if (!inet_csk_reqsk_queue_add(sk, req, fastopen_sk)) { if (!inet_csk_reqsk_queue_add(sk, req, fastopen_sk)) {
reqsk_fastopen_remove(fastopen_sk, req, false);
bh_unlock_sock(fastopen_sk); bh_unlock_sock(fastopen_sk);
sock_put(fastopen_sk); sock_put(fastopen_sk);
goto drop_and_free; goto drop_and_free;

View File

@ -34,7 +34,7 @@ get_cpuid_str(struct perf_pmu *pmu __maybe_unused)
{ {
char *bufp; char *bufp;
if (asprintf(&bufp, "%.8lx", mfspr(SPRN_PVR)) < 0) if (asprintf(&bufp, "0x%.8lx", mfspr(SPRN_PVR)) < 0)
bufp = NULL; bufp = NULL;
return bufp; return bufp;

View File

@ -11,8 +11,8 @@
# #
# Multiple PVRs could map to a single JSON file. # Multiple PVRs could map to a single JSON file.
# #
0x004[bcd][[:xdigit:]]{4},1,power8,core
# Power8 entries 0x0066[[:xdigit:]]{4},1,power8,core
004[bcd][[:xdigit:]]{4},1,power8,core 0x004e[[:xdigit:]]{4},1,power9,core
004e[[:xdigit:]]{4},1,power9,core 0x0080[[:xdigit:]]{4},1,power10,core
0080[[:xdigit:]]{4},1,power10,core 0x0082[[:xdigit:]]{4},1,power10,core

1 # Format:
11 #
12 # Multiple PVRs could map to a single JSON file.
13 #
14 # Power8 entries 0x004[bcd][[:xdigit:]]{4},1,power8,core
15 004[bcd][[:xdigit:]]{4},1,power8,core 0x0066[[:xdigit:]]{4},1,power8,core
16 004e[[:xdigit:]]{4},1,power9,core 0x004e[[:xdigit:]]{4},1,power9,core
17 0080[[:xdigit:]]{4},1,power10,core 0x0080[[:xdigit:]]{4},1,power10,core
18 0x0082[[:xdigit:]]{4},1,power10,core