Merge 5.15.85 into android14-5.15
Changes in 5.15.85 udf: Discard preallocation before extending file with a hole udf: Fix preallocation discarding at indirect extent boundary udf: Do not bother looking for prealloc extents if i_lenExtents matches i_size udf: Fix extending file within last block usb: gadget: uvc: Prevent buffer overflow in setup handler USB: serial: option: add Quectel EM05-G modem USB: serial: cp210x: add Kamstrup RF sniffer PIDs USB: serial: f81232: fix division by zero on line-speed change USB: serial: f81534: fix division by zero on line-speed change xhci: Apply XHCI_RESET_TO_DEFAULT quirk to ADL-N igb: Initialize mailbox message for VF reset usb: dwc3: pci: Update PCIe device ID for USB3 controller on CPU sub-system for Raptor Lake HID: uclogic: Add HID_QUIRK_HIDINPUT_FORCE quirk Bluetooth: L2CAP: Fix u8 overflow selftests: net: Use "grep -E" instead of "egrep" net: loopback: use NET_NAME_PREDICTABLE for name_assign_type Linux 5.15.85 Change-Id: Ia398b261925f9370124491034de3bc5e4dcc5022 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
VERSION = 5
|
VERSION = 5
|
||||||
PATCHLEVEL = 15
|
PATCHLEVEL = 15
|
||||||
SUBLEVEL = 84
|
SUBLEVEL = 85
|
||||||
EXTRAVERSION =
|
EXTRAVERSION =
|
||||||
NAME = Trick or Treat
|
NAME = Trick or Treat
|
||||||
|
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ static int uclogic_probe(struct hid_device *hdev,
|
|||||||
* than the pen, so use QUIRK_MULTI_INPUT for all tablets.
|
* than the pen, so use QUIRK_MULTI_INPUT for all tablets.
|
||||||
*/
|
*/
|
||||||
hdev->quirks |= HID_QUIRK_MULTI_INPUT;
|
hdev->quirks |= HID_QUIRK_MULTI_INPUT;
|
||||||
|
hdev->quirks |= HID_QUIRK_HIDINPUT_FORCE;
|
||||||
|
|
||||||
/* Allocate and assign driver data */
|
/* Allocate and assign driver data */
|
||||||
drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL);
|
drvdata = devm_kzalloc(&hdev->dev, sizeof(*drvdata), GFP_KERNEL);
|
||||||
|
|||||||
@@ -7410,7 +7410,7 @@ static void igb_vf_reset_msg(struct igb_adapter *adapter, u32 vf)
|
|||||||
{
|
{
|
||||||
struct e1000_hw *hw = &adapter->hw;
|
struct e1000_hw *hw = &adapter->hw;
|
||||||
unsigned char *vf_mac = adapter->vf_data[vf].vf_mac_addresses;
|
unsigned char *vf_mac = adapter->vf_data[vf].vf_mac_addresses;
|
||||||
u32 reg, msgbuf[3];
|
u32 reg, msgbuf[3] = {};
|
||||||
u8 *addr = (u8 *)(&msgbuf[1]);
|
u8 *addr = (u8 *)(&msgbuf[1]);
|
||||||
|
|
||||||
/* process all the same items cleared in a function level reset */
|
/* process all the same items cleared in a function level reset */
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ static __net_init int loopback_net_init(struct net *net)
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
err = -ENOMEM;
|
err = -ENOMEM;
|
||||||
dev = alloc_netdev(0, "lo", NET_NAME_UNKNOWN, loopback_setup);
|
dev = alloc_netdev(0, "lo", NET_NAME_PREDICTABLE, loopback_setup);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@
|
|||||||
#define PCI_DEVICE_ID_INTEL_ADLP 0x51ee
|
#define PCI_DEVICE_ID_INTEL_ADLP 0x51ee
|
||||||
#define PCI_DEVICE_ID_INTEL_ADLM 0x54ee
|
#define PCI_DEVICE_ID_INTEL_ADLM 0x54ee
|
||||||
#define PCI_DEVICE_ID_INTEL_ADLS 0x7ae1
|
#define PCI_DEVICE_ID_INTEL_ADLS 0x7ae1
|
||||||
#define PCI_DEVICE_ID_INTEL_RPL 0x460e
|
#define PCI_DEVICE_ID_INTEL_RPL 0xa70e
|
||||||
#define PCI_DEVICE_ID_INTEL_RPLS 0x7a61
|
#define PCI_DEVICE_ID_INTEL_RPLS 0x7a61
|
||||||
#define PCI_DEVICE_ID_INTEL_MTLP 0x7ec1
|
#define PCI_DEVICE_ID_INTEL_MTLP 0x7ec1
|
||||||
#define PCI_DEVICE_ID_INTEL_MTL 0x7e7e
|
#define PCI_DEVICE_ID_INTEL_MTL 0x7e7e
|
||||||
|
|||||||
@@ -213,8 +213,9 @@ uvc_function_ep0_complete(struct usb_ep *ep, struct usb_request *req)
|
|||||||
|
|
||||||
memset(&v4l2_event, 0, sizeof(v4l2_event));
|
memset(&v4l2_event, 0, sizeof(v4l2_event));
|
||||||
v4l2_event.type = UVC_EVENT_DATA;
|
v4l2_event.type = UVC_EVENT_DATA;
|
||||||
uvc_event->data.length = req->actual;
|
uvc_event->data.length = min_t(unsigned int, req->actual,
|
||||||
memcpy(&uvc_event->data.data, req->buf, req->actual);
|
sizeof(uvc_event->data.data));
|
||||||
|
memcpy(&uvc_event->data.data, req->buf, uvc_event->data.length);
|
||||||
v4l2_event_queue(&uvc->vdev, &v4l2_event);
|
v4l2_event_queue(&uvc->vdev, &v4l2_event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
#define PCI_DEVICE_ID_INTEL_TIGER_LAKE_XHCI 0x9a13
|
#define PCI_DEVICE_ID_INTEL_TIGER_LAKE_XHCI 0x9a13
|
||||||
#define PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI 0x1138
|
#define PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI 0x1138
|
||||||
#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI 0x51ed
|
#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI 0x51ed
|
||||||
|
#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_PCH_XHCI 0x54ed
|
||||||
|
|
||||||
#define PCI_DEVICE_ID_AMD_RENOIR_XHCI 0x1639
|
#define PCI_DEVICE_ID_AMD_RENOIR_XHCI 0x1639
|
||||||
#define PCI_DEVICE_ID_AMD_PROMONTORYA_4 0x43b9
|
#define PCI_DEVICE_ID_AMD_PROMONTORYA_4 0x43b9
|
||||||
@@ -247,7 +248,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
|
|||||||
xhci->quirks |= XHCI_MISSING_CAS;
|
xhci->quirks |= XHCI_MISSING_CAS;
|
||||||
|
|
||||||
if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
|
if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
|
||||||
pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI)
|
(pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI ||
|
||||||
|
pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_N_PCH_XHCI))
|
||||||
xhci->quirks |= XHCI_RESET_TO_DEFAULT;
|
xhci->quirks |= XHCI_RESET_TO_DEFAULT;
|
||||||
|
|
||||||
if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
|
if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
|
||||||
|
|||||||
@@ -195,6 +195,8 @@ static const struct usb_device_id id_table[] = {
|
|||||||
{ USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */
|
{ USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */
|
||||||
{ USB_DEVICE(0x17A8, 0x0001) }, /* Kamstrup Optical Eye/3-wire */
|
{ USB_DEVICE(0x17A8, 0x0001) }, /* Kamstrup Optical Eye/3-wire */
|
||||||
{ USB_DEVICE(0x17A8, 0x0005) }, /* Kamstrup M-Bus Master MultiPort 250D */
|
{ USB_DEVICE(0x17A8, 0x0005) }, /* Kamstrup M-Bus Master MultiPort 250D */
|
||||||
|
{ USB_DEVICE(0x17A8, 0x0011) }, /* Kamstrup 444 MHz RF sniffer */
|
||||||
|
{ USB_DEVICE(0x17A8, 0x0013) }, /* Kamstrup 870 MHz RF sniffer */
|
||||||
{ USB_DEVICE(0x17A8, 0x0101) }, /* Kamstrup 868 MHz wM-Bus C-Mode Meter Reader (Int Ant) */
|
{ USB_DEVICE(0x17A8, 0x0101) }, /* Kamstrup 868 MHz wM-Bus C-Mode Meter Reader (Int Ant) */
|
||||||
{ USB_DEVICE(0x17A8, 0x0102) }, /* Kamstrup 868 MHz wM-Bus C-Mode Meter Reader (Ext Ant) */
|
{ USB_DEVICE(0x17A8, 0x0102) }, /* Kamstrup 868 MHz wM-Bus C-Mode Meter Reader (Ext Ant) */
|
||||||
{ USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
|
{ USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
|
||||||
|
|||||||
@@ -130,9 +130,6 @@ static u8 const clock_table[] = { F81232_CLK_1_846_MHZ, F81232_CLK_14_77_MHZ,
|
|||||||
|
|
||||||
static int calc_baud_divisor(speed_t baudrate, speed_t clockrate)
|
static int calc_baud_divisor(speed_t baudrate, speed_t clockrate)
|
||||||
{
|
{
|
||||||
if (!baudrate)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return DIV_ROUND_CLOSEST(clockrate, baudrate);
|
return DIV_ROUND_CLOSEST(clockrate, baudrate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -519,9 +516,14 @@ static void f81232_set_baudrate(struct tty_struct *tty,
|
|||||||
speed_t baud_list[] = { baudrate, old_baudrate, F81232_DEF_BAUDRATE };
|
speed_t baud_list[] = { baudrate, old_baudrate, F81232_DEF_BAUDRATE };
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(baud_list); ++i) {
|
for (i = 0; i < ARRAY_SIZE(baud_list); ++i) {
|
||||||
idx = f81232_find_clk(baud_list[i]);
|
baudrate = baud_list[i];
|
||||||
|
if (baudrate == 0) {
|
||||||
|
tty_encode_baud_rate(tty, 0, 0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
idx = f81232_find_clk(baudrate);
|
||||||
if (idx >= 0) {
|
if (idx >= 0) {
|
||||||
baudrate = baud_list[i];
|
|
||||||
tty_encode_baud_rate(tty, baudrate, baudrate);
|
tty_encode_baud_rate(tty, baudrate, baudrate);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -536,9 +536,6 @@ static int f81534_submit_writer(struct usb_serial_port *port, gfp_t mem_flags)
|
|||||||
|
|
||||||
static u32 f81534_calc_baud_divisor(u32 baudrate, u32 clockrate)
|
static u32 f81534_calc_baud_divisor(u32 baudrate, u32 clockrate)
|
||||||
{
|
{
|
||||||
if (!baudrate)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
/* Round to nearest divisor */
|
/* Round to nearest divisor */
|
||||||
return DIV_ROUND_CLOSEST(clockrate, baudrate);
|
return DIV_ROUND_CLOSEST(clockrate, baudrate);
|
||||||
}
|
}
|
||||||
@@ -568,9 +565,14 @@ static int f81534_set_port_config(struct usb_serial_port *port,
|
|||||||
u32 baud_list[] = {baudrate, old_baudrate, F81534_DEFAULT_BAUD_RATE};
|
u32 baud_list[] = {baudrate, old_baudrate, F81534_DEFAULT_BAUD_RATE};
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(baud_list); ++i) {
|
for (i = 0; i < ARRAY_SIZE(baud_list); ++i) {
|
||||||
idx = f81534_find_clk(baud_list[i]);
|
baudrate = baud_list[i];
|
||||||
|
if (baudrate == 0) {
|
||||||
|
tty_encode_baud_rate(tty, 0, 0);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
idx = f81534_find_clk(baudrate);
|
||||||
if (idx >= 0) {
|
if (idx >= 0) {
|
||||||
baudrate = baud_list[i];
|
|
||||||
tty_encode_baud_rate(tty, baudrate, baudrate);
|
tty_encode_baud_rate(tty, baudrate, baudrate);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,6 +255,7 @@ static void option_instat_callback(struct urb *urb);
|
|||||||
#define QUECTEL_PRODUCT_EP06 0x0306
|
#define QUECTEL_PRODUCT_EP06 0x0306
|
||||||
#define QUECTEL_PRODUCT_EM05G 0x030a
|
#define QUECTEL_PRODUCT_EM05G 0x030a
|
||||||
#define QUECTEL_PRODUCT_EM060K 0x030b
|
#define QUECTEL_PRODUCT_EM060K 0x030b
|
||||||
|
#define QUECTEL_PRODUCT_EM05G_SG 0x0311
|
||||||
#define QUECTEL_PRODUCT_EM12 0x0512
|
#define QUECTEL_PRODUCT_EM12 0x0512
|
||||||
#define QUECTEL_PRODUCT_RM500Q 0x0800
|
#define QUECTEL_PRODUCT_RM500Q 0x0800
|
||||||
#define QUECTEL_PRODUCT_RM520N 0x0801
|
#define QUECTEL_PRODUCT_RM520N 0x0801
|
||||||
@@ -1160,6 +1161,8 @@ static const struct usb_device_id option_ids[] = {
|
|||||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) },
|
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) },
|
||||||
{ USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G, 0xff),
|
{ USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G, 0xff),
|
||||||
.driver_info = RSVD(6) | ZLP },
|
.driver_info = RSVD(6) | ZLP },
|
||||||
|
{ USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_SG, 0xff),
|
||||||
|
.driver_info = RSVD(6) | ZLP },
|
||||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0x00, 0x40) },
|
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0x00, 0x40) },
|
||||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x30) },
|
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x30) },
|
||||||
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x40) },
|
{ USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM060K, 0xff, 0xff, 0x40) },
|
||||||
|
|||||||
@@ -438,6 +438,12 @@ static int udf_get_block(struct inode *inode, sector_t block,
|
|||||||
iinfo->i_next_alloc_goal++;
|
iinfo->i_next_alloc_goal++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Block beyond EOF and prealloc extents? Just discard preallocation
|
||||||
|
* as it is not useful and complicates things.
|
||||||
|
*/
|
||||||
|
if (((loff_t)block) << inode->i_blkbits > iinfo->i_lenExtents)
|
||||||
|
udf_discard_prealloc(inode);
|
||||||
udf_clear_extent_cache(inode);
|
udf_clear_extent_cache(inode);
|
||||||
phys = inode_getblk(inode, block, &err, &new);
|
phys = inode_getblk(inode, block, &err, &new);
|
||||||
if (!phys)
|
if (!phys)
|
||||||
@@ -487,8 +493,6 @@ static int udf_do_extend_file(struct inode *inode,
|
|||||||
uint32_t add;
|
uint32_t add;
|
||||||
int count = 0, fake = !(last_ext->extLength & UDF_EXTENT_LENGTH_MASK);
|
int count = 0, fake = !(last_ext->extLength & UDF_EXTENT_LENGTH_MASK);
|
||||||
struct super_block *sb = inode->i_sb;
|
struct super_block *sb = inode->i_sb;
|
||||||
struct kernel_lb_addr prealloc_loc = {};
|
|
||||||
uint32_t prealloc_len = 0;
|
|
||||||
struct udf_inode_info *iinfo;
|
struct udf_inode_info *iinfo;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
@@ -509,19 +513,6 @@ static int udf_do_extend_file(struct inode *inode,
|
|||||||
~(sb->s_blocksize - 1);
|
~(sb->s_blocksize - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Last extent are just preallocated blocks? */
|
|
||||||
if ((last_ext->extLength & UDF_EXTENT_FLAG_MASK) ==
|
|
||||||
EXT_NOT_RECORDED_ALLOCATED) {
|
|
||||||
/* Save the extent so that we can reattach it to the end */
|
|
||||||
prealloc_loc = last_ext->extLocation;
|
|
||||||
prealloc_len = last_ext->extLength;
|
|
||||||
/* Mark the extent as a hole */
|
|
||||||
last_ext->extLength = EXT_NOT_RECORDED_NOT_ALLOCATED |
|
|
||||||
(last_ext->extLength & UDF_EXTENT_LENGTH_MASK);
|
|
||||||
last_ext->extLocation.logicalBlockNum = 0;
|
|
||||||
last_ext->extLocation.partitionReferenceNum = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Can we merge with the previous extent? */
|
/* Can we merge with the previous extent? */
|
||||||
if ((last_ext->extLength & UDF_EXTENT_FLAG_MASK) ==
|
if ((last_ext->extLength & UDF_EXTENT_FLAG_MASK) ==
|
||||||
EXT_NOT_RECORDED_NOT_ALLOCATED) {
|
EXT_NOT_RECORDED_NOT_ALLOCATED) {
|
||||||
@@ -549,7 +540,7 @@ static int udf_do_extend_file(struct inode *inode,
|
|||||||
* more extents, we may need to enter possible following
|
* more extents, we may need to enter possible following
|
||||||
* empty indirect extent.
|
* empty indirect extent.
|
||||||
*/
|
*/
|
||||||
if (new_block_bytes || prealloc_len)
|
if (new_block_bytes)
|
||||||
udf_next_aext(inode, last_pos, &tmploc, &tmplen, 0);
|
udf_next_aext(inode, last_pos, &tmploc, &tmplen, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -583,17 +574,6 @@ static int udf_do_extend_file(struct inode *inode,
|
|||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
/* Do we have some preallocated blocks saved? */
|
|
||||||
if (prealloc_len) {
|
|
||||||
err = udf_add_aext(inode, last_pos, &prealloc_loc,
|
|
||||||
prealloc_len, 1);
|
|
||||||
if (err)
|
|
||||||
return err;
|
|
||||||
last_ext->extLocation = prealloc_loc;
|
|
||||||
last_ext->extLength = prealloc_len;
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* last_pos should point to the last written extent... */
|
/* last_pos should point to the last written extent... */
|
||||||
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
|
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
|
||||||
last_pos->offset -= sizeof(struct short_ad);
|
last_pos->offset -= sizeof(struct short_ad);
|
||||||
@@ -609,13 +589,17 @@ out:
|
|||||||
static void udf_do_extend_final_block(struct inode *inode,
|
static void udf_do_extend_final_block(struct inode *inode,
|
||||||
struct extent_position *last_pos,
|
struct extent_position *last_pos,
|
||||||
struct kernel_long_ad *last_ext,
|
struct kernel_long_ad *last_ext,
|
||||||
uint32_t final_block_len)
|
uint32_t new_elen)
|
||||||
{
|
{
|
||||||
struct super_block *sb = inode->i_sb;
|
|
||||||
uint32_t added_bytes;
|
uint32_t added_bytes;
|
||||||
|
|
||||||
added_bytes = final_block_len -
|
/*
|
||||||
(last_ext->extLength & (sb->s_blocksize - 1));
|
* Extent already large enough? It may be already rounded up to block
|
||||||
|
* size...
|
||||||
|
*/
|
||||||
|
if (new_elen <= (last_ext->extLength & UDF_EXTENT_LENGTH_MASK))
|
||||||
|
return;
|
||||||
|
added_bytes = (last_ext->extLength & UDF_EXTENT_LENGTH_MASK) - new_elen;
|
||||||
last_ext->extLength += added_bytes;
|
last_ext->extLength += added_bytes;
|
||||||
UDF_I(inode)->i_lenExtents += added_bytes;
|
UDF_I(inode)->i_lenExtents += added_bytes;
|
||||||
|
|
||||||
@@ -632,12 +616,12 @@ static int udf_extend_file(struct inode *inode, loff_t newsize)
|
|||||||
int8_t etype;
|
int8_t etype;
|
||||||
struct super_block *sb = inode->i_sb;
|
struct super_block *sb = inode->i_sb;
|
||||||
sector_t first_block = newsize >> sb->s_blocksize_bits, offset;
|
sector_t first_block = newsize >> sb->s_blocksize_bits, offset;
|
||||||
unsigned long partial_final_block;
|
loff_t new_elen;
|
||||||
int adsize;
|
int adsize;
|
||||||
struct udf_inode_info *iinfo = UDF_I(inode);
|
struct udf_inode_info *iinfo = UDF_I(inode);
|
||||||
struct kernel_long_ad extent;
|
struct kernel_long_ad extent;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
int within_final_block;
|
bool within_last_ext;
|
||||||
|
|
||||||
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
|
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
|
||||||
adsize = sizeof(struct short_ad);
|
adsize = sizeof(struct short_ad);
|
||||||
@@ -646,8 +630,17 @@ static int udf_extend_file(struct inode *inode, loff_t newsize)
|
|||||||
else
|
else
|
||||||
BUG();
|
BUG();
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When creating hole in file, just don't bother with preserving
|
||||||
|
* preallocation. It likely won't be very useful anyway.
|
||||||
|
*/
|
||||||
|
udf_discard_prealloc(inode);
|
||||||
|
|
||||||
etype = inode_bmap(inode, first_block, &epos, &eloc, &elen, &offset);
|
etype = inode_bmap(inode, first_block, &epos, &eloc, &elen, &offset);
|
||||||
within_final_block = (etype != -1);
|
within_last_ext = (etype != -1);
|
||||||
|
/* We don't expect extents past EOF... */
|
||||||
|
WARN_ON_ONCE(within_last_ext &&
|
||||||
|
elen > ((loff_t)offset + 1) << inode->i_blkbits);
|
||||||
|
|
||||||
if ((!epos.bh && epos.offset == udf_file_entry_alloc_offset(inode)) ||
|
if ((!epos.bh && epos.offset == udf_file_entry_alloc_offset(inode)) ||
|
||||||
(epos.bh && epos.offset == sizeof(struct allocExtDesc))) {
|
(epos.bh && epos.offset == sizeof(struct allocExtDesc))) {
|
||||||
@@ -663,19 +656,17 @@ static int udf_extend_file(struct inode *inode, loff_t newsize)
|
|||||||
extent.extLength |= etype << 30;
|
extent.extLength |= etype << 30;
|
||||||
}
|
}
|
||||||
|
|
||||||
partial_final_block = newsize & (sb->s_blocksize - 1);
|
new_elen = ((loff_t)offset << inode->i_blkbits) |
|
||||||
|
(newsize & (sb->s_blocksize - 1));
|
||||||
|
|
||||||
/* File has extent covering the new size (could happen when extending
|
/* File has extent covering the new size (could happen when extending
|
||||||
* inside a block)?
|
* inside a block)?
|
||||||
*/
|
*/
|
||||||
if (within_final_block) {
|
if (within_last_ext) {
|
||||||
/* Extending file within the last file block */
|
/* Extending file within the last file block */
|
||||||
udf_do_extend_final_block(inode, &epos, &extent,
|
udf_do_extend_final_block(inode, &epos, &extent, new_elen);
|
||||||
partial_final_block);
|
|
||||||
} else {
|
} else {
|
||||||
loff_t add = ((loff_t)offset << sb->s_blocksize_bits) |
|
err = udf_do_extend_file(inode, &epos, &extent, new_elen);
|
||||||
partial_final_block;
|
|
||||||
err = udf_do_extend_file(inode, &epos, &extent, add);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
@@ -776,10 +767,11 @@ static sector_t inode_getblk(struct inode *inode, sector_t block,
|
|||||||
goto out_free;
|
goto out_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Are we beyond EOF? */
|
/* Are we beyond EOF and preallocated extent? */
|
||||||
if (etype == -1) {
|
if (etype == -1) {
|
||||||
int ret;
|
int ret;
|
||||||
loff_t hole_len;
|
loff_t hole_len;
|
||||||
|
|
||||||
isBeyondEOF = true;
|
isBeyondEOF = true;
|
||||||
if (count) {
|
if (count) {
|
||||||
if (c)
|
if (c)
|
||||||
|
|||||||
@@ -120,60 +120,42 @@ void udf_truncate_tail_extent(struct inode *inode)
|
|||||||
|
|
||||||
void udf_discard_prealloc(struct inode *inode)
|
void udf_discard_prealloc(struct inode *inode)
|
||||||
{
|
{
|
||||||
struct extent_position epos = { NULL, 0, {0, 0} };
|
struct extent_position epos = {};
|
||||||
|
struct extent_position prev_epos = {};
|
||||||
struct kernel_lb_addr eloc;
|
struct kernel_lb_addr eloc;
|
||||||
uint32_t elen;
|
uint32_t elen;
|
||||||
uint64_t lbcount = 0;
|
uint64_t lbcount = 0;
|
||||||
int8_t etype = -1, netype;
|
int8_t etype = -1, netype;
|
||||||
int adsize;
|
|
||||||
struct udf_inode_info *iinfo = UDF_I(inode);
|
struct udf_inode_info *iinfo = UDF_I(inode);
|
||||||
|
int bsize = 1 << inode->i_blkbits;
|
||||||
|
|
||||||
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB ||
|
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB ||
|
||||||
inode->i_size == iinfo->i_lenExtents)
|
ALIGN(inode->i_size, bsize) == ALIGN(iinfo->i_lenExtents, bsize))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
|
|
||||||
adsize = sizeof(struct short_ad);
|
|
||||||
else if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_LONG)
|
|
||||||
adsize = sizeof(struct long_ad);
|
|
||||||
else
|
|
||||||
adsize = 0;
|
|
||||||
|
|
||||||
epos.block = iinfo->i_location;
|
epos.block = iinfo->i_location;
|
||||||
|
|
||||||
/* Find the last extent in the file */
|
/* Find the last extent in the file */
|
||||||
while ((netype = udf_next_aext(inode, &epos, &eloc, &elen, 1)) != -1) {
|
while ((netype = udf_next_aext(inode, &epos, &eloc, &elen, 0)) != -1) {
|
||||||
etype = netype;
|
brelse(prev_epos.bh);
|
||||||
|
prev_epos = epos;
|
||||||
|
if (prev_epos.bh)
|
||||||
|
get_bh(prev_epos.bh);
|
||||||
|
|
||||||
|
etype = udf_next_aext(inode, &epos, &eloc, &elen, 1);
|
||||||
lbcount += elen;
|
lbcount += elen;
|
||||||
}
|
}
|
||||||
if (etype == (EXT_NOT_RECORDED_ALLOCATED >> 30)) {
|
if (etype == (EXT_NOT_RECORDED_ALLOCATED >> 30)) {
|
||||||
epos.offset -= adsize;
|
|
||||||
lbcount -= elen;
|
lbcount -= elen;
|
||||||
extent_trunc(inode, &epos, &eloc, etype, elen, 0);
|
udf_delete_aext(inode, prev_epos);
|
||||||
if (!epos.bh) {
|
udf_free_blocks(inode->i_sb, inode, &eloc, 0,
|
||||||
iinfo->i_lenAlloc =
|
DIV_ROUND_UP(elen, 1 << inode->i_blkbits));
|
||||||
epos.offset -
|
|
||||||
udf_file_entry_alloc_offset(inode);
|
|
||||||
mark_inode_dirty(inode);
|
|
||||||
} else {
|
|
||||||
struct allocExtDesc *aed =
|
|
||||||
(struct allocExtDesc *)(epos.bh->b_data);
|
|
||||||
aed->lengthAllocDescs =
|
|
||||||
cpu_to_le32(epos.offset -
|
|
||||||
sizeof(struct allocExtDesc));
|
|
||||||
if (!UDF_QUERY_FLAG(inode->i_sb, UDF_FLAG_STRICT) ||
|
|
||||||
UDF_SB(inode->i_sb)->s_udfrev >= 0x0201)
|
|
||||||
udf_update_tag(epos.bh->b_data, epos.offset);
|
|
||||||
else
|
|
||||||
udf_update_tag(epos.bh->b_data,
|
|
||||||
sizeof(struct allocExtDesc));
|
|
||||||
mark_buffer_dirty_inode(epos.bh, inode);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/* This inode entry is in-memory only and thus we don't have to mark
|
/* This inode entry is in-memory only and thus we don't have to mark
|
||||||
* the inode dirty */
|
* the inode dirty */
|
||||||
iinfo->i_lenExtents = lbcount;
|
iinfo->i_lenExtents = lbcount;
|
||||||
brelse(epos.bh);
|
brelse(epos.bh);
|
||||||
|
brelse(prev_epos.bh);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void udf_update_alloc_ext_desc(struct inode *inode,
|
static void udf_update_alloc_ext_desc(struct inode *inode,
|
||||||
|
|||||||
@@ -4453,7 +4453,8 @@ static inline int l2cap_config_req(struct l2cap_conn *conn,
|
|||||||
|
|
||||||
chan->ident = cmd->ident;
|
chan->ident = cmd->ident;
|
||||||
l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP, len, rsp);
|
l2cap_send_cmd(conn, cmd->ident, L2CAP_CONF_RSP, len, rsp);
|
||||||
chan->num_conf_rsp++;
|
if (chan->num_conf_rsp < L2CAP_CONF_MAX_CONF_RSP)
|
||||||
|
chan->num_conf_rsp++;
|
||||||
|
|
||||||
/* Reset config buffer. */
|
/* Reset config buffer. */
|
||||||
chan->conf_len = 0;
|
chan->conf_len = 0;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ DEV="eth0"
|
|||||||
# This is determined by reading the RSS indirection table using ethtool.
|
# This is determined by reading the RSS indirection table using ethtool.
|
||||||
get_rss_cfg_num_rxqs() {
|
get_rss_cfg_num_rxqs() {
|
||||||
echo $(ethtool -x "${DEV}" |
|
echo $(ethtool -x "${DEV}" |
|
||||||
egrep [[:space:]]+[0-9]+:[[:space:]]+ |
|
grep -E [[:space:]]+[0-9]+:[[:space:]]+ |
|
||||||
cut -d: -f2- |
|
cut -d: -f2- |
|
||||||
awk '{$1=$1};1' |
|
awk '{$1=$1};1' |
|
||||||
tr ' ' '\n' |
|
tr ' ' '\n' |
|
||||||
|
|||||||
Reference in New Issue
Block a user