Andrew Vasquez [Mon, 8 Oct 2012 07:13:26 +0000 (12:43 +0530)]
qla2xxx: Use correct Request-Q-Out register during bidirectional request processing
Original code was not corrected for ISP83xx support. Instead code should used
the cached reference from the req_que structure, rather than the legacy
'if (ISP-TYPE(X))... else if (ISP-TYPE(Y))...' codes.
JIRA Key: V2632FC-284
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com> Acked-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Acked-by: Atul Deshmukh <atul.deshmukh@qlogic.com> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Jerry Snitselaar <jerry.snitselaar@oracle.com>
David Jeffery [Thu, 11 Oct 2012 00:09:24 +0000 (05:39 +0530)]
qla2xxx: Test and clear FCPORT_UPDATE_NEEDED atomically.
When the qla2xxx driver loses access to multiple, remote ports, there is a race
condition which can occur which will keep the request stuck on a scsi request
queue indefinitely.
While testing path loss, a customer encountered a case where the loss of the FC
connection could result in a process which sent a command through the sg driver
becoming hung and unresponsive. It had sent a command to one of the now
unreachable LUNs, and the command and its request never completes.
But this isn't a case of the target and LUNs being blocked. From a vmcore, the
FC transport still considered the port as in a working, FC_PORTSTATE_ONLINE
state. Instead, the request was on the queue, but the target structure was in
blocked state. qla2xxx's queuecommand function was returning
SCSI_MLQUEUE_TARGET_BUSY, causing the request to keep being requeued and retried
without ever advancing. The qla2xxx driver was rejecting the command with
SCSI_MLQUEUE_TARGET_BUSY because its internal port state for this port was in
FCS_DEVICE_LOST state. This should not happen. qla2xxx should not think the
port is lost while the fc transport thinks the device is in good, working order.
This bad state occurred do to a race condition with how the FCPORT_UPDATE_NEEDED
bit is set in qla2x00_schedule_rport_del(), and how it is cleared in
qla2x00_do_dpc(). The problem port has its drport pointer set, but it has never
been processed by the driver to inform the fc transport that the port has been
lost. qla2x00_schedule_rport_del() sets drport, and then sets the
FCPORT_UPDATE_NEEDED bit. In qla2x00_do_dpc(), the port lists are walked and
any drport pointer is handled and the fc transport informed of the port loss,
then the FCPORT_UPDATE_NEEDED bit is cleared. This leaves a race where the
dpc thread is processing one port removal, another port removal is marked
with a call to qla2x00_schedule_rport_del(), and the dpc thread clears the
bit for both removals, even though only the first removal was actually
handled. Until another event occurs to set FCPORT_UPDATE_NEEDED, the later
port removal is never finished and qla2xxx stays in a bad state which causes
requests to become stuck on request queues.
The attached patch updates the driver to test and clear FCPORT_UPDATE_NEEDED
atomically. This ensures the port state changes are processed and not lost.
If a race occurs, the dpc thread will walk the ports an extra time as
FCPORT_UPDATE_NEEDED will have become set again.
JIRA Key: V2632FC-283
Acked-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Acked-by: Armen Baloyan <armen.baloyan@qlogic.com> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Jerry Snitselaar <jerry.snitselaar@oracle.com>
Maxim Uvarov [Thu, 29 Nov 2012 07:23:49 +0000 (23:23 -0800)]
ip_options: git meerge fix: do not duplicate setting of daddr
Orabug: 15929855
Git merge duplicated line of setting daddr. This is not critical
but doing clean up here. Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
Dmitry Monakhov [Wed, 10 Oct 2012 05:04:58 +0000 (01:04 -0400)]
ext4: race-condition protection for ext4_convert_unwritten_extents_endio
Orabug: 14774219
This fixes: CVE-2012-4508
We assumed that at the time we call ext4_convert_unwritten_extents_endio()
extent in question is fully inside [map.m_lblk, map->m_len] because
it was already split during submission. But this may not be true due to
a race between writeback vs fallocate.
If extent in question is larger than requested we will split it again.
Special precautions should being done if zeroout required because
[map.m_lblk, map->m_len] already contains valid data.
NeilBrown [Wed, 31 Oct 2012 01:16:01 +0000 (12:16 +1100)]
NFS: fix bug in legacy DNS resolver.
Orabug: 14769650
The DNS resolver's use of the sunrpc cache involves a 'ttl' number
(relative) rather that a timeout (absolute). This confused me when
I wrote
commit c5b29f885afe890f953f7f23424045cdad31d3e4
"sunrpc: use seconds since boot in expiry cache"
and I managed to break it. The effect is that any TTL is interpreted
as 0, and nothing useful gets into the cache.
This patch removes the use of get_expiry() - which really expects an
expiry time - and uses get_uint() instead, treating the int correctly
as a ttl.
This fixes a regression that has been present since 2.6.37, causing
certain NFS accesses in certain environments to incorrectly fail.
Reported-by: Chuck Lever <chuck.lever@oracle.com> Tested-by: Chuck Lever <chuck.lever@oracle.com> Cc: stable@vger.kernel.org Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Prarit Bhargava [Tue, 8 May 2012 13:08:02 +0000 (09:08 -0400)]
[libata] Add " 2GB ATA Flash Disk"/"ADMA428M" to DMA blacklist
Orabug: 15929836
A user has several systems with a couple of models of flash disks with IDE
connectors. These disks work fine in 2.6.18-ish kernels but corrupt data on
new kernels.
The difference appears to be with the default I/O method used by the IDE
controller driver between the kernels. In the older kernels, the
configuration is very conservative and the driver stays in PIO mode. With
new kernels, the ata driver (pata_serverworks) attempts to use UDMA/66
which the drive claims to support. This mode, however, does not appear to
work in DMA mode. The drive does work correctly and no corruption is
seen if the kernel parameter "libata.force=5:pio0,6:pio0" is used to force
the driver to use PIO instead of DMA mode.
Blacklist these drives. Unfortunately the model name of the drive is very
generic, " 2GB ATA Flash Disk", but the revision is specific, "ADMA428M".
Signed-off-by: Prarit Bhargava <prarit@redhat.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
(cherry picked from commit d70e551c8e1ecb6f20422f8db6bfe6a0049edcb8)
Steve Dickson [Wed, 6 Jun 2012 18:12:07 +0000 (14:12 -0400)]
NFS: Map minor mismatch error to protocol not support error.
Orabug: 15929836
Sservers that only have NFSv4.1 support the
NFS4ERR_MINOR_VERS_MISMATCH error is return on
v4.0 mounts. Mapping that error to EPROTONOSUPPORT
will cause the mount to back off to v3 instead of
failing.
Signed-off-by: Steve Dickson <steved@redhat.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
(cherry picked from commit f25efd851cc8c0f63d74334bc784a437f4df8ee4)
broke VLAN tagging on outbound packets.
It ifdef'ed BCM_KERNEL_SUPPORTS_8021Q, but this
is not set anywhere. So vlan never gets set, and
all packets are sent with vlan=0.
v2: We can just remove the test. vlan_tx_tag_present
is valid regardless of whether the 802.1q module
is built.
Tested on BCM5721 rev 11.
Signed-off-by: Kasper Pedersen <kernel@kasperkp.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 5c1e688388f629e8d8e88183b5ebc21e209252aa)
ext4: Fix overflow caused by missing cast in ext4_fallocate()
Orabug: 15929836
The logical block number in map.l_blk is a __u32, and so before we
shift it left, by the block size, we neeed cast it to a 64-bit size.
Otherwise i_size can be corrupted on an ENOSPC.
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/sda6 ext4 9843276 153056 9190200 2% /mnt/mp1
fallocate: /mnt/mp1/testfile: fallocate failed: No space left on device
File: `/mnt/mp1/testfile'
Size: 4293656576 Blocks: 19380440 IO Block: 4096 regular file
Device: 806h/2054d Inode: 12 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2011-07-25 13:01:31.414490496 +0900
Modify: 2011-07-25 13:01:31.414490496 +0900
Change: 2011-07-25 13:01:31.454490495 +0900
Martin K. Petersen [Wed, 28 Nov 2012 14:36:23 +0000 (06:36 -0800)]
oracleasm: Introduce module parameter for block size selection
Orabug: 15924773
We have encountered a few devices which after a firmware update
communicate different characteristics to the OS. In particular, some
devices begin to report their physical block size. This in turn will
cause oracleasm to report a different block size to ASM and mounting the
disk group will fail.
Introduce a module parameter which permits the logical block size to be
reported instead of the physical.
Signed-off-by: Martin K. Petersen<martin.petersen@oracle.com>
The request_firmware interface can induce delays while looking
for firmware files, even if no fw file is present. In some situations
the delays exceeded scan_wait timeouts, resulting in situations in which
the boot device had not been discovered in time. Boot Device does not
need to be on a lpfc device.
Change request_firmware use to be module paramater driven. Default is to
not attempt firmware download on boot. Add sysfs parameter to invoke
firmware update.
Signed-off-by: James Smart <james.smart@emulex.com>
Paul Clements [Mon, 17 Sep 2012 21:09:02 +0000 (14:09 -0700)]
nbd: clear waiting_queue on shutdown
Bug-db: 13690
Backport upstream commit: fded4e090c60100d709318896c79816d68d5b47d
Fix a serious but uncommon bug in nbd which occurs when there is heavy
I/O going to the nbd device while, at the same time, a failure (server,
network) or manual disconnect of the nbd connection occurs.
There is a small window between the time that the nbd_thread is stopped
and the socket is shutdown where requests can continue to be queued to
nbd's internal waiting_queue. When this happens, those requests are
never completed or freed.
The fix is to clear the waiting_queue on shutdown of the nbd device, in
the same way that the nbd request queue (queue_head) is already being
cleared.
Signed-off-by: Paul Clements <paul.clements@steeleye.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@oracle.com>
Conflicts:
drivers/block/nbd.c
Jason Luan [Thu, 22 Nov 2012 01:42:32 +0000 (09:42 +0800)]
kernel posttrans remove all crashkernel=*
Orabug: 15882974
kernel posttrans's script will call new-kernel-page (which will call grubby endly) with
the paramter --remove-args="crashkernel=auto", and grubby remove-args will ingore the
parts after '=' and remove all crashkernel=<*>. So some manually corrent config, such
as crashkernel=128M@, will be removed.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Cc: Shreyas Bhatewara <sbhatewara@vmware.com> Cc: "VMware, Inc." <pv-drivers@vmware.com> Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
dev_open() can complete before register_netdev() returns.
Fix vmxnet3_probe_device() to support this.
Signed-off-by: Steve Hodgson <steve@purestorage.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
Change logging of failure to enable MSI/MSI-X to display device's PCI
address instead of eth%d. Rectify a typo.
Signed-off-by: Shreyas N Bhatewara <sbhatewara@vmware.com> Reviewed-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
Correct spelling in "uncommited" to "uncommitted" in
drivers/net/vmxnet3/vmxnet3_drv.c
Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
Use existing helpers to clarify skb headers manipulation.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Cc: Shreyas Bhatewara <sbhatewara@vmware.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Conflicts:
drivers/net/vmxnet3/vmxnet3_drv.c
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
All tables of function pointers should be const to make hacks
more difficult. Compile tested only.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Acked-by: Shreyas N Bhatewara <sbhatewara@vmware.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
Per discussion with Ben Hutchings and David Miller, go through and
remove assignments of "N/A" to fw_version in various drivers'
.get_drvinfo routines. While there clean-up some use of bare
constants and such.
Signed-off-by: Rick Jones <rick.jones2@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
vmxnet3 allocates a page per skb fragment. We must account
PAGE_SIZE increments on skb->truesize, not the actual frag length.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> CC: Shreyas Bhatewara <sbhatewara@vmware.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
The vmxnet3 driver enables vlan filters if filtering is enabled for
any vlan. In promiscuous mode the filter table is cleared to in
order to disable filtering. However, if a vlan device is subsequently
created that vlan will be added to the filter, re-engaging it. As a
result, not only do we not see all the vlans in promiscuous mode, we
don't even see vlans for which a filter was previously created.
CC: Scott J. Goldman <scottjg@vmware.com> CC: Shreyas Bhatewara <sbhatewara@vmware.com> CC: VMware PV-Drivers <pv-drivers@vmware.com> Signed-off-by: Jesse Gross <jesse@nicira.com> Signed-off-by: Shreyas N Bhatewara <sbhatewara@vmware.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Conflicts:
drivers/net/vmxnet3/vmxnet3_drv.c
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
Cathy Avery [Tue, 13 Nov 2012 15:05:58 +0000 (10:05 -0500)]
Added suspend and resume support
Orabug: 14801157
The ovmapi driver was not supporting power management suspend and resume
and therefore was not supporting vm migration. Added call backs to support
syscore_ops suspend and resume. Signed-off-by: Cathy Avery <cathy.avery@oracle.com>
Jan H. Schönherr [Tue, 19 Jul 2011 19:10:26 +0000 (21:10 +0200)]
rcu: Fix wrong check in list_splice_init_rcu()
If the list to be spliced is empty, then list_splice_init_rcu() has
nothing to do. Unfortunately, list_splice_init_rcu() does not check
the list to be spliced; it instead checks the list to be spliced into.
This results in memory leaks given current usage. This commit
therefore fixes the empty-list check.
Signed-off-by: Jan H. Schönherr <schnhrr@cs.tu-berlin.de> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
(cherry picked from commit 7f70893173b056df691b2ee7546bb44fd9abae6a)
Jeff Mahoney [Tue, 4 Oct 2011 03:23:14 +0000 (23:23 -0400)]
btrfs: ->submit_bio_hook error push-up
This pushes failures from the submit_bio_hook callbacks,
btrfs_submit_bio_hook and btree_submit_bio_hook into the callers, including
callers of submit_one_bio where it catches the failures with BUG_ON.
It also pushes up through the ->readpage_io_failed_hook to
end_bio_extent_writepage where the error is already caught with BUG_ON.
Mark Fasheh [Mon, 8 Aug 2011 20:20:18 +0000 (13:20 -0700)]
btrfs: Don't BUG_ON() errors in update_ref_for_cow()
The only caller of update_ref_for_cow() is __btrfs_cow_block() which was
originally ignoring any return values. update_ref_for_cow() however doesn't
look like a candidate to become a void function - there are a few places
where errors can occur.
So instead I changed update_ref_for_cow() to bubble all errors up (instead
of BUG_ON). __btrfs_cow_block() was then updated to catch and BUG_ON() any
errors from update_ref_for_cow(). The end effect is that we have no change
in behavior, but about 8 different places where a BUG_ON(ret) was removed.
Obviously a future patch will have to address the BUG_ON() in
__btrfs_cow_block().
Jeff Mahoney [Thu, 1 Mar 2012 13:57:30 +0000 (14:57 +0100)]
btrfs: add varargs to btrfs_error
btrfs currently handles most errors with BUG_ON. This patch is a work-in-
progress but aims to handle most errors other than internal logic
errors and ENOMEM more gracefully.
This iteration prevents most crashes but can run into lockups with
the page lock on occasion when the timing "works out."
Fix out-of-space checking, addressing a warning and potential resource
leak when resizing the filesystem down while allocating blocks.
Signed-off-by: Daniel J Blueman <daniel@quora.org> Reviewed-by: Josef Bacik <josef@redhat.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit 7654b72417e10e294563496e25211200f9b8b6d3)
Li Zefan [Tue, 21 Feb 2012 09:04:28 +0000 (17:04 +0800)]
Btrfs: avoid setting ->d_op twice
Follow those instructions, and you'll trigger a warning in the
beginning of d_set_d_op():
# mkfs.btrfs /dev/loop3
# mount /dev/loop3 /mnt
# btrfs sub create /mnt/sub
# btrfs sub snap /mnt /mnt/snap
# touch /mnt/snap/sub
touch: cannot touch `tmp': Permission denied
__d_alloc() set d_op to sb->s_d_op (btrfs_dentry_operations), and
then simple_lookup() reset it to simple_dentry_operations, which
triggered the warning.
Jeff Mahoney [Mon, 12 Mar 2012 15:03:00 +0000 (16:03 +0100)]
btrfs: replace many BUG_ONs with proper error handling
btrfs currently handles most errors with BUG_ON. This patch is a work-in-
progress but aims to handle most errors other than internal logic
errors and ENOMEM more gracefully.
This iteration prevents most crashes but can run into lockups with
the page lock on occasion when the timing "works out."
The 'page size' for PCIe DMA, i.e. the alignment of boundaries at
which DMA must be broken, is 4KB. Name this value as EFX_PAGE_SIZE
and use it in efx_max_tx_len(). Redefine EFX_BUF_SIZE as
EFX_PAGE_SIZE since its value is also a result of that requirement,
and use it in efx_init_special_buffer().
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Orabug: 14769994 Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
(cherry picked from commit 0d66c9ee8813a35eb5ce78ac0b2fb0286cd088ea)
Tej Parkash [Fri, 9 Nov 2012 09:41:15 +0000 (15:11 +0530)]
qla4xxx: Disable generating pause frames for ISP83XX
In case of FW hung ISP83XX generates continuous pause frames
which causes switch to disable port.
Added fix to disable generating pause frames in case of
FW hung
Signed-off-by: Tej Parkash <tej.parkash@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
qla4xxx: Fix double clearing of risc_intr for ISP83XX
Issue:
For ISP83XX risc_intr getting clear two times in case of polling mode.
risc_intr getting clear from interrupt_service_routine() as well
from process_mbox_intr() because of this driver may clear risc_intr
without processing interrupt.
Fix:
Do not clear risc_intr from process_mbox_intr().
Signed-off-by: Manish Dusane <manish.dusane@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit dcb69474a79b5317c72414d4ba919dd442644a79)
qla4xxx: Fail probe_adapter if IRQ allocation fails
If IRQ allocation fails, it means system has run out of interrupt
vectors, so fail probe_adapter in case of IRQ allocation failure
and dont retry adapter initialization.
Signed-off-by: Poornima Vonti <poornima.vonti@qlogic.com> Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit a5d0ef50abf7a0fb3a1df4f731824695c36dede1)
Camram is reset by FW to default values after reboot/cold boot/pci reset.
In case of AER, PCI may need to reset so we need to set correct idc reg value
after PCIE error.
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit 45b3b5e2e83a1f70b29a671a060ad3154a22481d)
Vikas Chaudhary [Wed, 22 Aug 2012 11:55:06 +0000 (07:55 -0400)]
qla4xxx: Set IDC version in correct way
Issue:
Device can go to READY state from COLD and skip INITIALIZATION,
In this case driver will never set IDC version from function
qla4_8xxx_device_bootstrap().
Fix:
1. Set IDC version at start of function qla4_82xx_need_reset_handler().
2. Set IDC version only if we are 1st driver to load.
3. Added new function qla4_8xxx_update_idc_reg() to set all idc reg at one
place.
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
(cherry picked from commit aaeef189498373e5d2a34d88002c0bd3308ccda2)
Vikas Chaudhary [Wed, 22 Aug 2012 11:45:25 +0000 (07:45 -0400)]
qla4xxx: Clear interrupt while unloading driver.
while processing the stop firmware mailbox command on driver unload,
a interrupt is processed which causes kernel panic as the response
queue is not valid.
Fix is to clear the interrupt in free_adapter call just after
disabling the interrupts.
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>