id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
6ac7ef1487a040483d89a95045efc5185a71268f
Analyze and fix the following issue in the Linux kernel code: sfc: Fix the reported priorities of different filter types
Problem Details: Each RX filter table contains filters with two different levels of specificity: TCP/IPv4 and UDP/IPv4 filters match the local address and port and optionally the remote address and port; Ethernet filters match the local address and optionally the VID. The more specific filters always override less spe...
```diff diff --git a/drivers/net/ethernet/sfc/filter.c b/drivers/net/ethernet/sfc/filter.c index e89bad78312e..8af42cd1feda 100644 --- a/drivers/net/ethernet/sfc/filter.c +++ b/drivers/net/ethernet/sfc/filter.c @@ -557,26 +557,62 @@ static int efx_filter_search(struct efx_filter_table *table, } /* - * Construct/dec...
1ac0226eb04e56cacee080fb71938eb50b5245eb
Analyze and fix the following issue in the Linux kernel code: sfc: Fix loopback self-test with separate_tx_channels=1
Problem Details: The loopback self-test iterates over all the TX queues of channel 0, which is not very interesting when that's an RX-only channel. Signed-off-by: Ben Hutchings <bhutchings@solarflre.com>
```diff diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c index 9df556c01b8e..cf772074145a 100644 --- a/drivers/net/ethernet/sfc/ethtool.c +++ b/drivers/net/ethernet/sfc/ethtool.c @@ -337,7 +337,8 @@ static int efx_fill_loopback_test(struct efx_nic *efx, unsigned int test_index...
0a6e5008a9df678b48f8d4e57601aa4270df6c14
Analyze and fix the following issue in the Linux kernel code: sfc: Fix MCDI structure field lookup
Problem Details: The least significant bit number (LBN) of a field within an MCDI structure is counted from the start of the structure, not the containing dword. In MCDI_ARRAY_FIELD() we need to mask it rather than using the usual EFX_DWORD_FIELD() macro. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
```diff diff --git a/drivers/net/ethernet/sfc/mcdi.h b/drivers/net/ethernet/sfc/mcdi.h index dc25caaa3983..3ba2e5b5a9cc 100644 --- a/drivers/net/ethernet/sfc/mcdi.h +++ b/drivers/net/ethernet/sfc/mcdi.h @@ -113,11 +113,13 @@ extern void efx_mcdi_sensor_event(struct efx_nic *efx, efx_qword_t *ev); #define MCDI_EVENT_FI...
726ba0e14a7915effee9e8e652a37306d9637d13
Analyze and fix the following issue in the Linux kernel code: sfc: Fix null function pointer in efx_sriov_channel_type
Problem Details: Commit c31e5f9 ('sfc: Add channel specific receive_skb handler and post_remove callback') added the function pointer field efx_channel_type::post_remove and an unconditional call through it. This field should have been initialised to efx_channel_dummy_op_void in the existing instances of efx_channel_t...
```diff diff --git a/drivers/net/ethernet/sfc/siena_sriov.c b/drivers/net/ethernet/sfc/siena_sriov.c index a8f48a455849..d49b53dc2a50 100644 --- a/drivers/net/ethernet/sfc/siena_sriov.c +++ b/drivers/net/ethernet/sfc/siena_sriov.c @@ -1035,6 +1035,7 @@ efx_sriov_get_channel_name(struct efx_channel *channel, char *buf, ...
f9d640f3a4f043f7dff66ad7bd8cb29ec145c41d
Analyze and fix the following issue in the Linux kernel code: NFSv4: nfs4_match_clientids is only used by NFSv4.1
Problem Details: Fix another compiler warning. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index 14ddd4d30966..8466e6046ff5 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c @@ -251,21 +251,6 @@ error: return ERR_PTR(error); } -/* - * Returns true if the client IDs match - */ -static bool nfs4_match_clientids(struct nfs_client *a, s...
758201e2c94b7d26ea0ac64e55cab1d53742780a
Analyze and fix the following issue in the Linux kernel code: NFSv4: Fix the minor version callback channel startup
Problem Details: The current spaghetti code confuses some versions of gcc (and just looks ugly as hell)! Clean up... Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index 8ed0bc8cffb6..2245bef50f37 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c @@ -12,6 +12,7 @@ #include <linux/sunrpc/svc.h> #include <linux/sunrpc/svcsock.h> #include <linux/nfs_fs.h> +#include <linux/errno.h> #include <linux/mutex.h> #include ...
3184009c36da413724f283e3c7ac9cc60c623bc4
Analyze and fix the following issue in the Linux kernel code: drm: Destroy the planes prior to destroying the associated CRTC
Problem Details: As during the plane cleanup, we wish to disable the hardware and so may modify state on the associated CRTC, that CRTC must continue to exist until we are finished. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54101 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Jesse Barnes <jba...
```diff diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index c317f721a8d3..c418c772a7e5 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -1034,15 +1034,15 @@ void drm_mode_config_cleanup(struct drm_device *dev) fb->funcs->destroy(fb); } - list_for_each_entry_safe(...
27796b465d25bc48f785c235be33cdc334a624e6
Analyze and fix the following issue in the Linux kernel code: drm/udl: Add missing static storage class specifiers in udl_fb.c
Problem Details: Fixes the following sparse warnings: drivers/gpu/drm/udl/udl_fb.c:360:6: warning: symbol 'udl_crtc_fb_gamma_set' was not declared. Should it be static? drivers/gpu/drm/udl/udl_fb.c:365:6: warning: symbol 'udl_crtc_fb_gamma_get' was not declared. Should it be static? Signed-off-by: Sachin Kamat <sachin...
```diff diff --git a/drivers/gpu/drm/udl/udl_fb.c b/drivers/gpu/drm/udl/udl_fb.c index b8c00ed33051..0e47e9614b78 100644 --- a/drivers/gpu/drm/udl/udl_fb.c +++ b/drivers/gpu/drm/udl/udl_fb.c @@ -357,12 +357,12 @@ static struct fb_ops udlfb_ops = { .fb_release = udl_fb_release, }; -void udl_crtc_fb_gamma_set(struct...
8d42a919156cfcfdd19addbc4c2989fc46810c1c
Analyze and fix the following issue in the Linux kernel code: drm/udl: Make udl_crtc_init() static
Problem Details: Fixes the following sparse warning: drivers/gpu/drm/udl/udl_modeset.c:394:5: warning: symbol 'udl_crtc_init' was not declared. Should it be static? Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c index 9159d48d1dfd..8f258158c1fe 100644 --- a/drivers/gpu/drm/udl/udl_modeset.c +++ b/drivers/gpu/drm/udl/udl_modeset.c @@ -391,7 +391,7 @@ static const struct drm_crtc_funcs udl_crtc_funcs = { .destroy = udl_crtc_destroy, }; ...
92780062496e8454a43b47af1994f83462580ec5
Analyze and fix the following issue in the Linux kernel code: drm/udl: Make udl_enc_destroy() static
Problem Details: Fixes the following sparse warning: drivers/gpu/drm/udl/udl_encoder.c:19:6: warning: symbol 'udl_enc_destroy' was not declared. Should it be static? Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
```diff diff --git a/drivers/gpu/drm/udl/udl_encoder.c b/drivers/gpu/drm/udl/udl_encoder.c index 0731ab2e6c06..0476bfe06d14 100644 --- a/drivers/gpu/drm/udl/udl_encoder.c +++ b/drivers/gpu/drm/udl/udl_encoder.c @@ -16,7 +16,7 @@ #include "udl_drv.h" /* dummy encoder */ -void udl_enc_destroy(struct drm_encoder *enco...
74401b1dd320c419f8444d0a45daba5b42a9b7e9
Analyze and fix the following issue in the Linux kernel code: drm/udl: Use NULL instead of 0 for pointers
Problem Details: Fixes the following sparse warnings: drivers/gpu/drm/udl/udl_transfer.c:129:50: drivers/gpu/drm/udl/udl_transfer.c:130:50: drivers/gpu/drm/udl/udl_transfer.c:131:45: drivers/gpu/drm/udl/udl_transfer.c:132:61: warning: Using plain integer as NULL pointer Signed-off-by: Sachin Kamat <sachin.kamat@linaro...
```diff diff --git a/drivers/gpu/drm/udl/udl_transfer.c b/drivers/gpu/drm/udl/udl_transfer.c index b9320e2608dd..f9fff657a90b 100644 --- a/drivers/gpu/drm/udl/udl_transfer.c +++ b/drivers/gpu/drm/udl/udl_transfer.c @@ -126,10 +126,10 @@ static void udl_compress_hline16( while ((pixel_end > pixel) && (cmd_b...
9f62387d6e26532bcbfb15606956074192ee526a
Analyze and fix the following issue in the Linux kernel code: NFSv4: Fix up a merge conflict between migration and container changes
Problem Details: nfs_callback_tcpport is now per-net_namespace. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 5c4286643701..3da8130d4460 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -121,12 +121,13 @@ int nfs40_discover_server_trunking(struct nfs_client *clp, .clientid = clp->cl_clientid, .confirm = clp->cl_confirm, }; + struct nfs_net *n...
96c9eae638765c2bf2ca4f5a6325484f9bb69aa7
Analyze and fix the following issue in the Linux kernel code: pnfsblock: fix non-aligned DIO write
Problem Details: For DIO writes, if it is not blocksize aligned, we need to do internal serialization. It may slow down writers anyway. So we just bail them out and resend to MDS. Cc: stable <stable@vger.kernel.org> [since v3.4] Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Trond Myklebust <Trond.Myklebust...
```diff diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index 61e04fb7c4b8..af3ef0e68491 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c @@ -685,7 +685,7 @@ bl_write_pagelist(struct nfs_write_data *wdata, int sync) struct bio *bio = NULL; struct ...
f742dc4a32587bff50b13dde9d8894b96851951a
Analyze and fix the following issue in the Linux kernel code: pnfsblock: fix non-aligned DIO read
Problem Details: For DIO read, if it is not sector aligned, we should reject it and resend via MDS. Otherwise there might be data corruption. Also teach bl_read_pagelist to handle partial page reads for DIO. Cc: stable <stable@vger.kernel.org> [since v3.4] Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Tron...
```diff diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index a9fe644a12d1..61e04fb7c4b8 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c @@ -252,8 +252,11 @@ bl_read_pagelist(struct nfs_read_data *rdata) sector_t isect, extent_length = 0; struct ...
fe6e1e8d9fad86873eb74a26e80a8f91f9e870b5
Analyze and fix the following issue in the Linux kernel code: pnfsblock: fix partial page buffer wirte
Problem Details: If applications use flock to protect its write range, generic NFS will not do read-modify-write cycle at page cache level. Therefore LD should know how to handle non-sector aligned writes. Otherwise there will be data corruption. Cc: stable <stable@vger.kernel.org> Signed-off-by: Peng Tao <tao.peng@em...
```diff diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index 3c61514599a5..a9fe644a12d1 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c @@ -162,25 +162,39 @@ static struct bio *bl_alloc_init_bio(int npg, sector_t isect, return bio; } -static st...
5d0e3a004f02bffab51f542fa1d5b2e2854d8545
Analyze and fix the following issue in the Linux kernel code: Revert "pnfsblock: bail out partial page IO"
Problem Details: This reverts commit 159e0561e322dd8008fff59e36efff8d2bdd0b0e, in favor of a more complete fix to the alignment issue. Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c index 329bfbfed37d..3c61514599a5 100644 --- a/fs/nfs/blocklayout/blocklayout.c +++ b/fs/nfs/blocklayout/blocklayout.c @@ -228,14 +228,6 @@ bl_end_par_io_read(void *data, int unused) schedule_work(&rdata->task.u.tk_work); } -st...
dc182549d439f60c332bf74d7f220a1bccf37da6
Analyze and fix the following issue in the Linux kernel code: NFS41: fix error of setting blocklayoutdriver
Problem Details: After commit e38eb650 (NFS: set_pnfs_layoutdriver() from nfs4_proc_fsinfo()), set_pnfs_layoutdriver() is called inside nfs4_proc_fsinfo(), but pnfs_blksize is not set. It causes setting blocklayoutdriver failure and pnfsblock mount failure. Cc: stable <stable@vger.kernel.org> [since v3.5] Signed-off-b...
```diff diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 57d2a5c3d933..bab3e8af574a 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -849,7 +849,6 @@ static void nfs_server_set_fsinfo(struct nfs_server *server, if (server->wsize > NFS_MAX_FILE_IO_SIZE) server->wsize = NFS_MAX_FILE_IO_SIZE; server->wpage...
7acdb026818455638543b04b68d4a580c367fba8
Analyze and fix the following issue in the Linux kernel code: NFSv41: fix DIO write_io calculation
Problem Details: pnfs_within_mdsthreshold() is called inside pg_init. We need to set read_io/write_io before that. Otherwise we fail pnfs_within_mdsthreshold() and IO goes to MDS. A simple test case: dd if=foo of=/mnt/pnfs/bar bs=10M count=1 oflag=direct Signed-off-by: Peng Tao <tao.peng@emc.com> Signed-off-by: Trond ...
```diff diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 22130df16218..253d397780b1 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c @@ -467,10 +467,10 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, const struct iovec *iov, if (!is_sync_kiocb(iocb)) dreq->iocb = iocb; + NFS_I(inode)->read_io += iov_...
ba9b584c1dc37851d9c6ca6d0d2ccba55d9aad04
Analyze and fix the following issue in the Linux kernel code: SUNRPC: Introduce rpc_clone_client_set_auth()
Problem Details: An ULP is supposed to be able to replace a GSS rpc_auth object with another GSS rpc_auth object using rpcauth_create(). However, rpcauth_create() in 3.5 reliably fails with -EEXIST in this case. This is because when gss_create() attempts to create the upcall pipes, sometimes they are already there. F...
```diff diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 99694442b93f..143149db3440 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -668,7 +668,8 @@ int nfs_init_server_rpcclient(struct nfs_server *server, { struct nfs_client *clp = server->nfs_client; - server->client = rpc_clone_client(clp->cl_rpcclien...
eb2c27a02bcf6013cda5d9e6277d50f7b4cfc13d
Analyze and fix the following issue in the Linux kernel code: drm/radeon: fix radeon power state debug output
Problem Details: Driver used to print "default" as the state type regardless of whether it is the default state. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
```diff diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index e024435a856c..8d64138b95f3 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c @@ -33,7 +33,7 @@ #define RADEON_WAIT_VBLANK_TIMEOUT 200 static const char *radeon_pm_state_type_name...
1dc42e04b75779d321f1d17dca3873004066f667
Analyze and fix the following issue in the Linux kernel code: NFS: add debug messages to callback down function
Problem Details: Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
```diff diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index 6dfdc8311f27..8ed0bc8cffb6 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c @@ -410,7 +410,9 @@ void nfs_callback_down(int minorversion, struct net *net) cb_info->users--; if (cb_info->users == 0 && cb_info->task != NULL) { kthread_stop(cb_in...
6cae3717cddaf8e5e96e304733dca66e40d56f89
Analyze and fix the following issue in the Linux kernel code: rbd: BUG on invalid layout
Problem Details: This shouldn't actually be possible because the layout struct is constructed from the RBD header and validated then. [elder@inktank.com: converted BUG() call to equivalent rbd_assert()] Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Alex Elder <elder@inktank.com>
```diff diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 2f1bef8c1d88..bb3d9be3b1b4 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1020,8 +1020,9 @@ static int rbd_do_request(struct request *rq, layout->fl_stripe_count = cpu_to_le32(1); layout->fl_object_size = cpu_to_le32(1 << RBD_MAX_O...
6938867edba929a65a167a97581231e76aeb10b4
Analyze and fix the following issue in the Linux kernel code: NFS: Remove bad delegations during open recovery
Problem Details: I put the client into an open recovery loop by: Client: Open file read half Server: Expire client (echo 0 > /sys/kernel/debug/nfsd/forget_clients) Client: Drop vm cache (echo 3 > /proc/sys/vm/drop_caches) finish reading file This causes a loop because the client never updates the nfs4_state aft...
```diff diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 755ee162ee7e..471a75f11ea2 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -1774,7 +1774,11 @@ static void nfs41_clear_delegation_stateid(struct nfs4_state *state) * informs us the stateid is unrecognized. */ if (status != -NFS4ERR_BAD_ST...
de0a41484c47d783dd4d442914815076aa2caac2
Analyze and fix the following issue in the Linux kernel code: tg3: unconditionally select HWMON support when tg3 is enabled.
Problem Details: There is the seldom used corner case where HWMON=m at the same time as TIGON3=y (typically randconfigs) which will cause a link fail like: drivers/built-in.o: In function `tg3_close': tg3.c:(.text+0x16bd86): undefined reference to `hwmon_device_unregister' drivers/built-in.o: In function `tg3_hwmon_op...
```diff diff --git a/drivers/net/ethernet/broadcom/Kconfig b/drivers/net/ethernet/broadcom/Kconfig index f15e72e81ac4..4bd416b72e65 100644 --- a/drivers/net/ethernet/broadcom/Kconfig +++ b/drivers/net/ethernet/broadcom/Kconfig @@ -101,6 +101,7 @@ config TIGON3 tristate "Broadcom Tigon3 support" depends on PCI sel...
68eb35081e297b37db49d854cda144c6a3397699
Analyze and fix the following issue in the Linux kernel code: nfsd4: don't pin clientids to pseudoflavors
Problem Details: I added cr_flavor to the data compared in same_creds without any justification, in d5497fc693a446ce9100fcf4117c3f795ddfd0d2 "nfsd4: move rq_flavor into svc_cred". Recent client changes then started making mount -osec=krb5 server:/export /mnt/ echo "hello" >/mnt/TMP umount /mnt/ mount -osec=krb5i ...
```diff diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 5122e1704cd4..0f8d7e7922eb 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1223,10 +1223,26 @@ static bool groups_equal(struct group_info *g1, struct group_info *g2) return true; } +/* + * RFC 3530 language requires clid_inuse be r...
9fbef059d63cbc3249a3ddfd9a12cb511c8be55e
Analyze and fix the following issue in the Linux kernel code: gre: fix sparse warning
Problem Details: Use be16 consistently when looking at flags. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
```diff diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index b1871d993d22..7240f8e2dd45 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -222,7 +222,7 @@ static struct rtnl_link_stats64 *ipgre_get_stats64(struct net_device *dev, /* Does key in tunnel parameters match packet */ static bool ipgre_key_mat...
4f72e5f00dea3eca9139a23cf70fbf18d62fd1db
Analyze and fix the following issue in the Linux kernel code: flexcan: disable bus error interrupts for the i.MX28
Problem Details: Due to a bug in most Flexcan cores, the bus error interrupt needs to be enabled. Otherwise we don't get any error warning or passive interrupts. This is _not_ necessary for the i.MX28 and this patch disables bus error interrupts if "berr-reporting" is not requested. This avoids bus error flooding, whic...
```diff diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index c5f143165f80..c78ecfca1e45 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c @@ -144,6 +144,10 @@ #define FLEXCAN_MB_CODE_MASK (0xf0ffffff) +/* FLEXCAN hardware feature flags */ +#define FLEXCAN_HAS_V10_FEATURES ...
64c6d08e6490fb18cea09bb03686c149946bd818
Analyze and fix the following issue in the Linux kernel code: ipv6: del unreachable route when an addr is deleted on lo
Problem Details: When an address is added on loopback (ip -6 a a 2002::1/128 dev lo), two routes are added: - one in the local table: local 2002::1 via :: dev lo proto none metric 0 - one the in main table (for the prefix): unreachable 2002::1 dev lo proto kernel metric 256 error -101 When the address i...
```diff diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 719a828fb67f..480e68422efb 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c @@ -788,10 +788,16 @@ static void ipv6_del_addr(struct inet6_ifaddr *ifp) struct in6_addr prefix; struct rt6_info *rt; struct net *net = dev_net(ifp->idev->...
2f6a02604e962295569749913081365ec9ec1372
Analyze and fix the following issue in the Linux kernel code: be2net: fix vfs enumeration
Problem Details: Current VFs enumeration algorithm used in be_find_vfs does not take domain number into the match. The match found in igb/ixgbe is more elegant and safe. This 2nd version uses pci_physfn instead of checking dev->physfn directly. Signed-off-by: Ivan Vecera <ivecera@redhat.com> Signed-off-by: David S. M...
```diff diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 6accb0c0273a..8dd42b309f38 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c @@ -1075,7 +1075,7 @@ static int be_set_vf_tx_rate(struct net_device ...
bfd063cebb75d3305089e9eeedbd25469d3dc1e6
Analyze and fix the following issue in the Linux kernel code: [media] ivtv: fix format enumeration: don't show invalid formats
Problem Details: Depending on the device node only the compressed or the uncompressed format should be shown, not both. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c index 3b32518dbc02..949ae230e119 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c @@ -928,51 +928,53 @@ static int ivtv_g_crop(struct file *file, void *fh, struct v4l2_crop *crop) ...
c5c46f26591e2c77fa9b78fac202db90428762b0
Analyze and fix the following issue in the Linux kernel code: [media] ivtv: fix incorrect service_set for the decoder VBI capture
Problem Details: Found with v4l2-compliance. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c index 5537c8842075..3b32518dbc02 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c @@ -398,6 +398,7 @@ static int ivtv_g_fmt_sliced_vbi_cap(struct file *file, void *fh, struct v4l2_fo ...
7eaf49667e23a11a1f6ec88dad51ad0e93b1445d
Analyze and fix the following issue in the Linux kernel code: [media] ivtv: fix v4l2-compliance errors for the radio device
Problem Details: - fix error code when attempting to read from write-only streams. - fix error code when attempting to write to read-only streams. - don't start capturing when polling on a radio node. - give the radio node its own file operations struct. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-...
```diff diff --git a/drivers/media/pci/ivtv/ivtv-fileops.c b/drivers/media/pci/ivtv/ivtv-fileops.c index 7f2eb5f62fd1..9caffd8aa995 100644 --- a/drivers/media/pci/ivtv/ivtv-fileops.c +++ b/drivers/media/pci/ivtv/ivtv-fileops.c @@ -435,7 +435,7 @@ int ivtv_start_capture(struct ivtv_open_id *id) s->type == IVTV_DEC...
f659f0e7a66245295e1930ad21dfabf80c1403bf
Analyze and fix the following issue in the Linux kernel code: [media] ivtv: fix v4l2-compliance error: inconsistent std reporting
Problem Details: The tuner input has a different standard mask than a S-Video or Composite input. Changing the standard should change tvnorms as well for all device nodes. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c index 0b0250a7583f..e5ce970266f3 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c @@ -987,6 +987,8 @@ static int ivtv_g_input(struct file *file, void *fh, unsigned int *i) int ivtv_s...
1a806401656129e5fed10da24973e59e9f1d2e88
Analyze and fix the following issue in the Linux kernel code: [media] ivtv: DECODER_CMD v4l2-compliance fixes
Problem Details: VIDIOC_DECODER_CMD didn't return EPERM when calling PAUSE or RESUME if no decoding is in progress. VIDIOC_G_ENC_INDEX didn't set entries_cap or return 0 if no decoding was in progress. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c index 4e40c4e301ed..0b0250a7583f 100644 --- a/drivers/media/pci/ivtv/ivtv-ioctl.c +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c @@ -289,6 +289,8 @@ static int ivtv_video_command(struct ivtv *itv, struct ivtv_open_id *id, case V...
9dc72160d13c6fdeec57f5c6017588812c4294b6
Analyze and fix the following issue in the Linux kernel code: [media] fc2580: use macro for 64 bit division and reminder
Problem Details: Fixes the following warnings on a 32 bit system with GCC 4.4.3 and kernel Ubuntu 2.6.32-43 32 bit: WARNING: "__udivdi3" [fc2580.ko] undefined! WARNING: "__umoddi3" [fc2580.ko] undefined! Signed-off-by: Gianluca Gennari <gennarone@gmail.com> Reviewed-by: Antti Palosaari <crope@iki.fi> Signed-off-by: An...
```diff diff --git a/drivers/media/tuners/fc2580.c b/drivers/media/tuners/fc2580.c index dacf85578c4b..aff39ae457a0 100644 --- a/drivers/media/tuners/fc2580.c +++ b/drivers/media/tuners/fc2580.c @@ -168,8 +168,7 @@ static int fc2580_set_params(struct dvb_frontend *fe) } f_ref = 2UL * priv->cfg->clock / r_val; - n...
0c42a55c86228ba9d0969562fcebc2adc79bfddb
Analyze and fix the following issue in the Linux kernel code: [media] em28xx: do not set PCTV 290e LNA handler if fe attach fail
Problem Details: It was a bug that could cause oops if demodulator attach was failed. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c index 0ca3e05992bf..1662b70435b3 100644 --- a/drivers/media/usb/em28xx/em28xx-dvb.c +++ b/drivers/media/usb/em28xx/em28xx-dvb.c @@ -1002,20 +1002,22 @@ static int em28xx_dvb_init(struct em28xx *dev) result = -EINVAL;...
3e8f43a089f06279c5f76a9ccd42578eebf7bfa5
Analyze and fix the following issue in the Linux kernel code: ceph: Fix oops when handling mdsmap that decreases max_mds
Problem Details: When i >= newmap->m_max_mds, ceph_mdsmap_get_addr(newmap, i) return NULL. Passing NULL to memcmp() triggers oops. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com> Signed-off-by: Sage Weil <sage@inktank.com>
```diff diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index a5a735422aa7..1bcf712655d9 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -2625,7 +2625,8 @@ static void check_new_map(struct ceph_mds_client *mdsc, ceph_mdsmap_is_laggy(newmap, i) ? " (laggy)" : "", session_state_na...
1e1301998ee80d9a8cc09297906293f16f8a6064
Analyze and fix the following issue in the Linux kernel code: rbd: get the object prefix for a v2 rbd image
Problem Details: The object prefix of an rbd format 2 image is fetched from the server using a "get_object_prefix" method. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
```diff diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 061c62496fea..64a4dd5f6f2b 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -66,7 +66,8 @@ #define RBD_SNAP_HEAD_NAME "-" -#define RBD_IMAGE_ID_LEN_MAX 64 +#define RBD_IMAGE_ID_LEN_MAX 64 +#define RBD_OBJ_PREFIX_LEN_MAX 64 /* * ...
f8d4de6e1c939d56f1ee0a21ad677401846f990c
Analyze and fix the following issue in the Linux kernel code: rbd: support data returned from OSD methods
Problem Details: An OSD object method call can be made using rbd_req_sync_exec(). Until now this has only been used for creating a new RBD snapshot, and that has only required sending data out, not receiving anything back from the OSD. We will now need to get data back from an OSD on a method call, so add parameters t...
```diff diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index ad26502f4b0f..b8956131950c 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -1098,8 +1098,8 @@ static int rbd_req_sync_op(struct rbd_device *rbd_dev, int flags, struct ceph_osd_req_op *ops, const char *object_name, - ...
9fcbb80024795dc1a282f11af593ae5aa3d1b67e
Analyze and fix the following issue in the Linux kernel code: rbd: rename __rbd_init_snaps_header()
Problem Details: The name __rbd_init_snaps_header() doesn't really convey what that function does very well. Its purpose is to scan a new snapshot context and either create or destroy snapshot device entries so that local host's view is consistent with the reality maintained on the OSDs. This patch just changes the n...
```diff diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 8cb8e0abfb33..77263681dde2 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -201,7 +201,7 @@ static DEFINE_SPINLOCK(rbd_dev_list_lock); static LIST_HEAD(rbd_client_list); /* clients */ static DEFINE_SPINLOCK(rbd_client_list_lock); -s...
e28393082dd3991156d12a9e64b9584cef28fe25
Analyze and fix the following issue in the Linux kernel code: rbd: rename rbd_id_get()
Problem Details: This should have been done as part of this commit: commit de71a2970d57463d3d965025e33ec3adcf391248 Author: Alex Elder <elder@inktank.com> Date: Tue Jul 3 16:01:19 2012 -0500 rbd: rename rbd_device->id rbd_id_get() is assigning the rbd_dev->dev_id field. Change the name of that func...
```diff diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index d84b5341bea2..8cb8e0abfb33 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -2304,26 +2304,28 @@ static int rbd_init_watch_dev(struct rbd_device *rbd_dev) return ret; } -static atomic64_t rbd_id_max = ATOMIC64_INIT(0); +static atomic...
65ccfe21dd8fb402547bb1c50bbc2737c4ef37b8
Analyze and fix the following issue in the Linux kernel code: rbd: split up rbd_get_segment()
Problem Details: There are two places where rbd_get_segment() is called. One, in rbd_rq_fn(), only needs to know the length within a segment that an I/O request should be. The other, in rbd_do_op(), also needs the name of the object and the offset within it for the I/O request. Split out rbd_segment_name() into thre...
```diff diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 6da6990a7b57..7ba70c49bbdb 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -669,27 +669,47 @@ static void rbd_header_free(struct rbd_image_header *header) header->snapc = NULL; } -/* - * get the actual striped segment name, offset a...
df111be6310fc41d059a485368e3c51a684859c2
Analyze and fix the following issue in the Linux kernel code: rbd: check for overflow in rbd_get_num_segments()
Problem Details: It is possible in rbd_get_num_segments() for an overflow to occur when adding the offset and length. This is easily avoided. Since the function returns an int and the one caller is already prepared to handle errors, have it return -ERANGE if overflow would occur. The overflow check would not work if...
```diff diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 3475bb2e03ab..6da6990a7b57 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -50,6 +50,10 @@ #define SECTOR_SHIFT 9 #define SECTOR_SIZE (1ULL << SECTOR_SHIFT) +/* It might be useful to have this defined elsewhere too */ + +#define U64_...
58c17b0e1b2278824aedc5d1201f6a43a38d6a48
Analyze and fix the following issue in the Linux kernel code: rbd: don't over-allocate space for object prefix
Problem Details: In rbd_header_from_disk() the object prefix buffer is sized based on the maximum size it's block_name equivalent on disk could be. Instead, only allocate enough to hold null-terminated string from the on-disk header--or the maximum size of no NUL is found. Signed-off-by: Alex Elder <elder@inktank.com...
```diff diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 15bd3ecbcf34..a27167942a92 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -519,18 +519,19 @@ static int rbd_header_from_disk(struct rbd_image_header *header, struct rbd_image_header_ondisk *ondisk) { u32 snap_count; + size_t le...
523f32582f30768ab4e56b71b276fc1ea71f48cc
Analyze and fix the following issue in the Linux kernel code: rbd: add new snapshots at the tail
Problem Details: This fixes a bug that went in with this commit: commit f6e0c99092cca7be00fca4080cfc7081739ca544 Author: Alex Elder <elder@inktank.com> Date: Thu Aug 2 11:29:46 2012 -0500 rbd: simplify __rbd_init_snaps_header() The problem is that a new rbd snapshot needs to go either after an exist...
```diff diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 14bf83ba45d3..2b40a4af4d17 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -2187,7 +2187,7 @@ static int __rbd_init_snaps_header(struct rbd_device *rbd_dev) if (snap) list_add_tail(&new_snap->node, &snap->node); else - li...
843a0d0879935742bb7270c9dc8d94abb8b39cee
Analyze and fix the following issue in the Linux kernel code: rbd: rename block_name -> object_prefix
Problem Details: In the on-disk image header structure there is a field "block_name" which represents what we now call the "object prefix" for an rbd image. Rename this field "object_prefix" to be consistent with modern usage. This appears to be the only remaining vestige of the use of "block" in symbols that represe...
```diff diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 8e6e29eacb1a..14bf83ba45d3 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -522,11 +522,11 @@ static int rbd_header_from_disk(struct rbd_image_header *header, snap_count = le32_to_cpu(ondisk->snap_count); - size = sizeof (ondisk->b...
7698f2f5e0d7b7a062213fa970b7c4e121adf38e
Analyze and fix the following issue in the Linux kernel code: libceph: Fix sparse warning
Problem Details: Make ceph_monc_do_poolop() static to remove the following sparse warning: * net/ceph/mon_client.c:616:5: warning: symbol 'ceph_monc_do_poolop' was not declared. Should it be static? Also drops the 'ceph_monc_' prefix, now being a private function. Signed-off-by: Iulius Curt <icurt@ixiacom.com> Sig...
```diff diff --git a/net/ceph/mon_client.c b/net/ceph/mon_client.c index e98f6070b5ae..812eb3b46c1f 100644 --- a/net/ceph/mon_client.c +++ b/net/ceph/mon_client.c @@ -637,7 +637,7 @@ bad: /* * Do a synchronous pool op. */ -int ceph_monc_do_poolop(struct ceph_mon_client *monc, u32 op, +static int do_poolop(struct c...
c98f533c9497e285109a047bfb955d683f33f7e4
Analyze and fix the following issue in the Linux kernel code: ceph: let path portion of mount "device" be optional
Problem Details: A recent change to /sbin/mountall causes any trailing '/' character in the "device" (or fs_spec) field in /etc/fstab to be stripped. As a result, an entry for a ceph mount that intends to mount the root of the name space ends up with now path portion, and the ceph mount option processing code rejects ...
```diff diff --git a/fs/ceph/super.c b/fs/ceph/super.c index b982239f38f9..2f586b0e5e0f 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c @@ -307,7 +307,10 @@ static int parse_mount_options(struct ceph_mount_options **pfsopt, { struct ceph_mount_options *fsopt; const char *dev_name_end; - int err = -ENOMEM; + int...
d2bb24e506596ad0c10e4a7f4b2fca88cc75c0bc
Analyze and fix the following issue in the Linux kernel code: rbd: use sizeof (object) instead of sizeof (type)
Problem Details: Fix a few spots in rbd_header_from_disk() to use sizeof (object) rather than sizeof (type). Use a local variable to record sizes to shorten some lines and improve readability. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
```diff diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index e5eaa70e8826..2a94f8e81f67 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -494,17 +494,21 @@ static int rbd_header_from_disk(struct rbd_image_header *header, u32 allocated_snaps) { u32 snap_count; + size_t size; if (!rbd_de...
d78fd7ae03136c0610bee33eeebb4ffe67c752d5
Analyze and fix the following issue in the Linux kernel code: rbd: ensure invalid pointers are made null
Problem Details: Fix a number of spots where a pointer value that is known to have become invalid but was not reset to null. Also, toss in a change so we use sizeof (object) rather than sizeof (type). Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
```diff diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 02de524d4b67..e5eaa70e8826 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -568,6 +568,7 @@ err_sizes: err_names: kfree(header->snap_names); header->snap_names = NULL; + header->snap_names_len = 0; err_snapc: kfree(header->snapc)...
be3940c0a90265654d778394cafe2e2cec674df8
Analyze and fix the following issue in the Linux kernel code: btrfs: Kill some bi_idx references
Problem Details: For immutable bio vecs, I've been auditing and removing bi_idx references. These were harmless, but removing them will make auditing easier. scrub_bio_end_io_worker() was open coding a bio_reset() - but this doesn't appear to have been needed for anything as right after it does a bio_put(), and perusi...
```diff diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 3ad84f500687..90bd9f768c0a 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2306,8 +2306,8 @@ static void end_bio_extent_readpage(struct bio *bio, int err) struct extent_state *cached = NULL; struct extent_state *state; - pr...
962197babeccc1f4cc8aa28ad844df80bdc85ed0
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix unnecessary warning when the fragments make the space alloc fail
Problem Details: When we wrote some data by compress mode into a btrfs filesystem which was full of the fragments, the kernel will report: BTRFS warning (device xxx): Aborting unused transaction. The reason is: We can not find a long enough free space to store the compressed data because of the fragmentary free space...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 406666cb6156..d41e467b4aa2 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -662,7 +662,7 @@ retry: async_extent->compressed_size, async_extent->compressed_size, 0, alloc_hint, &ins, 1); - if (ret) + if (ret && ret != -...
69ffb54347a71c4f2a4694e0c1155af8538d55f6
Analyze and fix the following issue in the Linux kernel code: Btrfs: create a pinned em when writing to a prealloc range in DIO
Problem Details: Wade Cline reported a problem where he was getting garbage and warnings when writing to a preallocated range via O_DIRECT. This is because we weren't creating our normal pinned extent_map for the range we were writing to, which was causing all sorts of issues. This patch fixes the problem and makes h...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 9e9754adf7a4..406666cb6156 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -5898,6 +5898,48 @@ static int lock_extent_direct(struct inode *inode, u64 lockstart, u64 lockend, return ret; } +static struct extent_map *create_pinned_em(struct inode...
6df7881a84013f91405e5e113a4c322dd1804ba6
Analyze and fix the following issue in the Linux kernel code: Btrfs: move the sb_end_intwrite until after the throttle logic
Problem Details: Sage reported the following lockdep backtrace ===================================== [ BUG: bad unlock balance detected! ] 3.6.0-rc2-ceph-00171-gc7ed62d #1 Not tainted ------------------------------------- btrfs-cleaner/7607 is trying to release lock (sb_internal) at: [<ffffffffa00422ae>] btrfs_commit_...
```diff diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index f8ae448ebec4..0629edf99100 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -564,8 +564,6 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans, btrfs_trans_release_metadata(trans, root); trans->block_rsv ...
69917e431210f8712fe050f47b7561e7dae89521
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix a bug in parsing return value in logical resolve
Problem Details: In logical resolve, we parse extent_from_logical()'s 'ret' as a kind of flag. It is possible to lose our errors because (-EXXXX & BTRFS_EXTENT_FLAG_TREE_BLOCK) is true. I'm not sure if it is on purpose, it just looks too hacky if it is. I'd rather use a real flag and a 'ret' to catch errors. Acked-b...
```diff diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index e600857d3ca4..ab286e5bfe33 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -1193,7 +1193,8 @@ char *btrfs_iref_to_path(struct btrfs_root *fs_root, struct btrfs_path *path, * tree blocks and <0 on error. */ int extent_from_logical(struct...
8407aa464331556e4f6784f974030b83fc7585ed
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix corrupted metadata in the snapshot
Problem Details: When we delete a inode, we will remove all the delayed items including delayed inode update, and then truncate all the relative metadata. If there is lots of metadata, we will end the current transaction, and start a new transaction to truncate the left metadata. In this way, we will leave a inode item...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index aae55625aa59..9e9754adf7a4 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -3834,15 +3834,10 @@ void btrfs_evict_inode(struct inode *inode) btrfs_i_size_write(inode, 0); /* - * This is a bit simpler than btrfs_truncate since - * - * 1) We'v...
a80c8dcf7e5065adc555ef8ffb256df11e3293e3
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix our overcommit math
Problem Details: I noticed I was seeing large lags when running my torrent test in a vm on my laptop. While trying to make it lag less I noticed that our overcommit math was taking into account the number of bytes we wanted to reclaim, not the number of bytes we actually wanted to allocate, which means we wouldn't ove...
```diff diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 06369d588f27..a8de1c30f21c 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3663,6 +3663,46 @@ out: return ret; } +static int can_overcommit(struct btrfs_root *root, + struct btrfs_space_info *space_info, u64 bytes, ...
f54fb859da53f04a443c5e3f4cb9b936ed42d227
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix error handling in delete_block_group_cache()
Problem Details: btrfs_iget() never return NULL. So, NULL check is unnecessary. Signed-off-by: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
```diff diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 5a15c96a18ff..7e7fd1bcfc54 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -3270,8 +3270,8 @@ static int delete_block_group_cache(struct btrfs_fs_info *fs_info, key.offset = 0; inode = btrfs_iget(fs_info->sb, &key, root, NU...
903889f462409c816893abd02d88636f7b4a7774
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix wrong size for the reservation when doing, file pre-allocation.
Problem Details: When we ran fsstress(a program in xfstests), the filesystem hung up when it is full. It was because the space reserved in btrfs_fallocate() was wrong, btrfs_fallocate() just used the size of the pre-allocation to reserve the space, didn't took the block size aligning into account, so the size of the re...
```diff diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 793bc89c660f..00279c9a7f35 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -2000,7 +2000,7 @@ static long btrfs_fallocate(struct file *file, int mode, * Make sure we have enough space before we do the * allocation. */ - ret = btrfs_check_data_f...
2ecb79239bcd04c9d410f4cdce16adb6840b19da
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix unprotected ->log_batch
Problem Details: We forget to protect ->log_batch when syncing a file, this patch fix this problem by atomic operation. And ->log_batch is used to check if there are parallel sync operations or not, so it is unnecessary to reset it to 0 after the sync operation of the current log tree complete. Signed-off-by: Miao Xie...
```diff diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 2990a7ea6248..6923b9e4f90d 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -1491,9 +1491,9 @@ struct btrfs_root { wait_queue_head_t log_commit_wait[2]; atomic_t log_writers; atomic_t log_commit[2]; + atomic_t log_batch; unsigned long log_tra...
48c03c4bcfd7a1fcb1e05e9b1db1188cdbecf49a
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix wrong size for the reservation of the, snapshot creation
Problem Details: We should insert/update 6 items(root ref, root backref, dir item, dir index, root item and parent inode) when creating a snapshot, not 5 items, fix it. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
```diff diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 36e03312267a..b6b33e463ac3 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -4414,10 +4414,10 @@ int btrfs_snap_reserve_metadata(struct btrfs_trans_handle *trans, struct btrfs_block_rsv *src_rsv = get_block_rsv(trans, root);...
42874b3db7817f662b1d7c6e32f8b63638fa0321
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix the snapshot that should not exist
Problem Details: The snapshot should be the image of the fs tree before it was created, so the metadata of the snapshot should not exist in the its tree. But now, we found the directory item and directory name index is in both the snapshot tree and the fs tree. It introduces some problems and makes the users feel stran...
```diff diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 4b6ce5cab444..a86fc723aad9 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -955,6 +955,8 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, struct btrfs_root *parent_root; struct btrfs_block_...
b9a8cc5bef963b76c5b6c3016b7e91988a3e758b
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix file extent discount problem in the, snapshot
Problem Details: If a snapshot is created while we are writing some data into the file, the i_size of the corresponding file in the snapshot will be wrong, it will be beyond the end of the last file extent. And btrfsck will report: root 256 inode 257 errors 100 Steps to reproduce: # mkfs.btrfs <partition> # mount ...
```diff diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index 051c7fe551dd..cd8ecb73c05c 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c @@ -775,7 +775,6 @@ int btrfs_ordered_update_i_size(struct inode *inode, u64 offset, struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->order...
361048f586f59d414421c6486dd846063a0cac98
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix full backref problem when inserting shared block reference
Problem Details: If we create several snapshots at the same time, the following BUG_ON() will be triggered. kernel BUG at fs/btrfs/extent-tree.c:6047! Steps to reproduce: # mkfs.btrfs <partition> # mount <partition> <mnt> # cd <mnt> # for ((i=0;i<2400;i++)); do touch long_name_to_make_tree_more_deep$i; done # f...
```diff diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 7be031853273..4b6ce5cab444 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -1119,6 +1119,10 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, ret = btrfs_reloc_post_snapshot(trans, pending); ...
6fa9700e734275de2acbcb0e99414bd7ddfc60f1
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix error path in create_pending_snapshot()
Problem Details: This patch fixes the following problem: - If we failed to deal with the delayed dir items, we should abort transaction, just as its comment said. Fix it. - If root reference or root back reference insertion failed, we should abort transaction. Fix it. - Fix the double free problem of pending->inher...
```diff diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index ffc6b5202d5c..7be031853273 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -967,18 +967,16 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, u64 root_flags; uuid_le new_uuid; - rsv = trans...
cf93dccea67ad8f5e0d9163c6a0a584550bbd7cd
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix possible memory leak in scrub_setup_recheck_block()
Problem Details: bbio has been malloced in btrfs_map_block() and should be freed before leaving from the error handling cases. spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
```diff diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index b223620cd5a6..4e9eafe01c55 100644 --- a/fs/btrfs/scrub.c +++ b/fs/btrfs/scrub.c @@ -1029,6 +1029,7 @@ static int scrub_setup_recheck_block(struct scrub_dev *sdev, spin_lock(&sdev->stat_lock); sdev->stat.malloc_errors++; spin_unlock(&sdev->sta...
7014cdb49305eda0767d2ae6136f8c191ea8fd81
Analyze and fix the following issue in the Linux kernel code: Btrfs: btrfs_drop_extent_cache should never fail
Problem Details: I noticed this when I was doing the fsync stuff, we allocate split extents if we drop an extent range that is in the middle of an existing extent. This BUG()'s if we fail to allocate memory, but the fact is this is just a cache, we will just regenerate the cache if we need it, the important part is th...
```diff diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 88adfe638409..b7cd3adb5a58 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -3316,8 +3316,8 @@ int btrfs_add_inode_defrag(struct btrfs_trans_handle *trans, struct inode *inode); int btrfs_run_defrag_inodes(struct btrfs_fs_info *fs_info); int...
ac14aed66558d686b1f95dac1f07ecfe11d8c30e
Analyze and fix the following issue in the Linux kernel code: Btrfs: do not take cleanup_work_sem in btrfs_run_delayed_iputs()
Problem Details: Josef has suggested that this is not necessary. Removing it also avoids this lockdep splat (after the new sb_internal locking stuff was added): [ 604.090449] ====================================================== [ 604.114819] [ INFO: possible circular locking dependency detected ] [ 604.139262] 3...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 8cb272c84089..073af0724bc0 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2118,7 +2118,6 @@ void btrfs_run_delayed_iputs(struct btrfs_root *root) if (empty) return; - down_read(&root->fs_info->cleanup_work_sem); spin_lock(&fs_info->delaye...
46d8bc34248f3a94dea910137d1ddf5fb1e3a1cc
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix a bug in checking whether a inode is already in log
Problem Details: This is based on Josef's "Btrfs: turbo charge fsync". The current btrfs checks if an inode is in log by comparing root's last_log_commit to inode's last_sub_trans[2]. But the problem is that this root->last_log_commit is shared among inodes. Say we have N inodes to be logged, after the first inode, ...
```diff diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 7c7bf818f3c1..ed8ca7ca5eff 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -144,6 +144,9 @@ struct btrfs_inode { /* flags field from the on disk inode */ u32 flags; + /* a local copy of root's last_log_commit */ + unsig...
321f0e70225abc792d74902a2bc4a60164265fd4
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix wrong orphan count of the fs/file tree
Problem Details: If we add a new orphan item, we should increase the atomic counter, not decrease it. Fix it. Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 878116d9625d..a6824bd04493 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -2228,7 +2228,7 @@ int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode) insert = 1; #endif insert = 1; - atomic_dec(&root->orphan_inodes); + ...
0fa83cdb1d72a94ea84ab6380747de6ac7cc8753
Analyze and fix the following issue in the Linux kernel code: Btrfs: only warn if we hit an error when doing the tree logging
Problem Details: I hit this a couple times while working on my fsync patch (all my bugs, not normal operation), but with my new stuff we could have new errors from cases I have not encountered, so instead of BUG()'ing we should be WARN()'ing so that we are notified there is a problem but the user doesn't lose their dat...
```diff diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index f2ff02c55130..94db438494df 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -3346,7 +3346,7 @@ int btrfs_log_inode_parent(struct btrfs_trans_handle *trans, end_trans: dput(old_parent); if (ret < 0) { - BUG_ON(ret != -ENOSPC); + WAR...
5dc562c541e1026df9d43913c2f6b91156e22d32
Analyze and fix the following issue in the Linux kernel code: Btrfs: turbo charge fsync
Problem Details: At least for the vm workload. Currently on fsync we will 1) Truncate all items in the log tree for the given inode if they exist and 2) Copy all items for a given inode into the log The problem with this is that for things like VMs you can have lots of extents from the fragmented writing behavior,...
```diff diff --git a/fs/btrfs/btrfs_inode.h b/fs/btrfs/btrfs_inode.h index 5b2ad6bc4fe7..7c7bf818f3c1 100644 --- a/fs/btrfs/btrfs_inode.h +++ b/fs/btrfs/btrfs_inode.h @@ -38,6 +38,7 @@ #define BTRFS_INODE_DELALLOC_META_RESERVED 4 #define BTRFS_INODE_HAS_ORPHAN_ITEM 5 #define BTRFS_INODE_HAS_ASYNC_EXTENT 6 +#define...
224ecce517af3a952321202cdf304c12e138caca
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix possible corruption when fsyncing written prealloced extents
Problem Details: While working on my fsync patch my fsync tester kept hitting mismatching md5sums when I would randomly write to a prealloc'ed region, syncfs() and then write to the prealloced region some more and then fsync() and then immediately reboot. This is because the tree logging code will skip writing csums f...
```diff diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index 5caf285c6e4d..b7c885c8423f 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c @@ -935,12 +935,16 @@ again: btrfs_set_item_key_safe(trans, root, path, &new_key); fi = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_file_extent_item); + bt...
54338b5cc4fa3cfe260e8e4ade8b62a9079ea3f9
Analyze and fix the following issue in the Linux kernel code: Btrfs: do not allocate chunks as agressively
Problem Details: Swinging this pendulum back the other way. We've been allocating chunks up to 2% of the disk no matter how much we actually have allocated. So instead fix this calculation to only allocate chunks if we have more than 80% of the space available allocated. Please test this as it will likely cause all ...
```diff diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index ba58024d40d3..62fc92f2b9d7 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3504,7 +3504,8 @@ static int should_alloc_chunk(struct btrfs_root *root, * and purposes it's used space. Don't worry about locking the * globa...
7c735313bd1277c2eb28421934d4c7a0fa7339f7
Analyze and fix the following issue in the Linux kernel code: Btrfs: update last trans if we don't update the inode
Problem Details: There is a completely impossible situation to hit where you can preallocate a file, fsync it, write into the preallocated region, have the transaction commit twice and then fsync and then immediately lose power and lose all of the contents of the write. This patch fixes this just so I feel better abou...
```diff diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index ec154f954646..6971bac66d9d 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1949,6 +1949,8 @@ static int btrfs_finish_ordered_io(struct btrfs_ordered_extent *ordered_extent) btrfs_abort_transaction(trans, root, ret); goto out_unlock; } + ...
995e01b7af745b8aaa5e882cfb7bfd5baab3f335
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix gcc warnings for 32bit compiles
Problem Details: Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
```diff diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 6655ca615364..e600857d3ca4 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -231,7 +231,7 @@ static int add_all_parents(struct btrfs_root *root, struct btrfs_path *path, } if (!ret) { ret = ulist_add(parents, eb->start, - (u...
74dd17fbe3d65829e75d84f00a9525b2ace93998
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix btrfs send for inline items and compression
Problem Details: The btrfs send code was assuming the offset of the file item into the extent translated to bytes on disk. If we're compressed, this isn't true, and so it was off into extents owned by other files. It was also improperly handling inline extents. This solves a crash where we may have gone past the end...
```diff diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c index 6d183f60d63a..fcc8c21a6233 100644 --- a/fs/btrfs/ctree.c +++ b/fs/btrfs/ctree.c @@ -5073,6 +5073,7 @@ static void tree_move_down(struct btrfs_root *root, struct btrfs_path *path, int *level, int root_level) { + BUG_ON(*level == 0); path->no...
3954096d4b1adab6fbb3c26de37ddd4f781e072f
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix check for changed extent in is_extent_unchanged
Problem Details: The previous check was working fine, but this check should be easier to read. Also, we could theoritically have some exotic bugs with the previous checks. Signed-off-by: Alexander Block <ablock84@googlemail.com>
```diff diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index cfbe987f854b..35222d5420f6 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -3819,8 +3819,8 @@ static int is_extent_unchanged(struct send_ctx *sctx, /* * Check if we have the same extent. */ - if (left_disknr + left_offset_fixed != - right...
766702ef49b8b5299d819f3a0ac42613c23424d1
Analyze and fix the following issue in the Linux kernel code: Btrfs: add/fix comments/documentation for send/receive
Problem Details: As the subject already said, add/fix comments. Signed-off-by: Alexander Block <ablock84@googlemail.com>
```diff diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index f618224d2326..6926546939f6 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -1067,6 +1067,7 @@ static int __clone_root_cmp_sort(const void *e1, const void *e2) /* * Called for every backref that is found for the current extent. + * Results are colle...
34d73f54e2e2227cece751f168d08d3103092992
Analyze and fix the following issue in the Linux kernel code: Btrfs: make aux field of ulist 64 bit
Problem Details: Btrfs send/receive uses the aux field to store inode numbers. On 32 bit machines this may become a problem. Also fix all users of ulist_add and ulist_add_merged. Reported-by: Arne Jansen <sensille@gmx.net> Signed-off-by: Alexander Block <ablock84@googlemail.com>
```diff diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index ff6475f409d6..6655ca615364 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -231,7 +231,7 @@ static int add_all_parents(struct btrfs_root *root, struct btrfs_path *path, } if (!ret) { ret = ulist_add(parents, eb->start, - (u...
7e0926fe5f20b5c88e51cba68512302b10f73d2a
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix use of radix_tree for name_cache in send/receive
Problem Details: We can't easily use the index of the radix tree for inums as the radix tree uses 32bit indexes on 32bit kernels. For 32bit kernels, we now use the lower 32bit of the inum as index and an additional list to store multiple entries per radix tree entry. Reported-by: Arne Jansen <sensille@gmx.net> Signed-...
```diff diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 9cee678c0fb6..02e901adc3e8 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -125,6 +125,15 @@ struct send_ctx { struct name_cache_entry { struct list_head list; + /* + * radix_tree has only 32bit entries but we need to handle 64bit inums. + * We u...
17589bd96eeb7c2ef2d3baeb05005a24932cd1e9
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix memory leak for name_cache in send/receive
Problem Details: When everything is done, name_cache_free is called which however forgot to call kfree on the cache entries. Signed-off-by: Alexander Block <ablock84@googlemail.com>
```diff diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 68b2543e5d6c..9cee678c0fb6 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -1822,6 +1822,7 @@ static void name_cache_free(struct send_ctx *sctx) list_for_each_entry_safe(nce, tmp, &sctx->name_cache_list, list) { name_cache_delete(sctx, nce); + k...
1f4692da951af4179a6522c6b48a09a43d37e614
Analyze and fix the following issue in the Linux kernel code: Btrfs: fix cur_ino < parent_ino case for send/receive
Problem Details: When the current inodes inum is smaller then the inum of the parent directory strange things were happending due to wrong path resolution and other bugs. Fix this with a new approach for the problem. Reported-by: Alex Lyakas <alex.bolshoy.btrfs@gmail.com> Signed-off-by: Alexander Block <ablock84@googl...
```diff diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 5721401548e8..a5fae484d4e1 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -107,7 +107,6 @@ struct send_ctx { int cur_inode_new; int cur_inode_new_gen; int cur_inode_deleted; - int cur_inode_first_ref_orphan; u64 cur_inode_size; u64 cur_inode_...
737c097b9aed92906b4bb9f90f05eb4d5696f572
Analyze and fix the following issue in the Linux kernel code: [media] v4l2-ioctl.c: fix overlay support
Problem Details: The vidioc_overlay op needs an unsigned int, not an unsigned int pointer. So we need a small function that dereferences the unsigned int pointer. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 09512ebc6497..9d3e46c446ad 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1422,6 +1422,12 @@ static int v4l_s_hw_freq_seek(const struct v4l2_ioctl_ops *ops, return o...
f39a0dd62a1a0e674078c3273977bf055a21f80d
Analyze and fix the following issue in the Linux kernel code: [media] media/radio/shark2: Fix build error caused by missing dependencies
Problem Details: Without this patch, building rand-0y2jSKT results in: WARNING: drivers/usb/musb/musb_hdrc.o(.devinit.text+0x9b8): Section mismatch in reference from the function musb_init_controller() to the function .init.text:dma_controller_create() The function __devinit musb_init_controller() references a functio...
```diff diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig index ff3af6e77d61..f99fa2512286 100644 --- a/sound/pci/Kconfig +++ b/sound/pci/Kconfig @@ -2,8 +2,8 @@ config SND_TEA575X tristate - depends on SND_FM801_TEA575X_BOOL || SND_ES1968_RADIO || RADIO_SF16FMR2 || RADIO_MAXIRADIO - default SND_FM801 || SND_ES19...
3f14513d0a825ba0c2f2c4227af2bac4f864a9e0
Analyze and fix the following issue in the Linux kernel code: [media] s5p-mfc: Fix second memory bank alignment
Problem Details: Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c index 4d662f1c4acc..992303d76b11 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c @@ -78,7 +78,7 @@ int s5p_mfc_alloc_and_load_firmware(struct ...
5d33ee92ac2556ab1e53db4644af672e2e136013
Analyze and fix the following issue in the Linux kernel code: [media] s5p-fimc: Fix setup of initial links to FIMC entities
Problem Details: This patch fixes regression introduced in commit 4af813108b880e96a4b8b01e162f950a4aaa2475. Missing pointers to the sensor subdevs are restored along with subdev callback notifications to a corresponding FIMC instance driver. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: And...
```diff diff --git a/drivers/media/platform/s5p-fimc/fimc-mdevice.c b/drivers/media/platform/s5p-fimc/fimc-mdevice.c index 3c76bd948fdb..e2aa8d99d858 100644 --- a/drivers/media/platform/s5p-fimc/fimc-mdevice.c +++ b/drivers/media/platform/s5p-fimc/fimc-mdevice.c @@ -617,6 +617,7 @@ static int __fimc_md_create_flite_sou...
e169c9baa31b23d8e0641359772c47291c485c14
Analyze and fix the following issue in the Linux kernel code: [media] m5mols: Fix cast warnings from m5mols_[set/get]_ctrl_mode
Problem Details: Fixes following warnings on 64-bit architectures: m5mols.h: In function 'm5mols_set_ctrl_mode': m5mols.h:326:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] m5mols.h: In function 'm5mols_get_ctrl_mode': m5mols.h:331:9: warning: cast from pointer to integer of diffe...
```diff diff --git a/drivers/media/i2c/m5mols/m5mols.h b/drivers/media/i2c/m5mols/m5mols.h index bb589917b65b..527e7b2965df 100644 --- a/drivers/media/i2c/m5mols/m5mols.h +++ b/drivers/media/i2c/m5mols/m5mols.h @@ -323,12 +323,12 @@ static inline struct v4l2_subdev *to_sd(struct v4l2_ctrl *ctrl) static inline void m5m...
31d34d9bb30fef7aee1800ec63255083dbcdfa83
Analyze and fix the following issue in the Linux kernel code: [media] s5p-fimc: Don't allocate fimc-capture video device dynamically
Problem Details: This fixes potential invalid pointer de-reference, when media_entity_cleanup() is called before video device is unregistered. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
```diff diff --git a/drivers/media/platform/s5p-fimc/fimc-capture.c b/drivers/media/platform/s5p-fimc/fimc-capture.c index 8e413dd3c0b0..5d3a70f5c5ca 100644 --- a/drivers/media/platform/s5p-fimc/fimc-capture.c +++ b/drivers/media/platform/s5p-fimc/fimc-capture.c @@ -304,7 +304,7 @@ int fimc_capture_resume(struct fimc_d...
1bcd7041947287206065af584e15fc4f41113da7
Analyze and fix the following issue in the Linux kernel code: [media] s5p-fimc: Don't allocate fimc-lite video device structure dynamically
Problem Details: This fixes potential invalid pointer de-reference, when media_entity_cleanup() is called after video_unregister_device, and video device structure memory is already freed. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by:...
```diff diff --git a/drivers/media/platform/s5p-fimc/fimc-lite-reg.c b/drivers/media/platform/s5p-fimc/fimc-lite-reg.c index f996e94873f6..09dc71e477df 100644 --- a/drivers/media/platform/s5p-fimc/fimc-lite-reg.c +++ b/drivers/media/platform/s5p-fimc/fimc-lite-reg.c @@ -137,7 +137,7 @@ void flite_hw_set_source_format(s...
1d4ab9077681b7cce60ff46e3a42fe2dafa0b83d
Analyze and fix the following issue in the Linux kernel code: [CIFS] Fix indentation of fs/cifs/Kconfig entries
Problem Details: make menuconfig for cifs shows multiple entries toward the end of the list with the incorrect indentation (probably a bug in Kconfig parsing of items that are dependant on the module (cifs=m instead of just CONFIG_CIFS). This patch fixes the indentation of all but the last entry (CIFS_ACL) which I don...
```diff diff --git a/fs/cifs/Kconfig b/fs/cifs/Kconfig index 253033ec0904..2075ddfffa73 100644 --- a/fs/cifs/Kconfig +++ b/fs/cifs/Kconfig @@ -15,8 +15,8 @@ config CIFS (CIFS) protocol which is the successor to the Server Message Block (SMB) protocol, the native file sharing mechanism for most early PC oper...
e4aa25e7801163df058f62c617b859e9d3d4b148
Analyze and fix the following issue in the Linux kernel code: [CIFS] Fix SMB2 negotiation support to select only one dialect (based on vers=)
Problem Details: Based on whether the user (on mount command) chooses: vers=3.0 (for smb3.0 support) vers=2.1 (for smb2.1 support) or (with subsequent patch, which will allow SMB2 support) vers=2.0 (for original smb2.02 dialect support) send only one dialect at a time during negotiate (we had been sending a list). R...
```diff diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index f6f40635abca..f5af2527fc69 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -179,6 +179,7 @@ struct smb_rqst { enum smb_version { Smb_1 = 1, Smb_21, + Smb_30, }; struct mid_q_entry; @@ -372,6 +373,8 @@ struct smb_version_operations {...
c00aaa1a0221a22153071fcb2f320e2ebaecc2fd
Analyze and fix the following issue in the Linux kernel code: IB/qib: Fix local access validation for user MRs
Problem Details: Commit 8aac4cc3a9d7 ("IB/qib: RCU locking for MR validation") introduced a bug that broke user post sends. The proper validation of the MR was lost in the patch. This patch corrects that validation. Reviewed-by: Dean Luick <dean.luick@intel.com> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@inte...
```diff diff --git a/drivers/infiniband/hw/qib/qib_keys.c b/drivers/infiniband/hw/qib/qib_keys.c index e9486c74c226..81c7b73695d2 100644 --- a/drivers/infiniband/hw/qib/qib_keys.c +++ b/drivers/infiniband/hw/qib/qib_keys.c @@ -186,8 +186,9 @@ int qib_lkey_ok(struct qib_lkey_table *rkt, struct qib_pd *pd, goto bail; ...
4eae518d4b01b0cbf2f0d8edb5a6f3d6245ee8fb
Analyze and fix the following issue in the Linux kernel code: localmodconfig: Fix localyesconfig to set to 'y' not 'm'
Problem Details: The kbuild target 'localyesconfig' has been same as 'localmodconfig' since the commit 50bce3e "kconfig/streamline_config.pl: merge local{mod,yes}config". The commit expects this script generates different configure depending on target, but it was not yet implemented. So I added code that sets to 'yes'...
```diff diff --git a/scripts/kconfig/streamline_config.pl b/scripts/kconfig/streamline_config.pl index 39b6314fe634..33689396953a 100644 --- a/scripts/kconfig/streamline_config.pl +++ b/scripts/kconfig/streamline_config.pl @@ -601,6 +601,8 @@ foreach my $line (@config_file) { if (defined($configs{$1})) { if ($l...
bc8dce4f7b4908bac69acac34d19b4234ba19cee
Analyze and fix the following issue in the Linux kernel code: Bluetooth: A2MP: Fix potential NULL dereference
Problem Details: Return INVALID_CTRL_ID for unknown AMP controller and for BR/EDR controller and fixes dereference possible NULL pointer. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
```diff diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c index 42788cdbb4fe..d4946b591b71 100644 --- a/net/bluetooth/a2mp.c +++ b/net/bluetooth/a2mp.c @@ -278,7 +278,7 @@ static int a2mp_getinfo_req(struct amp_mgr *mgr, struct sk_buff *skb, BT_DBG("id %d", req->id); hdev = hci_dev_get(req->id); - if (!hde...
749052fba650a644b29ed2ae35cd985f736401b3
Analyze and fix the following issue in the Linux kernel code: drm/i915: add debug logging to ASLE backlight set requests
Problem Details: Make it easier to track backlight set requests coming through ASLE instead of the driver's own backlight sysfs interface. We've had enough of backlight issues to warrant some extra debug logs in the area. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ff...
```diff diff --git a/drivers/gpu/drm/i915/intel_opregion.c b/drivers/gpu/drm/i915/intel_opregion.c index e27c17012628..0f2db1648f04 100644 --- a/drivers/gpu/drm/i915/intel_opregion.c +++ b/drivers/gpu/drm/i915/intel_opregion.c @@ -154,6 +154,8 @@ static u32 asle_set_backlight(struct drm_device *dev, u32 bclp) struct ...
00df111e7eb505558c54f23861e9341e56dd5fb0
Analyze and fix the following issue in the Linux kernel code: parisc: fix double restarts
Problem Details: Don't bother restoring r28 on syscall restarts; it's clobbered by syscall anyway. Reuse (now unused) ->orig_r28 as "no restarts allowed" flag. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
```diff diff --git a/arch/parisc/hpux/gate.S b/arch/parisc/hpux/gate.S index 38a1c1b8d4e8..011468857e98 100644 --- a/arch/parisc/hpux/gate.S +++ b/arch/parisc/hpux/gate.S @@ -71,7 +71,7 @@ ENTRY(hpux_gateway_page) STREG %r26, TASK_PT_GR26(%r1) /* 1st argument */ STREG %r27, TASK_PT_GR27(%r1) /* user dp */ STRE...
af445f45ed64fb0276c0f29bf30d7586e0b8d5f2
Analyze and fix the following issue in the Linux kernel code: score: fix bogus restarts on sigreturn()
Problem Details: we *really* don't want to have restart logics hit when we are returning from sigreturn() - random replacement of %r4 with -4 just because a signal had been noticed from timer interrupt that came when %r4 happened to contain -514 is not nice at all. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
```diff diff --git a/arch/score/kernel/signal.c b/arch/score/kernel/signal.c index e382c52ca0d9..c268bbf8b410 100644 --- a/arch/score/kernel/signal.c +++ b/arch/score/kernel/signal.c @@ -174,6 +174,7 @@ score_rt_sigreturn(struct pt_regs *regs) /* It is more difficult to avoid calling this function than to call i...
97541ccfb9db2bb9cd1dde6344d5834438d14bda
Analyze and fix the following issue in the Linux kernel code: MIPS: ath79: Fix CPU/DDR frequency calculation for SRIF PLLs
Problem Details: Besides the CPU and DDR PLLs, the CPU and DDR frequencies can be derived from other PLLs in the SRIF block on the AR934x SoCs. The current code does not checks if the SRIF PLLs are used and this can lead to incorrectly calculated CPU/DDR frequencies. Fix it by calculating the frequencies from SRIF PLL...
```diff diff --git a/arch/mips/ath79/clock.c b/arch/mips/ath79/clock.c index d2728573e9fc..579f452c0b45 100644 --- a/arch/mips/ath79/clock.c +++ b/arch/mips/ath79/clock.c @@ -17,6 +17,8 @@ #include <linux/err.h> #include <linux/clk.h> +#include <asm/div64.h> + #include <asm/mach-ath79/ath79.h> #include <asm/mach-...
65fc7f9957c52ad4fdf4ee5dfe3a75aa0a633d39
Analyze and fix the following issue in the Linux kernel code: MIPS: ath79: use correct fractional dividers for {CPU,DDR}_PLL on AR934x
Problem Details: The current dividers in the code are wrong and this leads to broken CPU frequency calculation on boards where the fractional part is used. For example, if the SoC is running from a 40MHz reference clock, refdiv=1, nint=14, outdiv=0 and nfrac=31 the real frequency is 579.375MHz but the current code cal...
```diff diff --git a/arch/mips/ath79/clock.c b/arch/mips/ath79/clock.c index b91ad3efe29e..d2728573e9fc 100644 --- a/arch/mips/ath79/clock.c +++ b/arch/mips/ath79/clock.c @@ -189,7 +189,7 @@ static void __init ar934x_clocks_init(void) AR934X_PLL_CPU_CONFIG_NFRAC_MASK; cpu_pll = nint * ath79_ref_clk.rate / ...