提交 6e2f8766 编写于 作者: L LEAN-ESX

kernel: bump to 4.9.196, 4.14.148, 4.19.78

上级 ef6133ce
......@@ -6,13 +6,13 @@ ifdef CONFIG_TESTING_KERNEL
KERNEL_PATCHVER:=$(KERNEL_TESTING_PATCHVER)
endif
LINUX_VERSION-4.9 = .194
LINUX_VERSION-4.14 = .146
LINUX_VERSION-4.19 = .75
LINUX_VERSION-4.9 = .196
LINUX_VERSION-4.14 = .148
LINUX_VERSION-4.19 = .78
LINUX_KERNEL_HASH-4.9.194 = d5f4bb7584e461f1faa9a3f94c2ad292246fe692b0e992e072dac255f806c2e3
LINUX_KERNEL_HASH-4.14.146 = a3c54b887ea3e679382bd4c0536e6a281b071dab2258bd3ee8af75baef2023f5
LINUX_KERNEL_HASH-4.19.75 = dd5e7147e1e4501560fba5beb86dae6bf6ba843518ab3d4cad283de77b651b78
LINUX_KERNEL_HASH-4.9.196 = e0ab12b04a975630ece2142a1ac15cfe45140b8c3359226b035c15ca7c92c6ef
LINUX_KERNEL_HASH-4.14.148 = 12d2b74003e13a6c1956064754255249fbe5c7af6cbdfb2ddeba45b5ed7c0fad
LINUX_KERNEL_HASH-4.19.78 = df63ea77c6e28566102a33f503513bc6280f79b48c90921b39661d3ce6295049
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))
......
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1635,8 +1635,8 @@ static int __xipram do_write_oneword(str
break;
@@ -1641,7 +1641,7 @@ static int __xipram do_write_oneword(str
}
- if (chip_ready(map, adr))
if (chip_good(map, adr, datum))
- break;
+ if (chip_good(map, adr, datum))
+ goto enable_xip;
/* Latency issues. Drop the lock, wait a while and retry */
UDELAY(map, chip, adr, 1);
@@ -1652,6 +1652,8 @@ static int __xipram do_write_oneword(str
ret = -EIO;
@@ -1658,6 +1658,8 @@ static int __xipram do_write_oneword(str
goto retry;
}
}
+
+ enable_xip:
xip_enable(map, chip, adr);
op_done:
if (mode == FL_OTP_WRITE)
@@ -2230,7 +2232,6 @@ static int cfi_amdstd_panic_write(struct
@@ -2236,7 +2238,6 @@ static int cfi_amdstd_panic_write(struct
return 0;
}
......@@ -28,7 +26,7 @@
/*
* Handle devices with one erase region, that only implement
* the chip erase command.
@@ -2298,7 +2299,7 @@ static int __xipram do_erase_chip(struct
@@ -2304,7 +2305,7 @@ static int __xipram do_erase_chip(struct
}
if (chip_good(map, adr, map_word_ff(map)))
......@@ -37,7 +35,7 @@
if (time_after(jiffies, timeo)) {
printk(KERN_WARNING "MTD %s(): software timeout\n",
@@ -2322,6 +2323,7 @@ static int __xipram do_erase_chip(struct
@@ -2328,6 +2329,7 @@ static int __xipram do_erase_chip(struct
}
}
......@@ -45,7 +43,7 @@
chip->state = FL_READY;
xip_enable(map, chip, adr);
DISABLE_VPP(map);
@@ -2395,7 +2397,7 @@ static int __xipram do_erase_oneblock(st
@@ -2401,7 +2403,7 @@ static int __xipram do_erase_oneblock(st
if (chip_good(map, adr, map_word_ff(map))) {
xip_enable(map, chip, adr);
......@@ -54,7 +52,7 @@
}
if (time_after(jiffies, timeo)) {
@@ -2421,6 +2423,7 @@ static int __xipram do_erase_oneblock(st
@@ -2427,6 +2429,7 @@ static int __xipram do_erase_oneblock(st
}
}
......
......@@ -35,7 +35,7 @@
/* Atmel chips don't use the same PRI format as AMD chips */
static void fixup_convert_atmel_pri(struct mtd_info *mtd)
@@ -1794,6 +1798,7 @@ static int cfi_amdstd_write_words(struct
@@ -1800,6 +1804,7 @@ static int cfi_amdstd_write_words(struct
/*
* FIXME: interleaved mode not tested, and probably not supported!
*/
......@@ -43,7 +43,7 @@
static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
unsigned long adr, const u_char *buf,
int len)
@@ -1922,7 +1927,6 @@ static int __xipram do_write_buffer(stru
@@ -1928,7 +1933,6 @@ static int __xipram do_write_buffer(stru
return ret;
}
......@@ -51,7 +51,7 @@
static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)
{
@@ -1997,6 +2001,7 @@ static int cfi_amdstd_write_buffers(stru
@@ -2003,6 +2007,7 @@ static int cfi_amdstd_write_buffers(stru
return 0;
}
......
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1635,8 +1635,8 @@ static int __xipram do_write_oneword(str
break;
@@ -1641,7 +1641,7 @@ static int __xipram do_write_oneword(str
}
- if (chip_ready(map, adr))
if (chip_good(map, adr, datum))
- break;
+ if (chip_good(map, adr, datum))
+ goto enable_xip;
/* Latency issues. Drop the lock, wait a while and retry */
UDELAY(map, chip, adr, 1);
@@ -1652,6 +1652,8 @@ static int __xipram do_write_oneword(str
ret = -EIO;
@@ -1658,6 +1658,8 @@ static int __xipram do_write_oneword(str
goto retry;
}
}
+
+ enable_xip:
xip_enable(map, chip, adr);
op_done:
if (mode == FL_OTP_WRITE)
@@ -2230,7 +2232,6 @@ static int cfi_amdstd_panic_write(struct
@@ -2236,7 +2238,6 @@ static int cfi_amdstd_panic_write(struct
return 0;
}
......@@ -28,7 +26,7 @@
/*
* Handle devices with one erase region, that only implement
* the chip erase command.
@@ -2298,7 +2299,7 @@ static int __xipram do_erase_chip(struct
@@ -2304,7 +2305,7 @@ static int __xipram do_erase_chip(struct
}
if (chip_good(map, adr, map_word_ff(map)))
......@@ -37,7 +35,7 @@
if (time_after(jiffies, timeo)) {
printk(KERN_WARNING "MTD %s(): software timeout\n",
@@ -2322,6 +2323,7 @@ static int __xipram do_erase_chip(struct
@@ -2328,6 +2329,7 @@ static int __xipram do_erase_chip(struct
}
}
......@@ -45,7 +43,7 @@
chip->state = FL_READY;
xip_enable(map, chip, adr);
DISABLE_VPP(map);
@@ -2395,7 +2397,7 @@ static int __xipram do_erase_oneblock(st
@@ -2401,7 +2403,7 @@ static int __xipram do_erase_oneblock(st
if (chip_good(map, adr, map_word_ff(map))) {
xip_enable(map, chip, adr);
......@@ -54,7 +52,7 @@
}
if (time_after(jiffies, timeo)) {
@@ -2421,6 +2423,7 @@ static int __xipram do_erase_oneblock(st
@@ -2427,6 +2429,7 @@ static int __xipram do_erase_oneblock(st
}
}
......
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1634,8 +1634,8 @@ static int __xipram do_write_oneword(str
break;
@@ -1640,7 +1640,7 @@ static int __xipram do_write_oneword(str
}
- if (chip_ready(map, adr))
if (chip_good(map, adr, datum))
- break;
+ if (chip_good(map, adr, datum))
+ goto enable_xip;
/* Latency issues. Drop the lock, wait a while and retry */
UDELAY(map, chip, adr, 1);
@@ -1651,6 +1651,8 @@ static int __xipram do_write_oneword(str
ret = -EIO;
@@ -1657,6 +1657,8 @@ static int __xipram do_write_oneword(str
goto retry;
}
}
+
+ enable_xip:
xip_enable(map, chip, adr);
op_done:
if (mode == FL_OTP_WRITE)
@@ -2229,7 +2231,6 @@ static int cfi_amdstd_panic_write(struct
@@ -2235,7 +2237,6 @@ static int cfi_amdstd_panic_write(struct
return 0;
}
......@@ -28,7 +26,7 @@
/*
* Handle devices with one erase region, that only implement
* the chip erase command.
@@ -2297,7 +2298,7 @@ static int __xipram do_erase_chip(struct
@@ -2303,7 +2304,7 @@ static int __xipram do_erase_chip(struct
}
if (chip_good(map, adr, map_word_ff(map)))
......@@ -37,7 +35,7 @@
if (time_after(jiffies, timeo)) {
printk(KERN_WARNING "MTD %s(): software timeout\n",
@@ -2321,6 +2322,7 @@ static int __xipram do_erase_chip(struct
@@ -2327,6 +2328,7 @@ static int __xipram do_erase_chip(struct
}
}
......@@ -45,7 +43,7 @@
chip->state = FL_READY;
xip_enable(map, chip, adr);
DISABLE_VPP(map);
@@ -2393,7 +2395,7 @@ static int __xipram do_erase_oneblock(st
@@ -2399,7 +2401,7 @@ static int __xipram do_erase_oneblock(st
}
if (chip_good(map, adr, map_word_ff(map)))
......@@ -54,7 +52,7 @@
if (time_after(jiffies, timeo)) {
printk(KERN_WARNING "MTD %s(): software timeout\n",
@@ -2417,6 +2419,7 @@ static int __xipram do_erase_oneblock(st
@@ -2423,6 +2425,7 @@ static int __xipram do_erase_oneblock(st
}
}
......
......@@ -47,7 +47,7 @@ Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
struct bcm2835_dmadev {
struct dma_device ddev;
@@ -912,6 +914,9 @@ static int bcm2835_dma_probe(struct plat
@@ -914,6 +916,9 @@ static int bcm2835_dma_probe(struct plat
base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base))
return PTR_ERR(base);
......@@ -57,7 +57,7 @@ Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
od->base = base;
@@ -950,6 +955,9 @@ static int bcm2835_dma_probe(struct plat
@@ -952,6 +957,9 @@ static int bcm2835_dma_probe(struct plat
goto err_no_dma;
}
......@@ -67,7 +67,7 @@ Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
/* get irqs for each channel that we support */
for (i = 0; i <= BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED; i++) {
/* skip masked out channels */
@@ -1024,6 +1032,7 @@ static int bcm2835_dma_remove(struct pla
@@ -1026,6 +1034,7 @@ static int bcm2835_dma_remove(struct pla
{
struct bcm2835_dmadev *od = platform_get_drvdata(pdev);
......@@ -75,7 +75,7 @@ Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
dma_async_device_unregister(&od->ddev);
bcm2835_dma_free(od);
@@ -1039,7 +1048,22 @@ static struct platform_driver bcm2835_dm
@@ -1041,7 +1050,22 @@ static struct platform_driver bcm2835_dm
},
};
......
......@@ -143,7 +143,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
static const struct of_device_id bcm2835_dma_of_match[] = {
{ .compatible = "brcm,bcm2835-dma", },
{},
@@ -964,6 +1064,13 @@ static int bcm2835_dma_probe(struct plat
@@ -966,6 +1066,13 @@ static int bcm2835_dma_probe(struct plat
/* Channel 0 is used by the legacy API */
chans_available &= ~BCM2835_DMA_BULK_MASK;
......
......@@ -16,7 +16,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2930,6 +2930,10 @@ static irqreturn_t sdhci_irq(int irq, vo
@@ -2932,6 +2932,10 @@ static irqreturn_t sdhci_irq(int irq, vo
result = IRQ_WAKE_THREAD;
}
......
......@@ -713,7 +713,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
if (!pdev->dev.dma_mask)
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
@@ -1020,9 +1206,13 @@ static int bcm2835_dma_probe(struct plat
@@ -1022,9 +1208,13 @@ static int bcm2835_dma_probe(struct plat
base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(base))
return PTR_ERR(base);
......@@ -730,7 +730,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
od->base = base;
@@ -1052,6 +1242,14 @@ static int bcm2835_dma_probe(struct plat
@@ -1054,6 +1244,14 @@ static int bcm2835_dma_probe(struct plat
platform_set_drvdata(pdev, od);
......@@ -745,7 +745,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
/* Request DMA channel mask from device tree */
if (of_property_read_u32(pdev->dev.of_node,
"brcm,dma-channel-mask",
@@ -1061,18 +1259,34 @@ static int bcm2835_dma_probe(struct plat
@@ -1063,18 +1261,34 @@ static int bcm2835_dma_probe(struct plat
goto err_no_dma;
}
......@@ -788,7 +788,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
/* skip masked out channels */
if (!(chans_available & (1 << i))) {
irq[i] = -1;
@@ -1095,13 +1309,17 @@ static int bcm2835_dma_probe(struct plat
@@ -1097,13 +1311,17 @@ static int bcm2835_dma_probe(struct plat
irq[i] = platform_get_irq(pdev, i < 11 ? i : 11);
}
......@@ -807,7 +807,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
irq_flags = 0;
for (j = 0; j <= BCM2835_DMA_MAX_DMA_CHAN_SUPPORTED; j++)
if ((i != j) && (irq[j] == irq[i])) {
@@ -1113,9 +1331,10 @@ static int bcm2835_dma_probe(struct plat
@@ -1115,9 +1333,10 @@ static int bcm2835_dma_probe(struct plat
rc = bcm2835_dma_chan_init(od, i, irq[i], irq_flags);
if (rc)
goto err_no_dma;
......@@ -819,7 +819,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
/* Device-tree DMA controller registration */
rc = of_dma_controller_register(pdev->dev.of_node,
@@ -1147,6 +1366,13 @@ static int bcm2835_dma_remove(struct pla
@@ -1149,6 +1368,13 @@ static int bcm2835_dma_remove(struct pla
bcm_dmaman_remove(pdev);
dma_async_device_unregister(&od->ddev);
......
......@@ -33,7 +33,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
#define USB_VENDOR_ID_BELKIN 0x050d
#define USB_DEVICE_ID_FLIP_KVM 0x3201
@@ -1188,6 +1191,9 @@
@@ -1189,6 +1192,9 @@
#define USB_VENDOR_ID_XAT 0x2505
#define USB_DEVICE_ID_XAT_CSR 0x0220
......@@ -53,7 +53,7 @@ Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH), HID_QUIRK_MULTI_INPUT },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE), HID_QUIRK_ALWAYS_POLL },
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_PIXART_USB_OPTICAL_MOUSE2), HID_QUIRK_ALWAYS_POLL },
@@ -173,6 +174,7 @@ static const struct hid_device_id hid_qu
@@ -174,6 +175,7 @@ static const struct hid_device_id hid_qu
{ HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SIRIUS_BATTERY_FREE_TABLET), HID_QUIRK_MULTI_INPUT },
{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD2, USB_DEVICE_ID_SMARTJOY_DUAL_PLUS), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_QUAD_USB_JOYPAD), HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT },
......
......@@ -55,7 +55,7 @@ Cc: Kir Kolyshkin <kir@openvz.org>
rwlock_t sk_callback_lock;
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2740,6 +2740,7 @@ void sock_init_data(struct socket *sock,
@@ -2745,6 +2745,7 @@ void sock_init_data(struct socket *sock,
sk->sk_max_pacing_rate = ~0U;
sk->sk_pacing_rate = ~0U;
......
......@@ -55,7 +55,7 @@ Cc: Kir Kolyshkin <kir@openvz.org>
rwlock_t sk_callback_lock;
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -2479,6 +2479,7 @@ void sock_init_data(struct socket *sock,
@@ -2484,6 +2484,7 @@ void sock_init_data(struct socket *sock,
sk->sk_max_pacing_rate = ~0U;
sk->sk_pacing_rate = ~0U;
......
......@@ -1379,7 +1379,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
*/
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -1070,7 +1070,7 @@ err:
@@ -1071,7 +1071,7 @@ err:
if (work_done < budget) {
int more_to_do = 0;
......
......@@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/Makefile
+++ b/Makefile
@@ -1241,7 +1241,6 @@ all: modules
@@ -1243,7 +1243,6 @@ all: modules
PHONY += modules
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
......@@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
@$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
@@ -1270,7 +1269,6 @@ _modinst_:
@@ -1272,7 +1271,6 @@ _modinst_:
rm -f $(MODLIB)/build ; \
ln -s $(CURDIR) $(MODLIB)/build ; \
fi
......
......@@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
device, it has to decide which ones to send first, which ones to
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -2028,7 +2028,7 @@ static int __init pktsched_init(void)
@@ -2029,7 +2029,7 @@ static int __init pktsched_init(void)
return err;
}
......
......@@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie)
{
struct dst_entry *dst = __sk_dst_get(sk);
@@ -1593,9 +1605,11 @@ void sk_destruct(struct sock *sk)
@@ -1598,9 +1610,11 @@ void sk_destruct(struct sock *sk)
static void __sk_free(struct sock *sk)
{
......
......@@ -327,7 +327,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3379,6 +3379,8 @@ static __net_initdata struct pernet_oper
@@ -3384,6 +3384,8 @@ static __net_initdata struct pernet_oper
static int __init proto_init(void)
{
......
From: Evan Green <evgreen@chromium.org>
Subject: [PATCH v5 0/2] loop: Better discard for block devices
Date: Mon, 6 May 2019 11:27:35 -0700
Message-Id: <20190506182736.21064-2-evgreen@chromium.org>
This series addresses some errors seen when using the loop
device directly backed by a block device.
The first change titled "loop: Better discard for block devices"
plumbs out the correct error message, and the second change prevents
the error from occurring in many cases.
The errors look like this:
[ 90.880875] print_req_error: I/O error, dev loop5, sector 0
The errors occur when trying to do a discard or write zeroes operation
on a loop device backed by a block device that does not support write zeroes.
Firstly, the error itself is incorrectly reported as I/O error, but is
actually EOPNOTSUPP. The first patch plumbs out EOPNOTSUPP to properly
report the error.
The second patch called "loop: Better discard support for block devices"
prevents these errors from occurring by mirroring the zeroing capabilities
of the underlying block device into the loop device.
Before this change, discard was always reported as being supported, and
the loop device simply turns around and does an fallocate operation on the
backing device. After this change, backing block devices that do support
zeroing will continue to work as before, and continue to get all the
benefits of doing that. Backing devices that do not support zeroing will
fail earlier, avoiding hitting the loop device at all and ultimately
avoiding this error in the logs.
I can also confirm that this fixes test block/003 in the blktests, when
running blktests on a loop device backed by a block device.
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
---
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -416,19 +416,14 @@ out_free_page:
return ret;
}
-static int lo_discard(struct loop_device *lo, struct request *rq, loff_t pos)
+static int lo_discard(struct loop_device *lo, struct request *rq,
+ int mode, loff_t pos)
{
- /*
- * We use punch hole to reclaim the free space used by the
- * image a.k.a. discard. However we do not support discard if
- * encryption is enabled, because it may give an attacker
- * useful information.
- */
struct file *file = lo->lo_backing_file;
- int mode = FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE;
+ struct request_queue *q = lo->lo_queue;
int ret;
- if ((!file->f_op->fallocate) || lo->lo_encrypt_key_size) {
+ if (!blk_queue_discard(q)) {
ret = -EOPNOTSUPP;
goto out;
}
@@ -457,7 +452,9 @@ static void lo_complete_rq(struct reques
if (!cmd->use_aio || cmd->ret < 0 || cmd->ret == blk_rq_bytes(rq) ||
req_op(rq) != REQ_OP_READ) {
- if (cmd->ret < 0)
+ if (cmd->ret == -EOPNOTSUPP)
+ ret = BLK_STS_NOTSUPP;
+ else if (cmd->ret < 0)
ret = BLK_STS_IOERR;
goto end_io;
}
@@ -597,8 +594,13 @@ static int do_req_filebacked(struct loop
case REQ_OP_FLUSH:
return lo_req_flush(lo, rq);
case REQ_OP_DISCARD:
+ return lo_discard(lo, rq,
+ FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, pos);
+
case REQ_OP_WRITE_ZEROES:
- return lo_discard(lo, rq, pos);
+ return lo_discard(lo, rq,
+ FALLOC_FL_ZERO_RANGE | FALLOC_FL_KEEP_SIZE, pos);
+
case REQ_OP_WRITE:
if (lo->transfer)
return lo_write_transfer(lo, rq, pos);
@@ -853,6 +855,21 @@ static void loop_config_discard(struct l
struct file *file = lo->lo_backing_file;
struct inode *inode = file->f_mapping->host;
struct request_queue *q = lo->lo_queue;
+ struct request_queue *backingq;
+
+ /*
+ * If the backing device is a block device, mirror its zeroing
+ * capability. REQ_OP_DISCARD translates to a zero-out even when backed
+ * by block devices to keep consistent behavior with file-backed loop
+ * devices.
+ */
+ if (S_ISBLK(inode->i_mode) && !lo->lo_encrypt_key_size) {
+ backingq = bdev_get_queue(inode->i_bdev);
+ blk_queue_max_discard_sectors(q,
+ backingq->limits.max_write_zeroes_sectors);
+
+ blk_queue_max_write_zeroes_sectors(q,
+ backingq->limits.max_write_zeroes_sectors);
/*
* We use punch hole to reclaim the free space used by the
@@ -860,22 +877,24 @@ static void loop_config_discard(struct l
* encryption is enabled, because it may give an attacker
* useful information.
*/
- if ((!file->f_op->fallocate) ||
- lo->lo_encrypt_key_size) {
+ } else if ((!file->f_op->fallocate) || lo->lo_encrypt_key_size) {
q->limits.discard_granularity = 0;
q->limits.discard_alignment = 0;
blk_queue_max_discard_sectors(q, 0);
blk_queue_max_write_zeroes_sectors(q, 0);
- blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
- return;
- }
- q->limits.discard_granularity = inode->i_sb->s_blocksize;
- q->limits.discard_alignment = 0;
+ } else {
+ q->limits.discard_granularity = inode->i_sb->s_blocksize;
+ q->limits.discard_alignment = 0;
- blk_queue_max_discard_sectors(q, UINT_MAX >> 9);
- blk_queue_max_write_zeroes_sectors(q, UINT_MAX >> 9);
- blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
+ blk_queue_max_discard_sectors(q, UINT_MAX >> 9);
+ blk_queue_max_write_zeroes_sectors(q, UINT_MAX >> 9);
+ }
+
+ if (q->limits.max_write_zeroes_sectors)
+ blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
+ else
+ blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
}
static void loop_unprepare_queue(struct loop_device *lo)
@@ -1894,7 +1913,10 @@ static void loop_handle_cmd(struct loop_
failed:
/* complete non-aio request */
if (!cmd->use_aio || ret) {
- cmd->ret = ret ? -EIO : 0;
+ if (ret == -EOPNOTSUPP)
+ cmd->ret = ret;
+ else
+ cmd->ret = ret ? -EIO : 0;
blk_mq_complete_request(rq);
}
}
......@@ -44,7 +44,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
device, it has to decide which ones to send first, which ones to
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -2157,7 +2157,7 @@ static int __init pktsched_init(void)
@@ -2160,7 +2160,7 @@ static int __init pktsched_init(void)
return err;
}
......
......@@ -61,7 +61,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie)
{
struct dst_entry *dst = __sk_dst_get(sk);
@@ -1598,9 +1610,11 @@ static void __sk_free(struct sock *sk)
@@ -1603,9 +1615,11 @@ static void __sk_free(struct sock *sk)
if (likely(sk->sk_net_refcnt))
sock_inuse_add(sock_net(sk), -1);
......
......@@ -327,7 +327,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3480,6 +3480,8 @@ static __net_initdata struct pernet_oper
@@ -3485,6 +3485,8 @@ static __net_initdata struct pernet_oper
static int __init proto_init(void)
{
......
......@@ -41,7 +41,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
obj-$(CONFIG_PROC_FS) += net-procfs.o
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1458,9 +1458,11 @@ void sk_destruct(struct sock *sk)
@@ -1463,9 +1463,11 @@ void sk_destruct(struct sock *sk)
static void __sk_free(struct sock *sk)
{
......
......@@ -328,7 +328,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -3088,6 +3088,8 @@ static __net_initdata struct pernet_oper
@@ -3093,6 +3093,8 @@ static __net_initdata struct pernet_oper
static int __init proto_init(void)
{
......
......@@ -18,7 +18,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -39,20 +39,22 @@ ifneq ($(wildcard $(obj)/$(datafile_d_y)
@@ -42,20 +42,22 @@ ifneq ($(wildcard $(obj)/$(datafile_d_y)
include $(obj)/$(datafile_d_y)
endif
......
......@@ -7,7 +7,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
1 file changed, 1 insertion(+)
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1833,6 +1833,7 @@ static int __xipram do_write_buffer(stru
@@ -1839,6 +1839,7 @@ static int __xipram do_write_buffer(stru
/* Write Buffer Load */
map_write(map, CMD(0x25), cmd_adr);
......
......@@ -18,7 +18,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
--- a/usr/Makefile
+++ b/usr/Makefile
@@ -39,20 +39,22 @@ ifneq ($(wildcard $(obj)/$(datafile_d_y)
@@ -42,20 +42,22 @@ ifneq ($(wildcard $(obj)/$(datafile_d_y)
include $(obj)/$(datafile_d_y)
endif
......
......@@ -7,7 +7,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
1 file changed, 1 insertion(+)
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1832,6 +1832,7 @@ static int __xipram do_write_buffer(stru
@@ -1838,6 +1838,7 @@ static int __xipram do_write_buffer(stru
/* Write Buffer Load */
map_write(map, CMD(0x25), cmd_adr);
......
......@@ -7,7 +7,7 @@ Signed-off-by: George Kashperko <george@znau.edu.ua>
1 file changed, 1 insertion(+)
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1829,6 +1829,7 @@ static int __xipram do_write_buffer(stru
@@ -1835,6 +1835,7 @@ static int __xipram do_write_buffer(stru
/* Write Buffer Load */
map_write(map, CMD(0x25), cmd_adr);
......
......@@ -497,7 +497,7 @@ Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
.name = "sdhci-esdhc",
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2148,7 +2148,7 @@ static void sdhci_send_tuning(struct sdh
@@ -2150,7 +2150,7 @@ static void sdhci_send_tuning(struct sdh
}
......@@ -506,7 +506,7 @@ Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
{
int i;
@@ -2165,13 +2165,13 @@ static void __sdhci_execute_tuning(struc
@@ -2167,13 +2167,13 @@ static void __sdhci_execute_tuning(struc
pr_info("%s: Tuning timeout, falling back to fixed sampling clock\n",
mmc_hostname(host->mmc));
sdhci_abort_tuning(host, opcode);
......@@ -522,7 +522,7 @@ Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
break;
}
@@ -2183,6 +2183,7 @@ static void __sdhci_execute_tuning(struc
@@ -2185,6 +2185,7 @@ static void __sdhci_execute_tuning(struc
pr_info("%s: Tuning failed, falling back to fixed sampling clock\n",
mmc_hostname(host->mmc));
sdhci_reset_tuning(host);
......@@ -530,7 +530,7 @@ Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com>
}
int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
@@ -2244,7 +2245,7 @@ int sdhci_execute_tuning(struct mmc_host
@@ -2246,7 +2247,7 @@ int sdhci_execute_tuning(struct mmc_host
sdhci_start_tuning(host);
......
......@@ -28,7 +28,7 @@ Signed-off-by: Michael Gray <michael.gray@lantisproject.com>
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1925,6 +1925,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN
@@ -1926,6 +1926,17 @@ config ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEN
The command-line arguments provided by the boot loader will be
appended to the the device tree bootargs property.
......
......@@ -44,7 +44,7 @@ Subject: [PATCH 37/53] mtd: cfi cmdset 0002 force word write
/* Atmel chips don't use the same PRI format as AMD chips */
static void fixup_convert_atmel_pri(struct mtd_info *mtd)
@@ -1792,6 +1796,7 @@ static int cfi_amdstd_write_words(struct
@@ -1798,6 +1802,7 @@ static int cfi_amdstd_write_words(struct
/*
* FIXME: interleaved mode not tested, and probably not supported!
*/
......@@ -52,7 +52,7 @@ Subject: [PATCH 37/53] mtd: cfi cmdset 0002 force word write
static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
unsigned long adr, const u_char *buf,
int len)
@@ -1920,7 +1925,6 @@ static int __xipram do_write_buffer(stru
@@ -1926,7 +1931,6 @@ static int __xipram do_write_buffer(stru
return ret;
}
......@@ -60,7 +60,7 @@ Subject: [PATCH 37/53] mtd: cfi cmdset 0002 force word write
static int cfi_amdstd_write_buffers(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)
{
@@ -1995,6 +1999,7 @@ static int cfi_amdstd_write_buffers(stru
@@ -2001,6 +2005,7 @@ static int cfi_amdstd_write_buffers(stru
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册