Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 5.4-2.1.x-imx to v5.4.75 from stable #167

Merged
merged 213 commits into from
Nov 8, 2020
Merged
Changes from 1 commit
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
a013796
xen/events: avoid removing an event channel while handling it
jgross1 Sep 7, 2020
4bea575
xen/events: add a proper barrier to 2-level uevent unmasking
jgross1 Sep 7, 2020
44a455e
xen/events: fix race in evtchn_fifo_unmask()
jgross1 Oct 20, 2020
df54eca
xen/events: add a new "late EOI" evtchn framework
jgross1 Sep 7, 2020
ade6bd5
xen/blkback: use lateeoi irq binding
jgross1 Sep 7, 2020
e6ea898
xen/netback: use lateeoi irq binding
jgross1 Sep 7, 2020
5441639
xen/scsiback: use lateeoi irq binding
jgross1 Sep 7, 2020
9396de4
xen/pvcallsback: use lateeoi irq binding
jgross1 Sep 7, 2020
48b533a
xen/pciback: use lateeoi irq binding
jgross1 Sep 7, 2020
b7d6a66
xen/events: switch user event channels to lateeoi model
jgross1 Sep 7, 2020
25c23f0
xen/events: use a common cpu hotplug hook for event channels
jgross1 Sep 13, 2020
1d628c3
xen/events: defer eoi in case of excessive number of events
jgross1 Sep 7, 2020
85d9d02
xen/events: block rogue events for some time
jgross1 Sep 14, 2020
aedcfe9
firmware: arm_scmi: Fix ARCH_COLD_RESET
etienne-lms Oct 8, 2020
6937c14
firmware: arm_scmi: Add missing Rx size re-initialisation
sudeep-holla Oct 12, 2020
f7e7de2
x86/unwind/orc: Fix inactive tasks with stack pointer in %sp on GCC 1…
Oct 14, 2020
d90dd15
mlxsw: core: Fix use-after-free in mlxsw_emad_trans_finish()
Oct 24, 2020
da8e2fb
RDMA/qedr: Fix memory leak in iWARP CM
alokprasad7 Oct 21, 2020
87d9ac9
ata: sata_nv: Fix retrieving of active qcs
saschahauer May 8, 2020
2db7590
futex: Fix incorrect should_fail_futex() handling
Sep 27, 2020
dc17b99
powerpc/powernv/smp: Fix spurious DBG() warning
oohal Aug 4, 2020
82e93f9
mm: fix exec activate_mm vs TLB shootdown and lazy tlb switching race
npiggin Sep 14, 2020
7d59323
powerpc: select ARCH_WANT_IRQS_OFF_ACTIVATE_MM
npiggin Sep 14, 2020
2eab897
sparc64: remove mm_cpumask clearing to fix kthread_use_mm race
npiggin Sep 14, 2020
40b357f
f2fs: add trace exit in exception path
Sep 21, 2020
1544dcb
f2fs: fix uninit-value in f2fs_lookup
chaseyu Sep 29, 2020
9804eda
f2fs: fix to check segment boundary during SIT page readahead
chaseyu Sep 29, 2020
fb9b181
s390/startup: avoid save_area_sync overflow
Sep 24, 2020
15c7ec0
um: change sigio_spinlock to a mutex
jmberg-intel Jun 4, 2020
df5b07f
f2fs: handle errors of f2fs_get_meta_page_nofail
Oct 2, 2020
13081d5
ARM: 8997/2: hw_breakpoint: Handle inexact watchpoint addresses
dianders Aug 6, 2020
036b0f4
NFS4: Fix oops when copy_file_range is attempted with NFS4.0 source
DaveWysochanskiRH Aug 4, 2020
a10ed3b
power: supply: bq27xxx: report "not charging" on all types
krzk Sep 19, 2020
b2844ba
xfs: fix realtime bitmap/summary file truncation when growing rt volume
djwong Oct 7, 2020
759721f
video: fbdev: pvr2fb: initialize variables
Jul 20, 2020
b30a5c8
ath10k: start recovery process when payload length exceeds max htc le…
Aug 14, 2020
ed0bd7b
ath10k: fix VHT NSS calculation when STBC is enabled
Aug 14, 2020
581940d
drm/brige/megachips: Add checking if ge_b850v3_lvds_init() is working…
Aug 19, 2020
ac43780
selftests/x86/fsgsbase: Reap a forgotten child
amluto Aug 26, 2020
3a85688
media: videodev2.h: RGB BT2020 and HSV are always full range
Aug 20, 2020
5472c5d
media: platform: Improve queue set up flow for bug fixing
Aug 14, 2020
47ab020
usb: typec: tcpm: During PR_SWAP, source caps should be sent only aft…
Aug 17, 2020
448e500
media: tw5864: check status of tw5864_frameinterval_get
Aug 10, 2020
67e18c9
media: imx274: fix frame interval handling
hverkuil Jul 3, 2020
d3fb88a
mmc: via-sdmmc: Fix data race bug
Aug 22, 2020
7975367
drm/bridge/synopsys: dsi: add support for non-continuous HS clock
AntonioBorneo Jul 1, 2020
80685a9
arm64: topology: Stop using MPIDR for topology information
Aug 29, 2020
b3142fe
printk: reduce LOG_BUF_SHIFT range for H8300
jogness Aug 12, 2020
77fa5e1
ia64: kprobes: Use generic kretprobe trampoline handler
mhiramat Aug 29, 2020
f7f7b77
kgdb: Make "kgdbcon" work properly with "kgdb_earlycon"
dianders Jun 30, 2020
4801ffd
bpf: Permit map_ptr arithmetic with opcode add and offset 0
yonghong-song Sep 8, 2020
8f71fb7
media: uvcvideo: Fix dereference of out-of-bound list iterator
dwlsalmeida Aug 7, 2020
58c8046
selftests/bpf: Define string const as global for test_sysctl_prog.c
yonghong-song Sep 10, 2020
7762afa
samples/bpf: Fix possible deadlock in xdpsock
magnus-karlsson Sep 10, 2020
2eab702
riscv: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO
zongbox Aug 31, 2020
6505276
cpufreq: sti-cpufreq: add stih418 support
Aug 31, 2020
16b9e40
USB: adutux: fix debugging
oneukum Sep 17, 2020
2502107
uio: free uio id after uio file node is freed
langdai1 Sep 14, 2020
8fd52a2
coresight: Make sysfs functional on topologies with per core sink
Sep 16, 2020
7f7f437
usb: xhci: omit duplicate actions when suspending a runtime suspended…
Sep 18, 2020
ea888a1
SUNRPC: Mitigate cond_resched() in xprt_transmit()
chucklever Jul 8, 2020
64129ad
arm64/mm: return cpu_all_mask when node is NUMA_NO_NODE
Sep 21, 2020
7551e2f
can: flexcan: disable clocks during stop mode
Dec 10, 2019
5880a0d
xfs: don't free rt blocks when we're doing a REMAP bunmapi call
djwong Sep 21, 2020
cf9cc49
ACPI: Add out of bounds and numa_off protections to pxm_to_node()
jic23 Aug 18, 2020
592cbc0
brcmfmac: Fix warning message after dongle setup failed
WenChieh-Feng Sep 28, 2020
0606a8d
drivers/net/wan/hdlc_fr: Correctly handle special skb->protocol values
Sep 28, 2020
37464a8
bus/fsl_mc: Do not rely on caller to provide non NULL mc_io
dmcraciun Sep 29, 2020
cf5a612
ACPI: HMAT: Fix handling of changes from ACPI 6.2 to ACPI 6.3
jic23 Sep 30, 2020
3ef6095
power: supply: test_power: add missing newlines when printing paramet…
fenghusthu Sep 4, 2020
5759f38
drm/amd/display: HDMI remote sink need mode validation for Linux
Sep 21, 2020
1f145a1
ARC: [dts] fix the errors detected by dtbs_check
Sep 24, 2020
4ebdad0
btrfs: fix replace of seed device
asj Sep 4, 2020
7845240
md/bitmap: md_bitmap_get_counter returns wrong blocks
zhaohem Oct 5, 2020
dfcfccd
bnxt_en: Log unknown link speed appropriately.
Oct 12, 2020
f66125e
rpmsg: glink: Use complete_all for open states
Jun 24, 2020
660e2d9
clk: ti: clockdomain: fix static checker warning
Sep 7, 2020
229bdf0
net: 9p: initialize sun_server.sun_path to have addr's value only whe…
thazhemadam Oct 12, 2020
d01b633
drivers: watchdog: rdc321x_wdt: Fix race condition bugs
Aug 7, 2020
d7d7920
ext4: Detect already used quota file early
jankara Oct 15, 2020
9b58c55
KVM: PPC: Book3S HV: Do not allocate HPT for a nested guest
farosas Sep 11, 2020
9f7e4bf
gfs2: use-after-free in sysfs deregistration
Oct 12, 2020
3c78eb1
gfs2: add validation checks for size of superblock
thazhemadam Oct 14, 2020
e2dca88
cifs: handle -EINTR in cifs_setattr
Oct 8, 2020
c70f909
arm64: dts: renesas: ulcb: add full-pwr-cycle-in-suspend into eMMC nodes
shimoday Jul 17, 2020
2f98e28
ARM: dts: omap4: Fix sgx clock rate for 4430
tmlind Mar 10, 2020
c6029d9
memory: emif: Remove bogus debugfs error handling
Aug 26, 2020
8c1b47e
ARM: dts: s5pv210: remove DMA controller bus node name to fix dtschem…
krzk Sep 7, 2020
8a9024f
ARM: dts: s5pv210: move fixed clocks under root node
krzk Sep 7, 2020
3ad1464
ARM: dts: s5pv210: move PMU node out of clock controller
krzk Sep 7, 2020
b71dbaf
ARM: dts: s5pv210: remove dedicated 'audio-subsystem' node
krzk Sep 7, 2020
742fd49
nbd: make the config put is called before the notifying the waiter
lxbsz Oct 14, 2020
c421c08
sgl_alloc_order: fix memory leak
doug-gilbert Oct 15, 2020
a7aa5d5
nvme-rdma: fix crash when connect rejected
lostandy26 Oct 12, 2020
b91d479
md/raid5: fix oops during stripe resizing
liu-song-6 Oct 5, 2020
3f56e94
mmc: sdhci: Add LTR support for some Intel BYT based controllers
ahunter6 Aug 18, 2020
470c8c4
mmc: sdhci-acpi: AMDI0040: Set SDHCI_QUIRK2_PRESET_VALUE_BROKEN
Sep 28, 2020
2d1c482
seccomp: Make duplicate listener detection non-racy
thejh Oct 5, 2020
3674b04
selftests/x86/fsgsbase: Test PTRACE_PEEKUSER for GSBASE with invalid …
amluto Aug 26, 2020
f9a48ff
perf/x86/intel: Fix Ice Lake event constraint table
Sep 28, 2020
2e2a324
perf/x86/amd/ibs: Don't include randomized bits in get_ibs_op_count()
kimphillamd Sep 8, 2020
d789e1c
perf/x86/amd/ibs: Fix raw sample data accumulation
kimphillamd Sep 8, 2020
004fb02
spi: sprd: Release DMA channel also on probe deferral
krzk Sep 1, 2020
a908e29
extcon: ptn5150: Fix usage of atomic GPIO with sleeping GPIO chips
krzk Aug 17, 2020
8ac92a5
leds: bcm6328, bcm6358: use devres LED registering function
elkablo Sep 17, 2020
2f3cb99
media: uvcvideo: Fix uvc_ctrl_fixup_xu_info() not having any effect
jwrdegoede Jul 28, 2020
f8a6a2e
fs: Don't invalidate page buffers in block_write_full_page()
jankara Sep 4, 2020
c75b77c
NFS: fix nfs_path in case of a rename retry
ashishsangwan2 Oct 5, 2020
5e25b44
ACPI: button: fix handling lid state changes when input device closed
dtor Oct 5, 2020
9578d73
ACPI / extlog: Check for RDMSR failure
bwhacks Sep 27, 2020
1a5f62a
ACPI: video: use ACPI backlight for HP 635 Notebook
Sep 13, 2020
6341984
ACPI: debug: don't allow debugging when ACPI is disabled
Oct 12, 2020
e7f52fd
PCI/ACPI: Whitelist hotplug ports for D3 if power managed by ACPI
l1k Oct 2, 2020
0adf4db
ACPI: EC: PM: Flush EC work unconditionally after wakeup
rafaeljw Oct 5, 2020
7f9d9a0
ACPI: EC: PM: Drop ec_no_wakeup check from acpi_ec_dispatch_gpe()
rafaeljw Oct 5, 2020
a034ea1
acpi-cpufreq: Honor _PSD table setting on new AMD CPUs
weihuang-amd Oct 19, 2020
3fc2cbb
w1: mxc_w1: Fix timeout resolution problem leading to bus error
Sep 30, 2020
f0ef0e2
scsi: mptfusion: Fix null pointer dereferences in mptscsih_remove()
hdeller Oct 22, 2020
a0bdb5b
scsi: qla2xxx: Fix crash on session cleanup with unload
Sep 29, 2020
1e2f16d
PM: runtime: Remove link state checks in rpm_get/put_supplier()
Sep 22, 2020
c5f2a50
btrfs: qgroup: fix wrong qgroup metadata reserve for delayed inode
adam900710 Jul 24, 2020
223b462
btrfs: improve device scanning messages
asj Sep 3, 2020
e1cf034
btrfs: reschedule if necessary when logging directory items
fdmanana Sep 14, 2020
c2dcc9b
btrfs: send, orphanize first all conflicting inodes when processing r…
fdmanana Sep 21, 2020
6ec4b82
btrfs: send, recompute reference path after orphanization of a directory
fdmanana Sep 21, 2020
4b82b8a
btrfs: use kvzalloc() to allocate clone_roots in btrfs_ioctl_send()
evdenis Sep 21, 2020
d3ce2d0
btrfs: tree-checker: fix false alert caused by legacy btrfs root item
adam900710 Sep 22, 2020
1cedc54
btrfs: cleanup cow block on error
josefbacik Sep 29, 2020
834a61b
btrfs: tree-checker: validate number of chunk stripes and parity
danobi Oct 9, 2020
dfda50e
btrfs: fix use-after-free on readahead extent after failure to create it
fdmanana Oct 12, 2020
c964d38
btrfs: fix readahead hang and use-after-free after removing a device
fdmanana Oct 12, 2020
2600a13
usb: xhci: Workaround for S3 issue on AMD SNPS 3.0 xHC
Oct 28, 2020
3468cbc
usb: dwc3: pci: Allow Elkhart Lake to utilize DSM method for PM funct…
ytan29 Aug 21, 2020
1c9e86c
usb: dwc3: ep0: Fix ZLP for OUT ep0 requests
Sep 24, 2020
f935b70
usb: dwc3: gadget: Check MPS of the request length
Sep 24, 2020
726f638
usb: dwc3: core: add phy cleanup for probe error handling
Junlisuzhou Jul 28, 2020
97224cd
usb: dwc3: core: don't trigger runtime pm when remove driver
Junlisuzhou Jul 28, 2020
206dcd6
usb: dwc3: gadget: Resume pending requests after CLEAR_STALL
Sep 3, 2020
2850f14
usb: dwc3: gadget: END_TRANSFER before CLEAR_STALL command
Sep 3, 2020
543432d
usb: cdc-acm: fix cooldown mechanism
jbrun3t Oct 19, 2020
75d0d4f
usb: typec: tcpm: reset hard_reset_count for any disconnect
Junlisuzhou Oct 12, 2020
94478c1
usb: host: fsl-mph-dr-of: check return of dma_set_mask()
RanWang1 Oct 10, 2020
8c16ca6
drm/i915: Force VT'd workarounds when running as a guest OS
ickle Oct 19, 2020
eb4c460
vt: keyboard, simplify vt_kdgkbsent
Oct 19, 2020
87d398f
vt: keyboard, extend func_buf_lock to readers
Oct 19, 2020
93da9dc
HID: wacom: Avoid entering wacom_wac_pen_report for pad / battery
jigpu Sep 23, 2020
f707ccb
udf: Fix memory leak when mounting
jankara Sep 22, 2020
a4f02a8
dmaengine: dma-jz4780: Fix race in jz4780_dma_tx_status
pcercuei Oct 4, 2020
ad877be
iio:light:si1145: Fix timestamp alignment and prevent data leak.
jic23 Jul 22, 2020
a8c59ab
iio: adc: gyroadc: fix leak of device node iterator
Sep 26, 2020
96a5134
iio:adc:ti-adc0832 Fix alignment issue with timestamp
jic23 Jul 22, 2020
9f4f75d
iio:adc:ti-adc12138 Fix alignment issue with timestamp
jic23 Jul 22, 2020
829c0a9
iio:gyro:itg3200: Fix timestamp alignment and prevent data leak.
jic23 Jul 22, 2020
73597ab
powerpc/drmem: Make lmb_size 64 bit
kvaneesh Oct 7, 2020
58a7dc5
MIPS: DEC: Restore bootmem reservation for firmware working memory area
Oct 14, 2020
551bf7c
s390/stp: add locking to sysfs functions
svens-s390 Sep 15, 2020
240baeb
powerpc/rtas: Restrict RTAS requests from userspace
ajdlinux Aug 20, 2020
3fa03b7
powerpc: Warn about use of smt_snooze_delay
shenki Sep 2, 2020
7850dd0
powerpc/memhotplug: Make lmb size 64bit
kvaneesh Oct 7, 2020
61ed8c1
powerpc/powernv/elog: Fix race while processing OPAL error log event.
maheshsal Oct 6, 2020
94e27f1
powerpc/powermac: Fix low_sleep_handler with KUAP and KUEP
chleroy Sep 11, 2020
415043c
powerpc: Fix undetected data corruption with P9N DD2.1 VSX CI load em…
mikey Oct 13, 2020
c342001
NFSv4: Wait for stateid updates after CLOSE/OPEN_DOWNGRADE
Sep 25, 2020
da86bb4
NFSv4.2: support EXCHGID4_FLAG_SUPP_FENCE_OPS 4.2 EXCHANGE_ID flag
olgakorn1 Oct 16, 2020
c1ea3c4
NFSD: Add missing NFSv2 .pc_func methods
chucklever Oct 1, 2020
213c836
ubifs: dent: Fix some potential memory leaks while iterating entries
Jun 1, 2020
a779274
ubifs: xattr: Fix some potential memory leaks while iterating entries
Jun 1, 2020
bc202c8
ubifs: journal: Make sure to not dirty twice for auth nodes
richardweinberger Sep 28, 2020
748057d
ubifs: Fix a memleak after dumping authentication mount options
Sep 29, 2020
9ba6324
ubifs: Don't parse authentication mount options in remount process
Sep 29, 2020
a99cbd2
ubifs: mount_ubifs: Release authentication resource in error handling…
Sep 29, 2020
4688115
perf python scripting: Fix printable strings in python3 scripts
olsajiri Sep 28, 2020
6d0beee
ARC: perf: redo the pct irq missing in device-tree handling
vineetgarc Oct 22, 2020
da3bb6f
ubi: check kthread_should_stop() after the setting of task state
Jun 1, 2020
e17afa6
ia64: fix build error with !COREDUMP
krzk Oct 17, 2020
da3ccf5
rtc: rx8010: don't modify the global rtc ops
brgl Sep 14, 2020
2c58d5e
i2c: imx: Fix external abort on interrupt in exit paths
krzk Sep 20, 2020
987d381
drm/amdgpu: don't map BO in reserved region
Oct 16, 2020
9887a48
drm/amd/display: Increase timeout for DP Disable
Sep 9, 2020
d417026
drm/amdgpu: correct the gpu reset handling for job != NULL case
Oct 15, 2020
1e460aa
drm/amdkfd: Use same SQ prefetch setting as amdgpu
jcornwallAMD Oct 17, 2020
adff3a8
drm/amd/display: Avoid MST manager resource leak.
Oct 14, 2020
d1628cd
drm/amdgpu: increase the reserved VM size to 2MB
ChristianKoenigAMD Oct 12, 2020
d7e22db
drm/amd/display: Don't invoke kgdb_breakpoint() unconditionally
tiwai Oct 23, 2020
9cdccb4
drm/amd/display: Fix kernel panic by dal_gpio_open() error
tiwai Oct 23, 2020
d4fdbed
ceph: promote to unsigned long long before shifting
Oct 4, 2020
51135ff
libceph: clear con->out_msg on Policy::stateful_server faults
idryomov Oct 7, 2020
0db6e71
9P: Cast to loff_t before multiplying
Oct 4, 2020
3cfbc13
ring-buffer: Return 0 on success from ring_buffer_resize()
Oct 19, 2020
b11e9dd
vringh: fix __vringh_iov() when riov and wiov are different
stefano-garzarella Oct 8, 2020
c0de3cf
ext4: fix leaking sysfs kobject after failed mount
ebiggers Sep 22, 2020
ae05fdc
ext4: fix error handling code in add_new_gdb
dinghaoliu Aug 29, 2020
b60edf3
ext4: fix invalid inode checksum
Oct 20, 2020
b7e1a63
drm/ttm: fix eviction valuable range check.
airlied Oct 19, 2020
fb4e2a6
mmc: sdhci-of-esdhc: set timeout to max before tuning
mwalle Oct 22, 2020
071b330
mmc: sdhci: Use Auto CMD Auto Select only when v4_mode is true
Oct 15, 2020
beb5d0d
drm/amd/pm: increase mclk switch threshold to 200 us
Sep 2, 2020
c2313d7
tty: make FONTX ioctl use the tty pointer they were actually passed
torvalds Oct 26, 2020
4bf2a74
arm64: berlin: Select DW_APB_TIMER_OF
Oct 9, 2020
81190a9
cachefiles: Handle readpage error correctly
Oct 26, 2020
f3d8023
hil/parisc: Disable HIL driver when it gets stuck
hdeller Oct 19, 2020
0808ca9
arm: dts: mt7623: add missing pause for switchport
frank-w Sep 7, 2020
2937774
ARM: samsung: fix PM debug build with DEBUG_LL but !MMU
krzk Sep 10, 2020
e793fc3
ARM: s3c24xx: fix missing system reset
krzk Aug 4, 2020
2608687
device property: Keep secondary firmware node secondary by type
andy-shev Oct 22, 2020
4cb29cd
device property: Don't clear secondary pointer for shared primary fir…
andy-shev Oct 22, 2020
8fd7929
KVM: arm64: Fix AArch32 handling of DBGD{CCINT,SCRext} and DBGVCR
Oct 29, 2020
4d934fe
staging: fieldbus: anybuss: jump to correct label in an error path
hiss2018 Oct 12, 2020
15506ee
staging: comedi: cb_pcidas: Allow 2-channel commands for AO subdevice
ian-abbott Oct 21, 2020
b869f6b
staging: octeon: repair "fixed-link" support
asverdlin Oct 16, 2020
6ce4da8
staging: octeon: Drop on uncorrectable alignment or FCS error
asverdlin Oct 16, 2020
6e97ed6
Linux 5.4.75
gregkh Nov 5, 2020
32fa65b
Merge tag 'v5.4.75' into 5.4-2.1.x-imx
zandrey Nov 5, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
NFSv4: Wait for stateid updates after CLOSE/OPEN_DOWNGRADE
commit b4868b4 upstream.

Since commit 0e0cb35 ("NFSv4: Handle NFS4ERR_OLD_STATEID in
CLOSE/OPEN_DOWNGRADE") the following livelock may occur if a CLOSE races
with the update of the nfs_state:

Process 1           Process 2           Server
=========           =========           ========
 OPEN file
                    OPEN file
                                        Reply OPEN (1)
                                        Reply OPEN (2)
 Update state (1)
 CLOSE file (1)
                                        Reply OLD_STATEID (1)
 CLOSE file (2)
                                        Reply CLOSE (-1)
                    Update state (2)
                    wait for state change
 OPEN file
                    wake
 CLOSE file
 OPEN file
                    wake
 CLOSE file
 ...
                    ...

We can avoid this situation by not issuing an immediate retry with a bumped
seqid when CLOSE/OPEN_DOWNGRADE receives NFS4ERR_OLD_STATEID.  Instead,
take the same approach used by OPEN and wait at least 5 seconds for
outstanding stateid updates to complete if we can detect that we're out of
sequence.

Note that after this change it is still possible (though unlikely) that
CLOSE waits a full 5 seconds, bumps the seqid, and retries -- and that
attempt races with another OPEN at the same time.  In order to avoid this
race (which would result in the livelock), update
nfs_need_update_open_stateid() to handle the case where:
 - the state is NFS_OPEN_STATE, and
 - the stateid doesn't match the current open stateid

Finally, nfs_need_update_open_stateid() is modified to be idempotent and
renamed to better suit the purpose of signaling that the stateid passed
is the next stateid in sequence.

Fixes: 0e0cb35 ("NFSv4: Handle NFS4ERR_OLD_STATEID in CLOSE/OPEN_DOWNGRADE")
Cc: stable@vger.kernel.org # v5.4+
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Benjamin Coddington authored and gregkh committed Nov 5, 2020
commit c342001cab7f058d6fbf50f05ca4ea499c985ad9
8 changes: 8 additions & 0 deletions fs/nfs/nfs4_fs.h
Original file line number Diff line number Diff line change
@@ -570,6 +570,14 @@ static inline bool nfs4_stateid_is_newer(const nfs4_stateid *s1, const nfs4_stat
return (s32)(be32_to_cpu(s1->seqid) - be32_to_cpu(s2->seqid)) > 0;
}

static inline bool nfs4_stateid_is_next(const nfs4_stateid *s1, const nfs4_stateid *s2)
{
u32 seq1 = be32_to_cpu(s1->seqid);
u32 seq2 = be32_to_cpu(s2->seqid);

return seq2 == seq1 + 1U || (seq2 == 1U && seq1 == 0xffffffffU);
}

static inline void nfs4_stateid_seqid_inc(nfs4_stateid *s1)
{
u32 seqid = be32_to_cpu(s1->seqid);
81 changes: 47 additions & 34 deletions fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
@@ -1515,19 +1515,6 @@ static void nfs_state_log_update_open_stateid(struct nfs4_state *state)
wake_up_all(&state->waitq);
}

static void nfs_state_log_out_of_order_open_stateid(struct nfs4_state *state,
const nfs4_stateid *stateid)
{
u32 state_seqid = be32_to_cpu(state->open_stateid.seqid);
u32 stateid_seqid = be32_to_cpu(stateid->seqid);

if (stateid_seqid == state_seqid + 1U ||
(stateid_seqid == 1U && state_seqid == 0xffffffffU))
nfs_state_log_update_open_stateid(state);
else
set_bit(NFS_STATE_CHANGE_WAIT, &state->flags);
}

static void nfs_test_and_clear_all_open_stateid(struct nfs4_state *state)
{
struct nfs_client *clp = state->owner->so_server->nfs_client;
@@ -1553,21 +1540,19 @@ static void nfs_test_and_clear_all_open_stateid(struct nfs4_state *state)
* i.e. The stateid seqids have to be initialised to 1, and
* are then incremented on every state transition.
*/
static bool nfs_need_update_open_stateid(struct nfs4_state *state,
static bool nfs_stateid_is_sequential(struct nfs4_state *state,
const nfs4_stateid *stateid)
{
if (test_bit(NFS_OPEN_STATE, &state->flags) == 0 ||
!nfs4_stateid_match_other(stateid, &state->open_stateid)) {
if (test_bit(NFS_OPEN_STATE, &state->flags)) {
/* The common case - we're updating to a new sequence number */
if (nfs4_stateid_match_other(stateid, &state->open_stateid) &&
nfs4_stateid_is_next(&state->open_stateid, stateid)) {
return true;
}
} else {
/* This is the first OPEN in this generation */
if (stateid->seqid == cpu_to_be32(1))
nfs_state_log_update_open_stateid(state);
else
set_bit(NFS_STATE_CHANGE_WAIT, &state->flags);
return true;
}

if (nfs4_stateid_is_newer(stateid, &state->open_stateid)) {
nfs_state_log_out_of_order_open_stateid(state, stateid);
return true;
return true;
}
return false;
}
@@ -1641,16 +1626,16 @@ static void nfs_set_open_stateid_locked(struct nfs4_state *state,
int status = 0;
for (;;) {

if (!nfs_need_update_open_stateid(state, stateid))
return;
if (!test_bit(NFS_STATE_CHANGE_WAIT, &state->flags))
if (nfs_stateid_is_sequential(state, stateid))
break;

if (status)
break;
/* Rely on seqids for serialisation with NFSv4.0 */
if (!nfs4_has_session(NFS_SERVER(state->inode)->nfs_client))
break;

set_bit(NFS_STATE_CHANGE_WAIT, &state->flags);
prepare_to_wait(&state->waitq, &wait, TASK_KILLABLE);
/*
* Ensure we process the state changes in the same order
@@ -1661,6 +1646,7 @@ static void nfs_set_open_stateid_locked(struct nfs4_state *state,
spin_unlock(&state->owner->so_lock);
rcu_read_unlock();
trace_nfs4_open_stateid_update_wait(state->inode, stateid, 0);

if (!signal_pending(current)) {
if (schedule_timeout(5*HZ) == 0)
status = -EAGAIN;
@@ -3397,7 +3383,8 @@ static bool nfs4_refresh_open_old_stateid(nfs4_stateid *dst,
__be32 seqid_open;
u32 dst_seqid;
bool ret;
int seq;
int seq, status = -EAGAIN;
DEFINE_WAIT(wait);

for (;;) {
ret = false;
@@ -3409,15 +3396,41 @@ static bool nfs4_refresh_open_old_stateid(nfs4_stateid *dst,
continue;
break;
}

write_seqlock(&state->seqlock);
seqid_open = state->open_stateid.seqid;
if (read_seqretry(&state->seqlock, seq))
continue;

dst_seqid = be32_to_cpu(dst->seqid);
if ((s32)(dst_seqid - be32_to_cpu(seqid_open)) >= 0)
dst->seqid = cpu_to_be32(dst_seqid + 1);
else

/* Did another OPEN bump the state's seqid? try again: */
if ((s32)(be32_to_cpu(seqid_open) - dst_seqid) > 0) {
dst->seqid = seqid_open;
write_sequnlock(&state->seqlock);
ret = true;
break;
}

/* server says we're behind but we haven't seen the update yet */
set_bit(NFS_STATE_CHANGE_WAIT, &state->flags);
prepare_to_wait(&state->waitq, &wait, TASK_KILLABLE);
write_sequnlock(&state->seqlock);
trace_nfs4_close_stateid_update_wait(state->inode, dst, 0);

if (signal_pending(current))
status = -EINTR;
else
if (schedule_timeout(5*HZ) != 0)
status = 0;

finish_wait(&state->waitq, &wait);

if (!status)
continue;
if (status == -EINTR)
break;

/* we slept the whole 5 seconds, we must have lost a seqid */
dst->seqid = cpu_to_be32(dst_seqid + 1);
ret = true;
break;
}
1 change: 1 addition & 0 deletions fs/nfs/nfs4trace.h
Original file line number Diff line number Diff line change
@@ -1291,6 +1291,7 @@ DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_setattr);
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_delegreturn);
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update);
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_open_stateid_update_wait);
DEFINE_NFS4_INODE_STATEID_EVENT(nfs4_close_stateid_update_wait);

DECLARE_EVENT_CLASS(nfs4_getattr_event,
TP_PROTO(