Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 806fb883 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge 5.4.269 into android11-5.4-lts



Changes in 5.4.269
	PCI: mediatek: Clear interrupt status before dispatching handler
	include/linux/units.h: add helpers for kelvin to/from Celsius conversion
	units: Add Watt units
	units: change from 'L' to 'UL'
	units: add the HZ macros
	serial: sc16is7xx: set safe default SPI clock frequency
	spi: introduce SPI_MODE_X_MASK macro
	serial: sc16is7xx: add check for unsupported SPI modes during probe
	ext4: allow for the last group to be marked as trimmed
	crypto: api - Disallow identical driver names
	PM: hibernate: Enforce ordering during image compression/decompression
	hwrng: core - Fix page fault dead lock on mmap-ed hwrng
	rpmsg: virtio: Free driver_override when rpmsg_remove()
	parisc/firmware: Fix F-extend for PDC addresses
	arm64: dts: qcom: sdm845: fix USB wakeup interrupt types
	mmc: core: Use mrq.sbc in close-ended ffu
	nouveau/vmm: don't set addr on the fail path to avoid warning
	ubifs: ubifs_symlink: Fix memleak of inode->i_link in error path
	rename(): fix the locking of subdirectories
	block: Remove special-casing of compound pages
	mtd: spinand: macronix: Fix MX35LFxGE4AD page size
	fs: add mode_strip_sgid() helper
	fs: move S_ISGID stripping into the vfs_*() helpers
	powerpc: Use always instead of always-y in for crtsavres.o
	x86/CPU/AMD: Fix disabling XSAVES on AMD family 0x17 due to erratum
	net/smc: fix illegal rmb_desc access in SMC-D connection dump
	vlan: skip nested type that is not IFLA_VLAN_QOS_MAPPING
	llc: make llc_ui_sendmsg() more robust against bonding changes
	llc: Drop support for ETH_P_TR_802_2.
	net/rds: Fix UBSAN: array-index-out-of-bounds in rds_cmsg_recv
	tracing: Ensure visibility when inserting an element into tracing_map
	afs: Hide silly-rename files from userspace
	tcp: Add memory barrier to tcp_push()
	netlink: fix potential sleeping issue in mqueue_flush_file
	net/mlx5: DR, Use the right GVMI number for drop action
	net/mlx5: Use kfree(ft->g) in arfs_create_groups()
	net/mlx5e: fix a double-free in arfs_create_groups
	netfilter: nf_tables: restrict anonymous set and map names to 16 bytes
	netfilter: nf_tables: validate NFPROTO_* family
	fjes: fix memleaks in fjes_hw_setup
	net: fec: fix the unhandled context fault from smmu
	btrfs: ref-verify: free ref cache before clearing mount opt
	btrfs: tree-checker: fix inline ref size in error messages
	btrfs: don't warn if discard range is not aligned to sector
	btrfs: defrag: reject unknown flags of btrfs_ioctl_defrag_range_args
	rbd: don't move requests to the running list on errors
	netfilter: nf_tables: reject QUEUE/DROP verdict parameters
	gpiolib: acpi: Ignore touchpad wakeup on GPD G1619-04
	drm: Don't unref the same fb many times by mistake due to deadlock handling
	drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking
	drm/bridge: nxp-ptn3460: simplify some error checking
	drm/exynos: fix accidental on-stack copy of exynos_drm_plane
	drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume
	gpio: eic-sprd: Clear interrupt after set the interrupt type
	spi: bcm-qspi: fix SFDP BFPT read by usig mspi read
	mips: Call lose_fpu(0) before initializing fcr31 in mips_set_personality_nan
	tick/sched: Preserve number of idle sleeps across CPU hotplug events
	x86/entry/ia32: Ensure s32 is sign extended to s64
	powerpc/mm: Fix null-pointer dereference in pgtable_cache_add
	powerpc: Fix build error due to is_valid_bugaddr()
	powerpc/mm: Fix build failures due to arch_reserved_kernel_pages()
	powerpc: pmd_move_must_withdraw() is only needed for CONFIG_TRANSPARENT_HUGEPAGE
	powerpc/lib: Validate size for vector operations
	x86/mce: Mark fatal MCE's page as poison to avoid panic in the kdump kernel
	perf/core: Fix narrow startup race when creating the perf nr_addr_filters sysfs file
	regulator: core: Only increment use_count when enable_count changes
	audit: Send netlink ACK before setting connection in auditd_set
	ACPI: video: Add quirk for the Colorful X15 AT 23 Laptop
	PNP: ACPI: fix fortify warning
	ACPI: extlog: fix NULL pointer dereference check
	FS:JFS:UBSAN:array-index-out-of-bounds in dbAdjTree
	UBSAN: array-index-out-of-bounds in dtSplitRoot
	jfs: fix slab-out-of-bounds Read in dtSearch
	jfs: fix array-index-out-of-bounds in dbAdjTree
	jfs: fix uaf in jfs_evict_inode
	pstore/ram: Fix crash when setting number of cpus to an odd number
	crypto: stm32/crc32 - fix parsing list of devices
	afs: fix the usage of read_seqbegin_or_lock() in afs_find_server*()
	rxrpc_find_service_conn_rcu: fix the usage of read_seqbegin_or_lock()
	jfs: fix array-index-out-of-bounds in diNewExt
	s390/ptrace: handle setting of fpc register correctly
	KVM: s390: fix setting of fpc register
	SUNRPC: Fix a suspicious RCU usage warning
	ecryptfs: Reject casefold directory inodes
	ext4: fix inconsistent between segment fstrim and full fstrim
	ext4: unify the type of flexbg_size to unsigned int
	ext4: remove unnecessary check from alloc_flex_gd()
	ext4: avoid online resizing failures due to oversized flex bg
	wifi: rt2x00: restart beacon queue when hardware reset
	selftests/bpf: satisfy compiler by having explicit return in btf test
	selftests/bpf: Fix pyperf180 compilation failure with clang18
	scsi: lpfc: Fix possible file string name overflow when updating firmware
	PCI: Add no PM reset quirk for NVIDIA Spectrum devices
	bonding: return -ENOMEM instead of BUG in alb_upper_dev_walk
	ARM: dts: imx7d: Fix coresight funnel ports
	ARM: dts: imx7s: Fix lcdif compatible
	ARM: dts: imx7s: Fix nand-controller #size-cells
	wifi: ath9k: Fix potential array-index-out-of-bounds read in ath9k_htc_txstatus()
	bpf: Add map and need_defer parameters to .map_fd_put_ptr()
	scsi: libfc: Don't schedule abort twice
	scsi: libfc: Fix up timeout error in fc_fcp_rec_error()
	ARM: dts: rockchip: fix rk3036 hdmi ports node
	ARM: dts: imx25/27-eukrea: Fix RTC node name
	ARM: dts: imx: Use flash@0,0 pattern
	ARM: dts: imx27: Fix sram node
	ARM: dts: imx1: Fix sram node
	ARM: dts: imx25/27: Pass timing0
	ARM: dts: imx27-apf27dev: Fix LED name
	ARM: dts: imx23-sansa: Use preferred i2c-gpios properties
	ARM: dts: imx23/28: Fix the DMA controller node name
	block: prevent an integer overflow in bvec_try_merge_hw_page
	md: Whenassemble the array, consult the superblock of the freshest device
	arm64: dts: qcom: msm8996: Fix 'in-ports' is a required property
	arm64: dts: qcom: msm8998: Fix 'out-ports' is a required property
	wifi: rtl8xxxu: Add additional USB IDs for RTL8192EU devices
	wifi: rtlwifi: rtl8723{be,ae}: using calculate_bit_shift()
	wifi: cfg80211: free beacon_ies when overridden from hidden BSS
	f2fs: fix to check return value of f2fs_reserve_new_block()
	ASoC: doc: Fix undefined SND_SOC_DAPM_NOPM argument
	fast_dput(): handle underflows gracefully
	RDMA/IPoIB: Fix error code return in ipoib_mcast_join
	drm/drm_file: fix use of uninitialized variable
	drm/framebuffer: Fix use of uninitialized variable
	drm/mipi-dsi: Fix detach call without attach
	media: stk1160: Fixed high volume of stk1160_dbg messages
	media: rockchip: rga: fix swizzling for RGB formats
	PCI: add INTEL_HDA_ARL to pci_ids.h
	ALSA: hda: Intel: add HDA_ARL PCI ID support
	drm/exynos: Call drm_atomic_helper_shutdown() at shutdown/unbind time
	IB/ipoib: Fix mcast list locking
	media: ddbridge: fix an error code problem in ddb_probe
	drm/msm/dpu: Ratelimit framedone timeout msgs
	clk: hi3620: Fix memory leak in hi3620_mmc_clk_init()
	clk: mmp: pxa168: Fix memory leak in pxa168_clk_init()
	drm/amdgpu: Let KFD sync with VM fences
	drm/amdgpu: Drop 'fence' check in 'to_amdgpu_amdkfd_fence()'
	leds: trigger: panic: Don't register panic notifier if creating the trigger failed
	um: Fix naming clash between UML and scheduler
	um: Don't use vfprintf() for os_info()
	um: net: Fix return type of uml_net_start_xmit()
	i3c: master: cdns: Update maximum prescaler value for i2c clock
	mfd: ti_am335x_tscadc: Fix TI SoC dependencies
	PCI: Only override AMD USB controller if required
	PCI: switchtec: Fix stdev_release() crash after surprise hot remove
	usb: hub: Replace hardcoded quirk value with BIT() macro
	fs/kernfs/dir: obey S_ISGID
	PCI/AER: Decode Requester ID when no error info found
	libsubcmd: Fix memory leak in uniq()
	virtio_net: Fix "‘%d’ directive writing between 1 and 11 bytes into a region of size 10" warnings
	blk-mq: fix IO hang from sbitmap wakeup race
	ceph: fix deadlock or deadcode of misusing dget()
	drm/amdgpu: Release 'adev->pm.fw' before return in 'amdgpu_device_need_post()'
	perf: Fix the nr_addr_filters fix
	wifi: cfg80211: fix RCU dereference in __cfg80211_bss_update
	scsi: isci: Fix an error code problem in isci_io_request_build()
	net: remove unneeded break
	ixgbe: Remove non-inclusive language
	ixgbe: Refactor returning internal error codes
	ixgbe: Refactor overtemp event handling
	ixgbe: Fix an error handling path in ixgbe_read_iosf_sb_reg_x550()
	ipv6: Ensure natural alignment of const ipv6 loopback and router addresses
	llc: call sock_orphan() at release time
	netfilter: nf_log: replace BUG_ON by WARN_ON_ONCE when putting logger
	netfilter: nft_ct: sanitize layer 3 and 4 protocol number in custom expectations
	net: ipv4: fix a memleak in ip_setup_cork
	af_unix: fix lockdep positive in sk_diag_dump_icons()
	net: sysfs: Fix /sys/class/net/<iface> path
	HID: apple: Add support for the 2021 Magic Keyboard
	HID: apple: Swap the Fn and Left Control keys on Apple keyboards
	HID: apple: Add 2021 magic keyboard FN key mapping
	bonding: remove print in bond_verify_device_path
	dmaengine: fsl-qdma: Fix a memory leak related to the status queue DMA
	dmaengine: fsl-qdma: Fix a memory leak related to the queue command DMA
	phy: renesas: rcar-gen3-usb2: Fix returning wrong error code
	dmaengine: fix is_slave_direction() return false when DMA_DEV_TO_DEV
	phy: ti: phy-omap-usb2: Fix NULL pointer dereference for SRP
	net: stmmac: xgmac: fix handling of DPP safety error for DMA channels
	selftests: net: avoid just another constant wait
	atm: idt77252: fix a memleak in open_card_ubr0
	hwmon: (aspeed-pwm-tacho) mutex for tach reading
	hwmon: (coretemp) Fix out-of-bounds memory access
	hwmon: (coretemp) Fix bogus core_id to attr name mapping
	inet: read sk->sk_family once in inet_recv_error()
	rxrpc: Fix response to PING RESPONSE ACKs to a dead call
	tipc: Check the bearer type before calling tipc_udp_nl_bearer_add()
	ppp_async: limit MRU to 64K
	netfilter: nft_compat: reject unused compat flag
	netfilter: nft_compat: restrict match/target protocol to u16
	netfilter: nft_ct: reject direction for ct id
	net/af_iucv: clean up a try_then_request_module()
	USB: serial: qcserial: add new usb-id for Dell Wireless DW5826e
	USB: serial: option: add Fibocom FM101-GL variant
	USB: serial: cp210x: add ID for IMST iM871A-USB
	hrtimer: Report offline hrtimer enqueue
	Input: atkbd - skip ATKBD_CMD_SETLEDS when skipping ATKBD_CMD_GETID
	vhost: use kzalloc() instead of kmalloc() followed by memset()
	net: stmmac: xgmac: use #define for string constants
	net: stmmac: xgmac: fix a typo of register name in DPP safety handling
	netfilter: nft_set_rbtree: skip end interval element from gc
	btrfs: forbid creating subvol qgroups
	btrfs: forbid deleting live subvol qgroup
	btrfs: send: return EOPNOTSUPP on unknown flags
	of: unittest: add overlay gpio test to catch gpio hog problem
	of: unittest: Fix compile in the non-dynamic case
	spi: ppc4xx: Drop write-only variable
	ASoC: rt5645: Fix deadlock in rt5645_jack_detect_work()
	MIPS: Add 'memory' clobber to csum_ipv6_magic() inline assembler
	i40e: Fix waiting for queues of all VSIs to be disabled
	tracing/trigger: Fix to return error if failed to alloc snapshot
	mm/writeback: fix possible divide-by-zero in wb_dirty_limits(), again
	HID: wacom: generic: Avoid reporting a serial of '0' to userspace
	HID: wacom: Do not register input devices until after hid_hw_start
	USB: hub: check for alternate port before enabling A_ALT_HNP_SUPPORT
	usb: f_mass_storage: forbid async queue when shutdown happen
	i2c: i801: Remove i801_set_block_buffer_mode
	i2c: i801: Fix block process call transactions
	scsi: Revert "scsi: fcoe: Fix potential deadlock on &fip->ctlr_lock"
	firewire: core: correct documentation of fw_csr_string() kernel API
	kbuild: Fix changing ELF file type for output of gen_btf for big endian
	nfc: nci: free rx_data_reassembly skb on NCI device cleanup
	xen-netback: properly sync TX responses
	ALSA: hda/realtek: Enable headset mic on Vaio VJFE-ADL
	binder: signal epoll threads of self-work
	misc: fastrpc: Mark all sessions as invalid in cb_remove
	ext4: fix double-free of blocks due to wrong extents moved_len
	tracing: Fix wasted memory in saved_cmdlines logic
	staging: iio: ad5933: fix type mismatch regression
	iio: magnetometer: rm3100: add boundary check for the value read from RM3100_REG_TMRC
	ring-buffer: Clean ring_buffer_poll_wait() error return
	serial: max310x: set default value when reading clock ready bit
	serial: max310x: improve crystal stable clock detection
	x86/Kconfig: Transmeta Crusoe is CPU family 5, not 6
	x86/mm/ident_map: Use gbpages only where full GB page should be mapped.
	mmc: slot-gpio: Allow non-sleeping GPIO ro
	ALSA: hda/conexant: Add quirk for SWS JS201D
	nilfs2: fix data corruption in dsync block recovery for small block sizes
	nilfs2: fix hang in nilfs_lookup_dirty_data_buffers()
	nfp: use correct macro for LengthSelect in BAR config
	nfp: flower: prevent re-adding mac index for bonded port
	irqchip/irq-brcmstb-l2: Add write memory barrier before exit
	can: j1939: Fix UAF in j1939_sk_match_filter during setsockopt(SO_J1939_FILTER)
	pmdomain: core: Move the unused cleanup to a _sync initcall
	tracing: Inform kmemleak of saved_cmdlines allocation
	Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d"
	bus: moxtet: Add spi device table
	arch, mm: remove stale mentions of DISCONIGMEM
	mips: Fix max_mapnr being uninitialized on early stages
	KVM: arm64: vgic-its: Avoid potential UAF in LPI translation cache
	netfilter: ipset: fix performance regression in swap operation
	netfilter: ipset: Missing gc cancellations fixed
	net: prevent mss overflow in skb_segment()
	sched/membarrier: reduce the ability to hammer on sys_membarrier
	nilfs2: fix potential bug in end_buffer_async_write
	PM: runtime: add devm_pm_runtime_enable helper
	PM: runtime: Have devm_pm_runtime_enable() handle pm_runtime_dont_use_autosuspend()
	drm/msm/dsi: Enable runtime PM
	lsm: new security_file_ioctl_compat() hook
	netfilter: nf_tables: fix pointer math issue in nft_byteorder_eval()
	Revert "Revert "mtd: rawnand: gpmi: Fix setting busy timeout setting""
	net: bcmgenet: Fix EEE implementation
	of: unittest: fix EXPECT text for gpio hog errors
	of: gpio unittest kfree() wrong object
	Linux 5.4.269

Change-Id: Iedabcdbe95a83593f102e237f2a80d2fc7206669
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parents 8eb60626 6e1f54a4
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
What:		/sys/class/<iface>/queues/rx-<queue>/rps_cpus
What:		/sys/class/net/<iface>/queues/rx-<queue>/rps_cpus
Date:		March 2010
KernelVersion:	2.6.35
Contact:	netdev@vger.kernel.org
@@ -8,7 +8,7 @@ Description:
		network device queue. Possible values depend on the number
		of available CPU(s) in the system.

What:		/sys/class/<iface>/queues/rx-<queue>/rps_flow_cnt
What:		/sys/class/net/<iface>/queues/rx-<queue>/rps_flow_cnt
Date:		April 2010
KernelVersion:	2.6.35
Contact:	netdev@vger.kernel.org
@@ -16,7 +16,7 @@ Description:
		Number of Receive Packet Steering flows being currently
		processed by this particular network device receive queue.

What:		/sys/class/<iface>/queues/tx-<queue>/tx_timeout
What:		/sys/class/net/<iface>/queues/tx-<queue>/tx_timeout
Date:		November 2011
KernelVersion:	3.3
Contact:	netdev@vger.kernel.org
@@ -24,7 +24,7 @@ Description:
		Indicates the number of transmit timeout events seen by this
		network interface transmit queue.

What:		/sys/class/<iface>/queues/tx-<queue>/tx_maxrate
What:		/sys/class/net/<iface>/queues/tx-<queue>/tx_maxrate
Date:		March 2015
KernelVersion:	4.1
Contact:	netdev@vger.kernel.org
@@ -32,7 +32,7 @@ Description:
		A Mbps max-rate set for the queue, a value of zero means disabled,
		default is disabled.

What:		/sys/class/<iface>/queues/tx-<queue>/xps_cpus
What:		/sys/class/net/<iface>/queues/tx-<queue>/xps_cpus
Date:		November 2010
KernelVersion:	2.6.38
Contact:	netdev@vger.kernel.org
@@ -42,7 +42,7 @@ Description:
		network device transmit queue. Possible vaules depend on the
		number of available CPU(s) in the system.

What:		/sys/class/<iface>/queues/tx-<queue>/xps_rxqs
What:		/sys/class/net/<iface>/queues/tx-<queue>/xps_rxqs
Date:		June 2018
KernelVersion:	4.18.0
Contact:	netdev@vger.kernel.org
@@ -53,7 +53,7 @@ Description:
		number of available receive queue(s) in the network device.
		Default is disabled.

What:		/sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/hold_time
What:		/sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/hold_time
Date:		November 2011
KernelVersion:	3.3
Contact:	netdev@vger.kernel.org
@@ -62,7 +62,7 @@ Description:
		of this particular network device transmit queue.
		Default value is 1000.

What:		/sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/inflight
What:		/sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/inflight
Date:		November 2011
KernelVersion:	3.3
Contact:	netdev@vger.kernel.org
@@ -70,7 +70,7 @@ Description:
		Indicates the number of bytes (objects) in flight on this
		network device transmit queue.

What:		/sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit
What:		/sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/limit
Date:		November 2011
KernelVersion:	3.3
Contact:	netdev@vger.kernel.org
@@ -79,7 +79,7 @@ Description:
		on this network device transmit queue. This value is clamped
		to be within the bounds defined by limit_max and limit_min.

What:		/sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit_max
What:		/sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/limit_max
Date:		November 2011
KernelVersion:	3.3
Contact:	netdev@vger.kernel.org
@@ -88,7 +88,7 @@ Description:
		queued on this network device transmit queue. See
		include/linux/dynamic_queue_limits.h for the default value.

What:		/sys/class/<iface>/queues/tx-<queue>/byte_queue_limits/limit_min
What:		/sys/class/net/<iface>/queues/tx-<queue>/byte_queue_limits/limit_min
Date:		November 2011
KernelVersion:	3.3
Contact:	netdev@vger.kernel.org
+15 −10
Original line number Diff line number Diff line
@@ -22,13 +22,16 @@ exclusive.
3) object removal.  Locking rules: caller locks parent, finds victim,
locks victim and calls the method.  Locks are exclusive.

4) rename() that is _not_ cross-directory.  Locking rules: caller locks the
parent and finds source and target.  We lock both (provided they exist).  If we
need to lock two inodes of different type (dir vs non-dir), we lock directory
first.  If we need to lock two inodes of the same type, lock them in inode
pointer order.  Then call the method.  All locks are exclusive.
NB: we might get away with locking the the source (and target in exchange
case) shared.
4) rename() that is _not_ cross-directory.  Locking rules: caller locks
the parent and finds source and target.  Then we decide which of the
source and target need to be locked.  Source needs to be locked if it's a
non-directory; target - if it's a non-directory or about to be removed.
Take the locks that need to be taken, in inode pointer order if need
to take both (that can happen only when both source and target are
non-directories - the source because it wouldn't be locked otherwise
and the target because mixing directory and non-directory is allowed
only with RENAME_EXCHANGE, and that won't be removing the target).
After the locks had been taken, call the method.  All locks are exclusive.

5) link creation.  Locking rules:

@@ -44,7 +47,7 @@ rules:

	* lock the filesystem
	* lock parents in "ancestors first" order. If one is not ancestor of
	  the other, lock them in inode pointer order.
	  the other, lock the parent of source first.
	* find source and target.
	* if old parent is equal to or is a descendent of target
	  fail with -ENOTEMPTY
@@ -54,10 +57,11 @@ rules:
	  need to lock two inodes of different type (dir vs non-dir), we lock
	  the directory first. If we need to lock two inodes of the same type,
	  lock them in inode pointer order.
	* Lock subdirectories involved (source before target).
	* Lock non-directories involved, in inode pointer order.
	* call the method.

All ->i_rwsem are taken exclusive.  Again, we might get away with locking
the the source (and target in exchange case) shared.
All ->i_rwsem are taken exclusive.

The rules above obviously guarantee that all directories that are going to be
read, modified or removed by method will be locked by caller.
@@ -67,6 +71,7 @@ If no directory is its own ancestor, the scheme above is deadlock-free.

Proof:

[XXX: will be updated once we are done massaging the lock_rename()]
	First of all, at any moment we have a linear ordering of the
	objects - A < B iff (A is an ancestor of B) or (B is not an ancestor
        of A and ptr(A) < ptr(B)).
+4 −1
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ symlink: exclusive
mkdir:		exclusive
unlink:		exclusive (both)
rmdir:		exclusive (both)(see below)
rename:		exclusive (all)	(see below)
rename:		exclusive (both parents, some children)	(see below)
readlink:	no
get_link:	no
setattr:	exclusive
@@ -113,6 +113,9 @@ tmpfile: no
	Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_rwsem
	exclusive on victim.
	cross-directory ->rename() has (per-superblock) ->s_vfs_rename_sem.
	->unlink() and ->rename() have ->i_rwsem exclusive on all non-directories
	involved.
	->rename() has ->i_rwsem exclusive on any subdirectory that changes parent.

See Documentation/filesystems/directory-locking.rst for more detailed discussion
of the locking scheme for directory operations.
+18 −0
Original line number Diff line number Diff line
@@ -858,3 +858,21 @@ be misspelled d_alloc_anon().
[should've been added in 2016] stale comment in finish_open() nonwithstanding,
failure exits in ->atomic_open() instances should *NOT* fput() the file,
no matter what.  Everything is handled by the caller.

---

**mandatory**

If ->rename() update of .. on cross-directory move needs an exclusion with
directory modifications, do *not* lock the subdirectory in question in your
->rename() - it's done by the caller now [that item should've been added in
28eceeda130f "fs: Lock moved directories"].

---

**mandatory**

On same-directory ->rename() the (tautological) update of .. is not protected
by any locks; just don't do it if the old parent is the same as the new one.
We really can't lock two subdirectories in same-directory rename - not without
deadlocks.
+1 −1
Original line number Diff line number Diff line
@@ -234,7 +234,7 @@ corresponding soft power control. In this case it is necessary to create
a virtual widget - a widget with no control bits e.g.
::

  SND_SOC_DAPM_MIXER("AC97 Mixer", SND_SOC_DAPM_NOPM, 0, 0, NULL, 0),
  SND_SOC_DAPM_MIXER("AC97 Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),

This can be used to merge to signal paths together in software.

Loading