Files
scst/scripts/kernel-functions
Yan Burman 799ddae085 Merged revisions 5322-5326,5329-5340,5344-5371,5382-5407 via svnmerge from
svn+ssh://yanb123@svn.code.sf.net/p/scst/svn/trunk

........
  r5322 | vlnb | 2014-03-05 05:27:21 +0200 (Wed, 05 Mar 2014) | 13 lines
  
  scst_vdisk: Make vdisk_nullio size configurable
  
  Keep the default size of vdisk_nullio devices at VDISK_NULLIO_SIZE. Add
  a sysfs attribute 'size' which is the size of a vdisk device in
  bytes. Make the size of vdisk_nullio devices configurable. Accept
  "size" and "size_mb" as creation parameters for vdisk_nullio
  devices. Generate a CAPACITY DATA HAS CHANGED unit attention after size
  changes. Refuse any attempt to change the size into a number that is
  not a multiple of the block size.
  
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5323 | bvassche | 2014-03-06 09:29:00 +0200 (Thu, 06 Mar 2014) | 1 line
  
  scst_vdisk: Avoid that smatch complains about unreachable code
........
  r5324 | vlnb | 2014-03-07 06:02:39 +0200 (Fri, 07 Mar 2014) | 27 lines
  
  PERSISTENT RESERVE IN: Suppress a kernel warning for small output buffer sizes
  
  This patch suppresses the following error message and kernel warning:
  
  scst: ***ERROR***: Too big response data len 24 (max 8), limiting it to the max (dev iis)
  Call Trace:
   [<ffffffff818b1193>] ? dump_stack+0x41/0x56
   [<ffffffffa01c1a8f>] ? scst_set_resp_data_len+0x82/0xb1 [scst]
   [<ffffffffa01ca80f>] ? scst_pr_read_reservation+0xbf/0xc4 [scst]
   [<ffffffffa01b707b>] ? scst_persistent_reserve_in_local+0x140/0x1ce [scst]
   [<ffffffffa01b7cee>] ? scst_exec_check_blocking+0x57/0xf1 [scst]
   [<ffffffffa01b85f4>] ? scst_process_active_cmd+0x86c/0x136f [scst]
   [<ffffffffa01b913c>] ? scst_do_job_active+0x45/0x5b [scst]
   [<ffffffffa01b939c>] ? scst_cmd_thread+0x218/0x2b7 [scst]
   [<ffffffff8105292a>] ? wake_up_bit+0x23/0x23
   [<ffffffffa01b9184>] ? scst_cmd_tasklet+0x32/0x32 [scst]
   [<ffffffff81052355>] ? kthread_freezable_should_stop+0x51/0x51
   [<ffffffffa01b9184>] ? scst_cmd_tasklet+0x32/0x32 [scst]
   [<ffffffff81052400>] ? kthread+0xab/0xb3
   [<ffffffff81052355>] ? kthread_freezable_should_stop+0x51/0x51
   [<ffffffff818b4e3c>] ? ret_from_fork+0x7c/0xb0
   [<ffffffff81052355>] ? kthread_freezable_should_stop+0x51/0x51
  
  Reported-by: Roman Bogdanov <bogdanovr@gmail.com>
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5325 | bvassche | 2014-03-08 15:30:29 +0200 (Sat, 08 Mar 2014) | 1 line
  
  nightly build: Update kernel versions
........
  r5326 | vlnb | 2014-03-13 05:50:37 +0200 (Thu, 13 Mar 2014) | 3 lines
  
  Update link to Gentoo HOWTO from Jurie Botha
........
  r5329 | vlnb | 2014-03-15 03:38:06 +0200 (Sat, 15 Mar 2014) | 3 lines
  
  Cleanup
........
  r5330 | vlnb | 2014-03-15 03:38:37 +0200 (Sat, 15 Mar 2014) | 3 lines
  
  Implement REPORT SUPPORTED TASK MANAGEMENT FUNCTIONS command
........
  r5331 | vlnb | 2014-03-15 03:40:57 +0200 (Sat, 15 Mar 2014) | 8 lines
  
  scst_vdisk: Remove an unused parameter from vdisk_fsync*()
  
  The "struct vdisk_cmd_params *p" parameter is neither used by vdisk_fsync(),
  vdisk_fsync_blockio() nor by vdisk_fsync_fileio() so remove it.
  
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5332 | vlnb | 2014-03-15 03:42:06 +0200 (Sat, 15 Mar 2014) | 8 lines
  
  vdisk_blockio: Change default vendor name back to "SCST_BIO"
  
  In r5316 the default vendor name for vdisk_blockio devices was changed
  into "SCST_FIO". Change this back into "SCST_BIO".
  
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5333 | vlnb | 2014-03-15 03:44:35 +0200 (Sat, 15 Mar 2014) | 8 lines
  
  vdisk_blockio: Add VERIFY implementation
  
  There is already an implementation of the VERIFY command for vdisk_fileio
  devices. Add an implementation for vdisk_blockio devices.
  
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5334 | vlnb | 2014-03-15 04:01:17 +0200 (Sat, 15 Mar 2014) | 8 lines
  
  scst_vdisk: Implement COMPARE AND WRITE
  
  Ensure that COMPARE AND WRITE is executed atomically by serializing
  all COMPARE AND WRITE commands per device (SCST_SERIALIZED).
  
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5335 | vlnb | 2014-03-15 04:09:17 +0200 (Sat, 15 Mar 2014) | 5 lines
  
  Fix URL to SCST website
  
  Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
........
  r5336 | vlnb | 2014-03-15 04:13:58 +0200 (Sat, 15 Mar 2014) | 3 lines
  
  Cleanup
........
  r5337 | bvassche | 2014-03-15 08:47:26 +0200 (Sat, 15 Mar 2014) | 1 line
  
  scripts/kernel-functions: Kernel 3.13.6 build fix
........
  r5338 | bvassche | 2014-03-16 15:38:50 +0200 (Sun, 16 Mar 2014) | 1 line
  
  srpt: Minor buid process terminology change
........
  r5339 | bvassche | 2014-03-18 17:35:13 +0200 (Tue, 18 Mar 2014) | 1 line
  
  ib_srpt: Avoid that session logout hangs sporadically
........
  r5340 | vlnb | 2014-03-19 06:28:46 +0200 (Wed, 19 Mar 2014) | 8 lines
  
  scst/README: Show how to read SCST sysfs attributes
  
  Make the behavior of SCST sysfs attributes more clear by adding
  examples in scst/README of code for reading and writing these attributes.
  
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5344 | bvassche | 2014-03-20 17:13:50 +0200 (Thu, 20 Mar 2014) | 1 line
  
  ib_srpt: Simplify srpt_handle_cmd()
........
  r5345 | bvassche | 2014-03-20 17:14:45 +0200 (Thu, 20 Mar 2014) | 5 lines
  
  ib_srpt: Micro-optimize I/O context state manipulation
      
  All ioctx->state manipulations are serialized per command so it is
  not necessary to use locking to protect these manipulations.
........
  r5346 | bvassche | 2014-03-20 17:15:54 +0200 (Thu, 20 Mar 2014) | 8 lines
  
  ib_srpt: Handle GID change events properly
      
  The mlx4_core driver generates a GID change event after a port has been
  changed from IB into Ethernet mode. Avoid that this causes the following
  error message to appear in the system log:
      
  ib_srpt: ***ERROR***: received unrecognized IB event 18
........
  r5347 | bvassche | 2014-03-20 17:16:27 +0200 (Thu, 20 Mar 2014) | 1 line
  
  ib_srpt/Makefile: Add kerneldoc target
........
  r5348 | bvassche | 2014-03-20 17:17:04 +0200 (Thu, 20 Mar 2014) | 1 line
  
  ib_srpt: Fix an error reported by the kerneldoc tool
........
  r5349 | bvassche | 2014-03-20 17:18:06 +0200 (Thu, 20 Mar 2014) | 5 lines
  
  ib_srpt: Avoid that cmd_wait_list processing triggers command reordering
  
  Although harmless for SCSI commands with SIMPLE ordering, avoid that commands
  received before RTU can get reordered.
........
  r5350 | bvassche | 2014-03-20 17:18:38 +0200 (Thu, 20 Mar 2014) | 2 lines
  
  ib_srpt: Micro-optimize SRP_CMD parsing
........
  r5351 | bvassche | 2014-03-20 17:19:05 +0200 (Thu, 20 Mar 2014) | 1 line
  
  ib_srpt: Sync information unit memory only once
........
  r5352 | bvassche | 2014-03-20 17:19:34 +0200 (Thu, 20 Mar 2014) | 2 lines
  
  ib_srpt: Introduce a temporary variable in srpt_handle_new_iu()
........
  r5353 | bvassche | 2014-03-20 17:20:55 +0200 (Thu, 20 Mar 2014) | 2 lines
  
  ib_srpt: Micro-optimize polling
........
  r5354 | bvassche | 2014-03-20 17:22:19 +0200 (Thu, 20 Mar 2014) | 5 lines
  
  ib_srpt: Rework multi-channel support
  
  Store initiator and target port ID's once per nexus instead of in each
  channel data structure.
........
  r5355 | bvassche | 2014-03-20 17:23:16 +0200 (Thu, 20 Mar 2014) | 2 lines
  
  ib_srpt: Simplify channel state management code
........
  r5356 | bvassche | 2014-03-20 17:24:18 +0200 (Thu, 20 Mar 2014) | 5 lines
  
  ib_srpt: Defer destroying the QP until the TimeWait state has been left
  
  This is necessary to avoid that a login gets rejected due to reusing a
  queue pair number that has not yet been freed by the target side.
........
  r5357 | bvassche | 2014-03-20 17:25:34 +0200 (Thu, 20 Mar 2014) | 5 lines
  
  ib_srpt: Rework waiting for last WQE
  
  After having changed the queue pair state into "error", queue an additional
  work request instead of waiting for the last WQE event.
........
  r5358 | bvassche | 2014-03-20 17:26:48 +0200 (Thu, 20 Mar 2014) | 1 line
  
  srpt/session-management.txt: Document how sessions are managed by the ib_srpt driver
........
  r5359 | bvassche | 2014-03-20 18:10:19 +0200 (Thu, 20 Mar 2014) | 1 line
  
  scst_const.h: Make COMPARE_AND_WRITE definition available for kernel versions 3.6..3.11
........
  r5360 | vlnb | 2014-03-21 03:58:13 +0200 (Fri, 21 Mar 2014) | 3 lines
  
  In VERIFY commands BYTCHK 1x is not supported (yet)
........
  r5361 | bvassche | 2014-03-21 18:29:26 +0200 (Fri, 21 Mar 2014) | 1 line
  
  srpt/Makefile: Avoid that the build process depends on source control tools
........
  r5362 | vlnb | 2014-03-22 01:12:42 +0200 (Sat, 22 Mar 2014) | 3 lines
  
  Fix error recovery of internal commands
........
  r5363 | bvassche | 2014-03-24 13:53:00 +0200 (Mon, 24 Mar 2014) | 1 line
  
  ib_srpt: Clarify a kernel-doc comment
........
  r5364 | bvassche | 2014-03-24 13:55:56 +0200 (Mon, 24 Mar 2014) | 1 line
  
  ib_srpt: Add newline at the end of kernel warning statements
........
  r5365 | bvassche | 2014-03-24 13:57:39 +0200 (Mon, 24 Mar 2014) | 5 lines
  
  ib_srpt: Change the severity level of a log message
  
  Make sure that target port state changes get logged even with
  debugging disabled.
........
  r5366 | bvassche | 2014-03-24 13:59:27 +0200 (Mon, 24 Mar 2014) | 5 lines
  
  ib_srpt: Clean up srpt_destroy_ch_ib()
  
  All callers guarantee that the completion queue is empty so it is
  not necessary to invoke ib_poll_cq() from inside this function.
........
  r5367 | bvassche | 2014-03-24 14:01:07 +0200 (Mon, 24 Mar 2014) | 5 lines
  
  ib_srpt: Micro-optimize srpt_adjust_srq_wr_avail()
  
  The overhead of atomic_add_return() is lower than that of a
  spin_lock() / spin_unlock() pair, hence switch to the former.
........
  r5368 | bvassche | 2014-03-24 14:03:09 +0200 (Mon, 24 Mar 2014) | 20 lines
  
  ib_srpt: Fix a kernel warning
  
  Avoid that the following (very rare) kernel warning is reported
  when an ib_srpt target port is disabled while I/O is ongoing:
  
  WARNING: CPU: 3 PID: 12259 at srpt/src/ib_srpt.c:3334 srpt_xmit_response+0x165/0x300 [ib_srpt]()
  Unexpected command state 6
  Call Trace:
   [<ffffffff814a15dc>] dump_stack+0x4e/0x7a
   [<ffffffff8104bc5d>] warn_slowpath_common+0x7d/0xa0
   [<ffffffff8104bccc>] warn_slowpath_fmt+0x4c/0x50
   [<ffffffffa0771525>] srpt_xmit_response+0x165/0x300 [ib_srpt]
   [<ffffffffa082aacc>] scst_xmit_response+0xbc/0x560 [scst]
   [<ffffffffa083123d>] scst_process_active_cmd+0x29d/0x7b0 [scst]
   [<ffffffffa0832bd9>] scst_do_job_active+0x89/0x1a0 [scst]
   [<ffffffffa0832e4f>] scst_cmd_thread+0x15f/0x350 [scst]
   [<ffffffff810766cd>] kthread+0xed/0x110
   [<ffffffff814b312c>] ret_from_fork+0x7c/0xb0
  ---[ end trace 591f7af7d006fc0e ]---
........
  r5369 | bvassche | 2014-03-24 14:04:44 +0200 (Mon, 24 Mar 2014) | 5 lines
  
  ib_srpt: Add a kernel warning
  
  Invoking srpt_zerolength_write() before the queue pair has reached
  the error state is a bug, so complain loudly if that happens.
........
  r5370 | bvassche | 2014-03-24 14:07:43 +0200 (Mon, 24 Mar 2014) | 7 lines
  
  ib_srpt: Avoid waiting for missing error completions
  
  Apparently with mlx4 firmware up to and including 2.30.8000 it is not
  guaranteed that for a QP associated with an SRQ error completions are
  generated for all pending work requests. Avoid triggering
  srpt_pending_cmd_timeout() for missing error completions.
........
  r5371 | bvassche | 2014-03-25 18:19:00 +0200 (Tue, 25 Mar 2014) | 1 line
  
  nightly build: Update kernel versions
........
  r5382 | vlnb | 2014-03-26 04:31:52 +0200 (Wed, 26 Mar 2014) | 6 lines
  
  Black hole functionality added
  
  Scst_mutex intentially used directly in the sysfs handler, because
  comming sysfs improvements will allow that.
........
  r5383 | vlnb | 2014-03-26 05:18:03 +0200 (Wed, 26 Mar 2014) | 5 lines
  
  documentation: Document SCST_SERIALIZED and SCST_STRICTLY_SERIALIZED
  
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5384 | vlnb | 2014-03-26 05:18:36 +0200 (Wed, 26 Mar 2014) | 3 lines
  
  Cleanup
........
  r5385 | vlnb | 2014-03-26 05:20:04 +0200 (Wed, 26 Mar 2014) | 9 lines
  
  scst_local: Remove two superfluous tests
  
  The to_scst_lcl_sess() macro is based on container_of() and hence never
  returns NULL. Hence remove the two tests that compare the result of that
  macro against NULL.
  
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5386 | vlnb | 2014-03-26 05:21:25 +0200 (Wed, 26 Mar 2014) | 7 lines
  
  iscsi-scst: Introduce ARRAY_SIZE()
  
  This patch does not change any functionality.
  
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5387 | vlnb | 2014-03-26 05:22:16 +0200 (Wed, 26 Mar 2014) | 8 lines
  
  scst: Clarify a comment
  
  The comment above scst_nexus_loss() is somewhat confusing so change
  it into something that is more clear.
  
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5388 | vlnb | 2014-03-26 05:23:57 +0200 (Wed, 26 Mar 2014) | 9 lines
  
  scst_vdisk: Fix READ CAPACITY(10)
  
  SBC-2 defines the LBA as a 32-bit field that starts at offset 2 and
  not as a 64-bit field.
  
  Reported-by: Mike Christie <michaelc@cs.wisc.edu>
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........
  r5389 | bvassche | 2014-03-26 13:56:13 +0200 (Wed, 26 Mar 2014) | 4 lines
  
  ib_srpt: Clean up srpt_handle_rdma_comp()
  
  This patch does not change any functionality.
........
  r5390 | bvassche | 2014-03-26 13:56:59 +0200 (Wed, 26 Mar 2014) | 4 lines
  
  ib_srpt: Clean up srpt_handle_send_err_comp()
  
  This patch does not change any functionality.
........
  r5391 | bvassche | 2014-03-26 13:58:25 +0200 (Wed, 26 Mar 2014) | 4 lines
  
  ib_srpt: Clean up srpt_handle_rdma_err_comp()
  
  This patch does not change any functionality.
........
  r5392 | bvassche | 2014-03-26 13:59:37 +0200 (Wed, 26 Mar 2014) | 5 lines
  
  ib_srpt: Suppress superfluous error messages
  
  Only complain about a missing completion for I/O contexts that are
  in a state where the ib_srpt driver is waiting for the HCA.
........
  r5393 | bvassche | 2014-03-26 14:00:43 +0200 (Wed, 26 Mar 2014) | 5 lines
  
  ib_srpt: Make srpt_abort_cmd() state checks more strict
  
  Complain if srpt_abort_cmd() is called for an I/O context that is
  being processed by SCST and not by the HCA.
........
  r5394 | vlnb | 2014-03-27 00:16:16 +0200 (Thu, 27 Mar 2014) | 3 lines
  
  Cosmetics
........
  r5395 | vlnb | 2014-03-27 01:51:36 +0200 (Thu, 27 Mar 2014) | 3 lines
  
  Reimplement dropping of TM requests in a more reliable manner
........
  r5396 | vlnb | 2014-03-27 03:57:08 +0200 (Thu, 27 Mar 2014) | 3 lines
  
  Possibility to specify SCSI target device name added
........
  r5397 | bvassche | 2014-03-27 10:27:45 +0200 (Thu, 27 Mar 2014) | 6 lines
  
  Fix two checkpatch complaints about whitespace
  
  Avoid that checkpatch reports the following error message:
  
  ERROR: "(foo*)" should be "(foo *)"
........
  r5398 | bvassche | 2014-03-27 10:34:27 +0200 (Thu, 27 Mar 2014) | 6 lines
  
  Avoid that checkpatch complains that return is not a function
  
  Avoid that checkpatch reports the following error message:
  
  ERROR: return is not a function, parentheses are not required
........
  r5399 | bvassche | 2014-03-27 10:39:53 +0200 (Thu, 27 Mar 2014) | 1 line
  
  scripts/generate-kernel-patch: Fix for kernel versions 3.7, 3.10, 3.12 and 3.13
........
  r5400 | vlnb | 2014-03-29 04:07:22 +0300 (Sat, 29 Mar 2014) | 3 lines
  
  Cleanup
........
  r5401 | bvassche | 2014-04-01 20:46:36 +0300 (Tue, 01 Apr 2014) | 1 line
  
  vdisk_blockio: Temporarily disable COMPARE AND WRITE support
........
  r5402 | bvassche | 2014-04-02 00:05:31 +0300 (Wed, 02 Apr 2014) | 1 line
  
  vdisk_blockio: Fix the (recently enabled) VERIFY command
........
  r5403 | bvassche | 2014-04-03 18:58:16 +0300 (Thu, 03 Apr 2014) | 1 line
  
  ib_srpt: RHEL 6.5 build fix
........
  r5404 | vlnb | 2014-04-04 03:57:30 +0300 (Fri, 04 Apr 2014) | 3 lines
  
  Fix typo in scst_report_supported_tm_fns() reported by Steve Magnani <steve.magnani@digidescorp.com>
........
  r5405 | bvassche | 2014-04-04 07:38:33 +0300 (Fri, 04 Apr 2014) | 1 line
  
  scripts/specialize-patch: Handle numbers surrounded by parentheses properly
........
  r5406 | bvassche | 2014-04-04 08:50:52 +0300 (Fri, 04 Apr 2014) | 1 line
  
  scripts/specialize-patch: Rework r5405
........
  r5407 | bvassche | 2014-04-04 08:56:25 +0300 (Fri, 04 Apr 2014) | 1 line
  
  nightly build: Update kernel versions
........


git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5408 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-06 08:13:25 +00:00

222 lines
7.3 KiB
Bash

# -*- mode: shell-script -*-
# Shell functions for parsing the Linux kernel version and for downloading
# from kernel.org.
kernel_mirror="ftp://ftp.kernel.org/pub/linux/kernel"
kernel_longterm="http://www.kernel.org/pub/linux/kernel"
kernel_sources="$HOME/software/downloads"
# Kernel version number.
function kernel_version {
if [ "${1#2.}" != "$1" ]; then
echo "$1" | sed -n 's/^\([0-9]*\.[0-9]*\.[0-9]*\).*$/\1/p'
else
echo "$1" | sed -n 's/^\([0-9]*\.[0-9]*\).*$/\1/p'
fi
}
# Last component of the kernel version, or the empty string if $1 does
# not contain a patchlevel.
function patchlevel {
if [ "${1#2.}" != "$1" ]; then
echo "$1" | sed -n 's/^\([0-9]*\.[0-9]*\.[0-9]*\)[.-]\(.*\)$/\2/p'
else
echo "$1" | sed -n 's/^\([0-9]*\.[0-9]*\)[.-]\(.*\)$/\2/p'
fi
}
# Download the file from URL $1 and save it in the current directory.
function download_file {
if [ ! -e "$(basename "$1")" ]; then
if [ "${quiet_download}" = "false" ]; then
{ wget -q -nc -O- "$1" 2>/dev/null | grep -q .; } \
&& echo "Downloading $1 ..."
fi
wget -q -nc "$1"
fi
[ -e "$(basename "$1")" ]
}
# Make sure the kernel tarball and patch file are present in directory
# ${kernel_sources}. Download any missing files from ${kernel_mirror}.
function download_kernel {
local kver="$(kernel_version $1)"
local plevel="$(patchlevel $1)"
local series="$1"
if [ "${series:0:2}" = "3." ]; then
series="3.x"
else
series="${series:0:3}"
fi
mkdir -p "${kernel_sources}" || return $?
test -w "${kernel_sources}" || return $?
(
cd "${kernel_sources}" || return $?
if [ "$plevel" = "" ] \
|| download_file "${kernel_mirror}/v$series/patch-$1.xz" \
|| download_file "${kernel_mirror}/v$series/longterm/v${kver}/patch-$1.xz"
then
download_file "${kernel_mirror}/v$series/linux-${kver}.tar.xz" \
|| download_file "${kernel_mirror}/v$series/longterm/v${kver}/linux-${kver}.tar.xz" \
|| return $?
else
download_file "${kernel_mirror}/v$series/linux-$1.tar.xz" \
|| download_file "${kernel_mirror}/v$series/longterm/v${kver}/linux-$1.tar.xz" \
|| return $?
fi
)
}
function extract_kernel_archive {
if [ -e "${kernel_sources}/linux-$1.tar.xz" ]; then
xz -cd "${kernel_sources}/linux-$1.tar.xz" | tar xf -
else
tar xjf "${kernel_sources}/linux-$1.tar.bz2"
fi
}
# Create a linux-$1 tree in the current directory, where $1 is a kernel
# version number with either three or four components.
function extract_kernel_tree {
local kver="$(kernel_version $1)"
local plevel="$(patchlevel $1)"
local tmpdir=kernel-tree-tmp-$$
rm -rf "linux-$1" "${tmpdir}"
mkdir "${tmpdir}" || return $?
(
cd "${tmpdir}" || return $?
if [ "$plevel" != "" -a -e "${kernel_sources}/patch-$1.xz" ]; then
extract_kernel_archive $kver || return $?
mv linux-$kver linux-$1
( cd linux-$1 && xz -cd "${kernel_sources}/patch-$1.xz" \
| patch -p1 -f -s; ) \
|| return $?
else
extract_kernel_archive $1 || return $?
fi
mv "linux-$1" ".." || return $?
cd "../linux-$1" || return $?
if [ "$1" = "2.6.29" -o "$1" = "2.6.29.1" -o "$1" = "2.6.29.2" -o "$1" = "2.6.29.3" ]
then
patch -f -s -p1 <<'EOF'
Make sure that branch profiling does not trigger sparse warnings.
See also http://bugzilla.kernel.org/show_bug.cgi?id=12925
---
See also http://lkml.org/lkml/2009/4/5/120
--- orig/linux-2.6.29/include/linux/compiler.h 2009-03-23 19:12:14.000000000 -0400
+++ linux-2.6.29/include/linux/compiler.h 2009-03-24 08:46:46.000000000 -0400
@@ -75,7 +75,8 @@ struct ftrace_branch_data {
* Note: DISABLE_BRANCH_PROFILING can be used by special lowlevel code
* to disable branch tracing on a per file basis.
*/
-#if defined(CONFIG_TRACE_BRANCH_PROFILING) && !defined(DISABLE_BRANCH_PROFILING)
+#if defined(CONFIG_TRACE_BRANCH_PROFILING) \
+ && !defined(DISABLE_BRANCH_PROFILING) && !defined(__CHECKER__)
void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect);
#define likely_notrace(x) __builtin_expect(!!(x), 1)
EOF
fi
if [ "${1#2.6.31}" != "$1" ]
then
patch -f -s -p1 <<'EOF'
Checking a 2.6.31.1 kernel configured with allyesconfig/allmodconfig
with sparse (make C=2) triggers a sparse warning on code that uses the
kmemcheck_annotate_bitfield() macro. An example of such a warning:
include/net/inet_sock.h:208:17: warning: do-while statement is not a compound statement
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Cc: Vegard Nossum <vegardno@ifi.uio.no>
Cc: Andrew Morton <akpm@linux-foundation.org>
---
See also http://lkml.org/lkml/2009/9/26/51
--- linux-2.6.31.1/include/linux/kmemcheck-orig.h 2009-09-26 13:53:44.000000000 +0200
+++ linux-2.6.31.1/include/linux/kmemcheck.h 2009-09-26 13:53:56.000000000 +0200
@@ -137,13 +137,13 @@ static inline void kmemcheck_mark_initia
int name##_end[0];
#define kmemcheck_annotate_bitfield(ptr, name) \
- do if (ptr) { \
+ do { if (ptr) { \
int _n = (long) &((ptr)->name##_end) \
- (long) &((ptr)->name##_begin); \
BUILD_BUG_ON(_n < 0); \
\
kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \
- } while (0)
+ } } while (0)
#define kmemcheck_annotate_variable(var) \
do { \
EOF
fi
if [ "${1#2.6.32}" != "$1" -o "${1#2.6.33}" != "$1" ]
then
patch -f -s -p1 <<'EOF'
Get rid of sparse errors on sk_buff.protocol.
--- linux/include/linux/skbuff-orig.h 2010-12-07 13:40:51.000000000 -0500
+++ linux/include/linux/skbuff.h 2010-12-07 13:41:05.000000000 -0500
@@ -349,8 +349,8 @@ struct sk_buff {
ipvs_property:1,
peeked:1,
nf_trace:1;
- __be16 protocol:16;
kmemcheck_bitfield_end(flags1);
+ __be16 protocol;
void (*destructor)(struct sk_buff *skb);
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
EOF
fi
if [ "${1#3.13}" != "$1" ]; then
if [ "$1" = "3.13" ] || [ "${1#3.13.}" -lt 6 ]; then
patch -f -s -p1 <<'EOF'
From 7b4ec8dd7d4ac467e9eee4d49f2c9574d773efbb Mon Sep 17 00:00:00 2001
From: Johannes Berg <johannes.berg@intel.com>
Date: Thu, 16 Jan 2014 10:18:48 +1030
Subject: [PATCH] export: declare ksymtab symbols
sparse complains about any __ksymtab symbols with the following:
warning: symbol '__ksymtab_...' was not declared. Should it be static?
due to Andi's patch making it non-static.
Mollify sparse by declaring the symbol extern, otherwise we get
drowned in sparse warnings for anything that uses EXPORT_SYMBOL
in the sources, making it easy to miss real warnings.
Fixes: e0f244c63fc9 ("asmlinkage, module: Make ksymtab [...] __visible")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
include/linux/export.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/linux/export.h b/include/linux/export.h
index 3f2793d..96e45ea 100644
--- a/include/linux/export.h
+++ b/include/linux/export.h
@@ -59,6 +59,7 @@ extern struct module __this_module;
static const char __kstrtab_##sym[] \
__attribute__((section("__ksymtab_strings"), aligned(1))) \
= VMLINUX_SYMBOL_STR(sym); \
+ extern const struct kernel_symbol __ksymtab_##sym; \
__visible const struct kernel_symbol __ksymtab_##sym \
__used \
__attribute__((section("___ksymtab" sec "+" #sym), unused)) \
EOF
fi
fi
)
rmdir "${tmpdir}"
}