Stephen Rothwell [Mon, 17 Jan 2022 23:05:13 +0000 (10:05 +1100)]
Merge branch 'apparmor-next' of git://git./linux/kernel/git/jj/linux-apparmor
Stephen Rothwell [Mon, 17 Jan 2022 23:05:12 +0000 (10:05 +1100)]
Merge branch 'next-testing' of git://git./linux/kernel/git/jmorris/linux-security.git
Stephen Rothwell [Mon, 17 Jan 2022 23:03:18 +0000 (10:03 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/dlemoal/libata.git
Stephen Rothwell [Mon, 17 Jan 2022 22:59:55 +0000 (09:59 +1100)]
Merge branch 'for-next' of git://git.kernel.dk/linux-block.git
Stephen Rothwell [Mon, 17 Jan 2022 22:58:17 +0000 (09:58 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/deller/linux-fbdev.git
Stephen Rothwell [Mon, 17 Jan 2022 22:56:31 +0000 (09:56 +1100)]
Merge branch 'imx-drm/next' of https://git.pengutronix.de/git/pza/linux
Stephen Rothwell [Mon, 17 Jan 2022 22:56:30 +0000 (09:56 +1100)]
Merge branch 'for-linux-next' of git://anongit.freedesktop.org/drm-intel
Stephen Rothwell [Mon, 17 Jan 2022 22:54:34 +0000 (09:54 +1100)]
Merge branch 'drm-next' of https://gitlab.freedesktop.org/agd5f/linux
Stephen Rothwell [Mon, 17 Jan 2022 22:52:56 +0000 (09:52 +1100)]
Merge branch 'master' of git://git./linux/kernel/git/bluetooth/bluetooth-next.git
Stephen Rothwell [Mon, 17 Jan 2022 22:51:39 +0000 (09:51 +1100)]
Merge branch 'cpupower' of git://git./linux/kernel/git/shuah/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:38:00 +0000 (09:38 +1100)]
Merge branch 'linux-next' of git://git./linux/kernel/git/rafael/linux-pm.git
Stephen Rothwell [Mon, 17 Jan 2022 22:36:44 +0000 (09:36 +1100)]
Merge branch 'docs-next' of git://git.lwn.net/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:36:43 +0000 (09:36 +1100)]
Merge branch 'i2c/for-next' of git://git./linux/kernel/git/wsa/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:36:34 +0000 (09:36 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/hid/hid.git
Stephen Rothwell [Mon, 17 Jan 2022 22:36:34 +0000 (09:36 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/printk/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:29:39 +0000 (09:29 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/viro/vfs.git
Stephen Rothwell [Mon, 17 Jan 2022 22:29:38 +0000 (09:29 +1100)]
Merge branch 'locks-next' of git://git./linux/kernel/git/jlayton/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:29:35 +0000 (09:29 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/dlemoal/zonefs.git
Stephen Rothwell [Mon, 17 Jan 2022 22:29:34 +0000 (09:29 +1100)]
Merge branch 'for-next' of git://git./fs/xfs/xfs-linux.git
# Conflicts:
# fs/xfs/xfs_ioctl.c
Stephen Rothwell [Mon, 17 Jan 2022 22:22:13 +0000 (09:22 +1100)]
Merge branch 'overlayfs-next' of git://git./linux/kernel/git/mszeredi/vfs.git
Stephen Rothwell [Mon, 17 Jan 2022 22:22:12 +0000 (09:22 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/hubcap/linux
Stephen Rothwell [Mon, 17 Jan 2022 22:22:11 +0000 (09:22 +1100)]
Merge branch 'master' of https://github.com/Paragon-Software-Group/linux-ntfs3.git
Stephen Rothwell [Mon, 17 Jan 2022 22:22:09 +0000 (09:22 +1100)]
Merge branch 'linux-next' of git://git.linux-nfs.org/projects/anna/linux-nfs.git
Stephen Rothwell [Mon, 17 Jan 2022 22:22:08 +0000 (09:22 +1100)]
Merge branch 'ksmbd-for-next' of https://github.com/smfrench/smb3-kernel.git
Stephen Rothwell [Mon, 17 Jan 2022 22:22:07 +0000 (09:22 +1100)]
Merge branch 'dev' of git://git./linux/kernel/git/jaegeuk/f2fs.git
Stephen Rothwell [Mon, 17 Jan 2022 22:22:06 +0000 (09:22 +1100)]
Merge branch 'for_next' of git://git./linux/kernel/git/jack/linux-fs.git
Stephen Rothwell [Mon, 17 Jan 2022 22:22:05 +0000 (09:22 +1100)]
Merge branch 'for-next' of git://git.samba.org/sfrench/cifs-2.6.git
Stephen Rothwell [Mon, 17 Jan 2022 22:22:05 +0000 (09:22 +1100)]
Merge branch 'master' of git://github.com/ceph/ceph-client.git
# Conflicts:
# include/linux/ceph/libceph.h
# net/ceph/ceph_common.c
Stephen Rothwell [Mon, 17 Jan 2022 22:22:03 +0000 (09:22 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/kdave/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:22:02 +0000 (09:22 +1100)]
Merge branch 'fscache-next' of git://git./linux/kernel/git/dhowells/linux-fs.git
Stephen Rothwell [Mon, 17 Jan 2022 22:22:01 +0000 (09:22 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/brauner/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:19:35 +0000 (09:19 +1100)]
Merge branch 'xtensa-for-next' of git://github.com/jcmvbkbc/linux-xtensa.git
Stephen Rothwell [Mon, 17 Jan 2022 22:19:34 +0000 (09:19 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/s390/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:19:34 +0000 (09:19 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/riscv/linux.git
# Conflicts:
# arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts
# arch/riscv/include/asm/sbi.h
Stephen Rothwell [Mon, 17 Jan 2022 22:19:32 +0000 (09:19 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/deller/parisc-linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:19:31 +0000 (09:19 +1100)]
Merge branch 'next' of git://git./linux/kernel/git/greentime/linux.git
# Conflicts:
# arch/nds32/Kbuild
# arch/nds32/Kconfig
Stephen Rothwell [Mon, 17 Jan 2022 22:19:28 +0000 (09:19 +1100)]
Merge branch 'next' of git://git.monstr.eu/linux-2.6-microblaze.git
Stephen Rothwell [Mon, 17 Jan 2022 22:19:20 +0000 (09:19 +1100)]
Merge branch 'h8300-next' of git://git.sourceforge.jp/gitroot/uclinux-h8/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:19:19 +0000 (09:19 +1100)]
Merge branch 'clk-next' of git://git./linux/kernel/git/clk/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:19:18 +0000 (09:19 +1100)]
Merge branch 'for-next' of git://github.com/Xilinx/linux-xlnx.git
Stephen Rothwell [Mon, 17 Jan 2022 22:19:16 +0000 (09:19 +1100)]
Merge branch 'ti-next' of git://git./linux/kernel/git/ti/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:19:09 +0000 (09:19 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/tegra/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:19:09 +0000 (09:19 +1100)]
Merge branch 'next' of https://git.linaro.org/people/jens.wiklander/linux-tee.git
Stephen Rothwell [Mon, 17 Jan 2022 22:19:06 +0000 (09:19 +1100)]
Merge branch 'sunxi/for-next' of git://git./linux/kernel/git/sunxi/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:19:04 +0000 (09:19 +1100)]
Merge branch 'for-linux-next' of git://git./linux/kernel/git/sudeep.holla/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:19:01 +0000 (09:19 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/krzk/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:18:58 +0000 (09:18 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/mmind/linux-rockchip.git
Stephen Rothwell [Mon, 17 Jan 2022 22:18:55 +0000 (09:18 +1100)]
Merge branch 'next' of git://git./linux/kernel/git/geert/renesas-devel.git
Stephen Rothwell [Mon, 17 Jan 2022 22:18:54 +0000 (09:18 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/nsaenz/linux-rpi.git
Stephen Rothwell [Mon, 17 Jan 2022 22:18:53 +0000 (09:18 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/qcom/linux.git
# Conflicts:
# arch/arm/configs/multi_v7_defconfig
Stephen Rothwell [Mon, 17 Jan 2022 22:18:48 +0000 (09:18 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/tmlind/linux-omap.git
Stephen Rothwell [Mon, 17 Jan 2022 22:18:48 +0000 (09:18 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/gclement/mvebu.git
Stephen Rothwell [Mon, 17 Jan 2022 22:18:47 +0000 (09:18 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/matthias.bgg/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:18:47 +0000 (09:18 +1100)]
Merge branch 'next' of git://git./linux/kernel/git/ssantosh/linux-keystone.git
Stephen Rothwell [Mon, 17 Jan 2022 22:18:41 +0000 (09:18 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/shawnguo/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:18:38 +0000 (09:18 +1100)]
Merge branch 'for-next' of https://git./linux/kernel/git/krzk/linux-mem-ctrl.git
Stephen Rothwell [Mon, 17 Jan 2022 22:18:35 +0000 (09:18 +1100)]
Merge branch 'at91-next' of git://git./linux/kernel/git/at91/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:18:34 +0000 (09:18 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/joel/bmc.git
Stephen Rothwell [Mon, 17 Jan 2022 22:18:33 +0000 (09:18 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/amlogic/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:18:28 +0000 (09:18 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/mani/linux-actions.git
Stephen Rothwell [Mon, 17 Jan 2022 22:18:19 +0000 (09:18 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/soc/soc.git
Stephen Rothwell [Mon, 17 Jan 2022 22:18:18 +0000 (09:18 +1100)]
Merge branch 'for-next' of git://git.armlinux.org.uk/~rmk/linux-arm.git
Stephen Rothwell [Mon, 17 Jan 2022 22:17:04 +0000 (09:17 +1100)]
Merge branch 'perf/core' of git://git./linux/kernel/git/acme/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 22:01:15 +0000 (09:01 +1100)]
Merge branch 'for-next' of git://git./linux/kernel/git/masahiroy/linux-kbuild.git
# Conflicts:
# scripts/link-vmlinux.sh
Huichun Feng [Tue, 11 Jan 2022 05:20:01 +0000 (13:20 +0800)]
docs: ftrace: fix ambiguous sentence
The sentence looks ambiguous, rephrase it by adding ", there".
Signed-off-by: Huichun Feng <foxhoundsk.tw@gmail.com>
Signed-off-by: Ching-Chun (Jim) Huang <jserv@ccns.ncku.edu.tw>
Signed-off-by: Chun-Hung Tseng <henrybear327@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Link: https://lore.kernel.org/r/20220111052000.2675944-1-foxhoundsk.tw@gmail.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Wang Cheng [Sat, 15 Jan 2022 12:52:36 +0000 (20:52 +0800)]
docs: staging/tee.rst: fix two typos found while reading
Signed-off-by: Wang Cheng <wanngchenng@gmail.com>
Reviewed-by: Sumit Garg <sumit.garg@linaro.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Link: https://lore.kernel.org/r/20220115125236.34886-1-wanngchenng@gmail.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Stephen Rothwell [Mon, 17 Jan 2022 21:54:24 +0000 (08:54 +1100)]
Merge branch 'irq/irqchip-fixes' of git://git./linux/kernel/git/maz/arm-platforms.git
Stephen Rothwell [Mon, 17 Jan 2022 21:54:23 +0000 (08:54 +1100)]
Merge branch 'fixes' of git://git./linux/kernel/git/rw/ubifs.git
Stephen Rothwell [Mon, 17 Jan 2022 21:54:22 +0000 (08:54 +1100)]
Merge branch 'gpio/for-current' of git://git./linux/kernel/git/brgl/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 21:54:20 +0000 (08:54 +1100)]
Merge branch 'fix' of git://git./linux/kernel/git/leo/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 21:54:15 +0000 (08:54 +1100)]
Merge branch 'rtc-fixes' of git://git./linux/kernel/git/abelloni/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 21:54:14 +0000 (08:54 +1100)]
Merge branch 'next-fixes' of git://git./linux/kernel/git/kdave/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 21:54:13 +0000 (08:54 +1100)]
Merge branch 'hwmon' of git://git./linux/kernel/git/groeck/linux-staging.git
Stephen Rothwell [Mon, 17 Jan 2022 21:54:11 +0000 (08:54 +1100)]
Merge branch 'fixes' of git://linuxtv.org/mchehab/media-next.git
Stephen Rothwell [Mon, 17 Jan 2022 21:54:09 +0000 (08:54 +1100)]
Merge branch 'fixes-togreg' of git://git./linux/kernel/git/jic23/iio.git
Stephen Rothwell [Mon, 17 Jan 2022 21:54:09 +0000 (08:54 +1100)]
Merge branch 'for-usb-fixes' of git://git./linux/kernel/git/peter.chen/usb.git
# Conflicts:
# drivers/usb/chipidea/ci_hdrc_imx.c
Stephen Rothwell [Mon, 17 Jan 2022 21:54:06 +0000 (08:54 +1100)]
Merge branch 'for-linus' of git://git./linux/kernel/git/broonie/spi.git
Stephen Rothwell [Mon, 17 Jan 2022 21:54:05 +0000 (08:54 +1100)]
Merge branch 'for-linus' of git://git./linux/kernel/git/broonie/regulator.git
Stephen Rothwell [Mon, 17 Jan 2022 21:54:03 +0000 (08:54 +1100)]
Merge branch 'for-linus' of git://git./linux/kernel/git/broonie/regmap.git
Stephen Rothwell [Mon, 17 Jan 2022 21:54:02 +0000 (08:54 +1100)]
Merge branch 'for-linus' of git://git./linux/kernel/git/broonie/sound.git
Stephen Rothwell [Mon, 17 Jan 2022 21:54:02 +0000 (08:54 +1100)]
Merge branch 'for-linus' of git://git./linux/kernel/git/tiwai/sound.git
Stephen Rothwell [Mon, 17 Jan 2022 21:54:01 +0000 (08:54 +1100)]
Merge branch 'master' of git://git./linux/kernel/git/pablo/nf.git
Stephen Rothwell [Mon, 17 Jan 2022 21:54:00 +0000 (08:54 +1100)]
Merge branch 'master' of git://git./linux/kernel/git/bpf/bpf.git
Stephen Rothwell [Mon, 17 Jan 2022 21:53:59 +0000 (08:53 +1100)]
Merge branch 'master' of git://git./linux/kernel/git/netdev/net.git
Stephen Rothwell [Mon, 17 Jan 2022 21:53:58 +0000 (08:53 +1100)]
Merge branch 'fixes' of git://git./linux/kernel/git/powerpc/linux.git
Stephen Rothwell [Mon, 17 Jan 2022 21:53:57 +0000 (08:53 +1100)]
Merge branch 'fixes' of https://git./linux/kernel/git/krzk/linux-mem-ctrl.git
Stephen Rothwell [Mon, 17 Jan 2022 21:53:56 +0000 (08:53 +1100)]
Merge branch 'for-curr' of git://git./linux/kernel/git/vgupta/arc.git
YueHaibing [Thu, 9 Dec 2021 09:01:13 +0000 (17:01 +0800)]
video: fbdev: controlfb: Fix COMPILE_TEST build
If PPC_BOOK3S, PPC_PMAC and PPC32 is n, COMPILE_TEST build fails:
drivers/video/fbdev/controlfb.c:70:0: error: "pgprot_cached_wthru" redefined [-Werror]
#define pgprot_cached_wthru(prot) (prot)
In file included from ./arch/powerpc/include/asm/pgtable.h:20:0,
from ./include/linux/pgtable.h:6,
from ./include/linux/mm.h:33,
from drivers/video/fbdev/controlfb.c:37:
./arch/powerpc/include/asm/nohash/pgtable.h:243:0: note: this is the location of the previous definition
#define pgprot_cached_wthru(prot) (__pgprot((pgprot_val(prot) & ~_PAGE_CACHE_CTL) | \
Fixes:
a07a63b0e24d ("video: fbdev: controlfb: add COMPILE_TEST support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Chunyang Zhong [Fri, 10 Dec 2021 10:28:16 +0000 (18:28 +0800)]
video: ocfb: add const to of_device_id
struct of_device_id should normally be const.
Signed-off-by: Chunyang Zhong <zhongchunyang@cdjrlc.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Luca Weiss [Mon, 13 Dec 2021 08:26:10 +0000 (09:26 +0100)]
dt-bindings: simple-framebuffer: allow standalone compatible
Qualcomm platforms use "simple-framebuffer" without a more specific
compatible. Allow that in the binding doc.
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Helge Deller <deller@gmx.de>
Yang Guang [Sat, 18 Dec 2021 01:56:59 +0000 (09:56 +0800)]
video: fbdev: use swap() to make code cleaner
Use the macro 'swap()' defined in 'include/linux/minmax.h' to avoid
opencoding it.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: David Yang <davidcomponentone@gmail.com>
Signed-off-by: Yang Guang <yang.guang5@zte.com.cn>
Signed-off-by: Helge Deller <deller@gmx.de>
Z. Liu [Sat, 18 Dec 2021 18:00:35 +0000 (02:00 +0800)]
matroxfb: set maxvram of vbG200eW to the same as vbG200 to avoid black screen
Start from commit
11be60bd66d54 "matroxfb: add Matrox MGA-G200eW board
support", when maxvram is 0x800000, monitor become black w/ error message
said: "The current input timing is not supported by the monitor display.
Please change your input timing to 1920x1080@60Hz ...".
Fixes:
11be60bd66d5 ("matroxfb: add Matrox MGA-G200eW board support")
Signed-off-by: Z. Liu <liuzx@knownsec.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Eugene Korenevsky [Fri, 14 Jan 2022 19:53:40 +0000 (22:53 +0300)]
cifs: quirk for STATUS_OBJECT_NAME_INVALID returned for non-ASCII dfs refs
Windows SMB server responds with STATUS_OBJECT_NAME_INVALID code to
SMB2 QUERY_INFO request for "\<server>\<dfsname>\<linkpath>" DFS reference,
where <dfsname> contains non-ASCII unicode symbols.
Check such DFS reference and emulate -EREMOTE if it is actual.
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215440
Signed-off-by: Eugene Korenevsky <ekorenevsky@astralinux.ru>
Signed-off-by: Steve French <stfrench@microsoft.com>
Eugene Korenevsky [Fri, 14 Jan 2022 19:53:00 +0000 (22:53 +0300)]
cifs: alloc_path_with_tree_prefix: do not append sep. if the path is empty
alloc_path_with_tree_prefix() concatenates tree prefix and the path.
Windows CIFS client does not add separator after the tree prefix if the path
is empty. Let's do the same.
This fixes mounting DFS namespaces with names containing non-ASCII symbols.
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215440
Signed-off-by: Eugene Korenevsky <ekorenevsky@astralinux.ru>
Signed-off-by: Steve French <stfrench@microsoft.com>
Yang Li [Mon, 17 Jan 2022 01:11:30 +0000 (09:11 +0800)]
cifs: clean up an inconsistent indenting
Eliminate the follow smatch warning:
fs/cifs/sess.c:1581 sess_auth_rawntlmssp_authenticate() warn:
inconsistent indenting
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Shyam Prasad N [Mon, 17 Jan 2022 06:20:47 +0000 (00:20 -0600)]
cifs: free ntlmsspblob allocated in negotiate
One of my previous fixes:
cifs: send workstation name during ntlmssp session setup
...changed the prototype of build_ntlmssp_negotiate_blob
from being allocated by the caller to being allocated within
the function. The caller needs to free this object too.
While SMB2 version of the caller did it, I forgot to free
for the SMB1 version. Fixing that here.
Fixes:
49bd49f983b5 ("cifs: send workstation name during ntlmssp session setup")
Cc: stable@vger.kernel.org # 5.16
Signed-off-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
David Sterba [Mon, 17 Jan 2022 17:38:18 +0000 (18:38 +0100)]
Merge branch 'misc-5.17' into next-fixes
Filipe Manana [Mon, 17 Jan 2022 16:28:29 +0000 (16:28 +0000)]
btrfs: fix too long loop when defragging a 1 byte file
When attempting to defrag a file with a single byte, we can end up in a
too long loop, which is nearly infinite because at btrfs_defrag_file()
we end up with the variable last_byte assigned with a value of
18446744073709551615 (which is (u64)-1). The problem comes from the fact
we end up doing:
last_byte = round_up(last_byte, fs_info->sectorsize) - 1;
So if last_byte was assigned 0, which is i_size - 1, we underflow and
end up with the value
18446744073709551615.
This is trivial to reproduce and the following script triggers it:
$ cat test.sh
#!/bin/bash
DEV=/dev/sdj
MNT=/mnt/sdj
mkfs.btrfs -f $DEV
mount $DEV $MNT
echo -n "X" > $MNT/foobar
btrfs filesystem defragment $MNT/foobar
umount $MNT
So fix this by not decrementing last_byte by 1 before doing the sector
size round up. Also, to make it easier to follow, make the round up right
after computing last_byte.
Reported-by: Anthony Ruhier <aruhier@mailbox.org>
Fixes:
7b508037d4cac3 ("btrfs: defrag: use defrag_one_cluster() to implement btrfs_defrag_file()")
CC: stable@vger.kernel.org # 5.16+
Link: https://lore.kernel.org/linux-btrfs/0a269612-e43f-da22-c5bc-b34b1b56ebe8@mailbox.org/
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Qu Wenruo [Thu, 16 Dec 2021 11:47:35 +0000 (19:47 +0800)]
btrfs: don't start transaction for scrub if the fs is mounted read-only
[BUG]
The following super simple script would crash btrfs at unmount time, if
CONFIG_BTRFS_ASSERT() is set.
mkfs.btrfs -f $dev
mount $dev $mnt
xfs_io -f -c "pwrite 0 4k" $mnt/file
umount $mnt
mount -r ro $dev $mnt
btrfs scrub start -Br $mnt
umount $mnt
This will trigger the following ASSERT() introduced by commit
0a31daa4b602 ("btrfs: add assertion for empty list of transactions at
late stage of umount").
That patch is definitely not the cause, it just makes enough noise for
developers.
[CAUSE]
We will start transaction for the following call chain during scrub:
scrub_enumerate_chunks()
|- btrfs_inc_block_group_ro()
|- btrfs_join_transaction()
However for RO mount, there is no running transaction at all, thus
btrfs_join_transaction() will start a new transaction.
Furthermore, since it's read-only mount, btrfs_sync_fs() will not call
btrfs_commit_super() to commit the new but empty transaction.
And leads to the ASSERT().
The bug has been there for a long time. Only the new ASSERT() makes it
noisy enough to be noticed.
[FIX]
For read-only scrub on read-only mount, there is no need to start a
transaction nor to allocate new chunks in btrfs_inc_block_group_ro().
Just do extra read-only mount check in btrfs_inc_block_group_ro(), and
if it's read-only, skip all chunk allocation and go inc_block_group_ro()
directly.
CC: stable@vger.kernel.org # 5.4+
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Darrick J. Wong [Tue, 21 Dec 2021 21:07:38 +0000 (13:07 -0800)]
xfs: remove the XFS_IOC_{ALLOC,FREE}SP* definitions
Now that we've made these ioctls defunct, move them from xfs_fs.h to
xfs_ioctl.c, which effectively removes them from the publicly supported
ioctl interfaces for XFS.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>