]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
13 years agooracleasm: Fix two merge errors
Martin K. Petersen [Wed, 28 Dec 2011 19:42:23 +0000 (14:42 -0500)]
oracleasm: Fix two merge errors

Fix two bugs introduced while bringing oracleasm up to date with
mainline.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
13 years agox86/numa: Add constraints check for nid parameters
Petr Holasek [Thu, 8 Dec 2011 12:16:41 +0000 (13:16 +0100)]
x86/numa: Add constraints check for nid parameters

Orabug: 13522802
This patch adds constraint checks to the numa_set_distance()
function.

When the check triggers (this should not happen normally) it
emits a warning and avoids a store to a negative index in
numa_distance[] array - i.e. avoids memory corruption.

Negative ids can be passed when the pxm-to-nids mapping is not
properly filled while parsing the SRAT.

Signed-off-by: Petr Holasek <pholasek@redhat.com>
Acked-by: David Rientjes <rientjes@google.com>
Cc: Anton Arapov <anton@redhat.com>
Link: http://lkml.kernel.org/r/20111208121640.GA2229@dhcp-27-244.brq.redhat.com
Signed-off-by: Ingo Molnar <mingo@elte.hu>
13 years agoSPEC: v2.6.39-100.0.18
Guru Anbalagane [Mon, 19 Dec 2011 07:55:56 +0000 (23:55 -0800)]
SPEC: v2.6.39-100.0.18
Signed-off-by: Guru Anbalagane <guru.anbalagane@oracle.com>
13 years agoMerge branch 'v2.6.39-100.0.17.bug13459661_13465921' of git://ca-git.us.oracle.com...
Guru Anbalagane [Mon, 19 Dec 2011 07:09:07 +0000 (23:09 -0800)]
Merge branch 'v2.6.39-100.0.17.bug13459661_13465921' of git://ca-git.us.oracle.com/linux-chander-public into uek2-stable

Conflicts:
drivers/scsi/be2iscsi/be_main.c

Signed-off-by: Guru Anbalagane <guru.anbalagane@oracle.com>
13 years agoqlcnic driver v5.0.25.1 for UEK2 2.6.39
Chuck Anderson [Sat, 17 Dec 2011 04:14:35 +0000 (20:14 -0800)]
qlcnic driver v5.0.25.1 for UEK2 2.6.39

Dec. 16, 2011
Oracle bugzilla 13251
Oracle bug 13459661
qlcnic driver v5.0.25.1 submission for Uek R2(2.6.39)
sritej.velaga@qlogic.com

Ported driver version 5.0.25.1 to UEK2 2.6.39-100.0.17

Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
13 years agobe2iscsi 4.1.239.0 [PATCH 10/10] Fix in the ASYNC PDU handling code path.
Chuck Anderson [Sat, 17 Dec 2011 04:09:11 +0000 (20:09 -0800)]
be2iscsi 4.1.239.0 [PATCH 10/10]  Fix in the ASYNC PDU handling code path.

Dec. 16, 2011
Oracle bugzilla 13257
Oracle bug 13465921
be2iscsi HBA driver v4.1.239.0 patch set for UEK R2(2.6.39)
jayamohan.kallickal@emulex.com

Ported driver version 4.1.239.0 to UEK2 2.6.39-100.0.17 (was 2.103.298.0)

---
 be_main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
13 years agobe2iscsi 4.1.239.0 [PATCH 09/10] Move driver Version to 4.1.239.0
Chuck Anderson [Sat, 17 Dec 2011 04:08:48 +0000 (20:08 -0800)]
be2iscsi 4.1.239.0 [PATCH 09/10]  Move driver Version to 4.1.239.0

Dec. 16, 2011
Oracle bugzilla 13257
Oracle bug 13465921
be2iscsi HBA driver v4.1.239.0 patch set for UEK R2(2.6.39)
jayamohan.kallickal@emulex.com

Ported driver version 4.1.239.0 to UEK2 2.6.39-100.0.17 (was 2.103.298.0)

Comments from the patch headers:

 Commit ID : 1379c254ec5f9152a6d8c2026142b926d4c6b24c
 [SCSI] be2iscsi: Move driver Version to 4.1.239.0
---
 be_main.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
13 years agobe2iscsi 4.1.239.0 [PATCH 08/10] memset wrb for ring create
Chuck Anderson [Sat, 17 Dec 2011 04:08:02 +0000 (20:08 -0800)]
be2iscsi 4.1.239.0 [PATCH 08/10]   memset wrb for ring create

Dec. 16, 2011
Oracle bugzilla 13257
Oracle bug 13465921
be2iscsi HBA driver v4.1.239.0 patch set for UEK R2(2.6.39)
jayamohan.kallickal@emulex.com

Ported driver version 4.1.239.0 to UEK2 2.6.39-100.0.17 (was 2.103.298.0)

Comments from the patch headers:

  Commit ID : 37609766bf0f84b65b2181c17a7490eef139cdd1
  [SCSI] be2iscsi: memset wrb for ring create

     This patch fixes a situation when  wrb was not being memset to zero
 before being used
---
 be_cmds.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
13 years agobe2iscsi 4.1.239.0 [PATCH 07/10] Fix for case where task->sc was cleanedup earlier
Chuck Anderson [Sat, 17 Dec 2011 04:07:40 +0000 (20:07 -0800)]
be2iscsi 4.1.239.0 [PATCH 07/10]  Fix for case where task->sc was cleanedup earlier

Dec. 16, 2011
Oracle bugzilla 13257
Oracle bug 13465921
be2iscsi HBA driver v4.1.239.0 patch set for UEK R2(2.6.39)
jayamohan.kallickal@emulex.com

Ported driver version 4.1.239.0 to UEK2 2.6.39-100.0.17 (was 2.103.298.0)

Comments from the patch headers:

 Commit ID : bd5354511d00cb9c81c64b0544786807a2209488
 [SCSI] be2iscsi: Fix for case where task->sc was cleanedup earlier

 This patch fixes a bug where the task->sc was cleaned up earlier on a
 different thread, possibly abort, and the completion comes later.

 This was causing a crash which has been reported in multiple places
---
 be_main.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
13 years agobe2iscsi 4.1.239.0 [PATCH 06/10] Fix for wrong dmsg setting in wrb
Chuck Anderson [Sat, 17 Dec 2011 04:06:31 +0000 (20:06 -0800)]
be2iscsi 4.1.239.0 [PATCH 06/10]  Fix for wrong dmsg setting in wrb

Dec. 16, 2011
Oracle bugzilla 13257
Oracle bug 13465921
be2iscsi HBA driver v4.1.239.0 patch set for UEK R2(2.6.39)
jayamohan.kallickal@emulex.com

Ported driver version 4.1.239.0 to UEK2 2.6.39-100.0.17 (was 2.103.298.0)

Comments from the patch headers:

 Commit ID : 685e16fdcf4324fe75ff28940311598f01704eaa
 [SCSI] be2iscsi: Fix for wrong dmsg setting in wrb

    This patch fixes wrong dmsg setting when we send out wrb.

If the ttt is not ISCSI_RESERVED_TAG then we should be setting
dmsg=1 so that the completion is done without waiting for a
iscsi level response from the target
---
 be_main.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
13 years agobe2iscsi 4.1.239.0 [PATCH 05/10] Fix for kdump failure
Chuck Anderson [Sat, 17 Dec 2011 04:05:53 +0000 (20:05 -0800)]
be2iscsi 4.1.239.0 [PATCH 05/10]  Fix for kdump failure

Dec. 16, 2011
Oracle bugzilla 13257
Oracle bug 13465921
be2iscsi HBA driver v4.1.239.0 patch set for UEK R2(2.6.39)
jayamohan.kallickal@emulex.com

Ported driver version 4.1.239.0 to UEK2 2.6.39-100.0.17 (was 2.103.298.0)

Comments from the patch headers:

 Commit ID : e528586079a20c3d28a490ec8e3271bb4348fc3e
 [SCSI] be2iscsi: Fix for kdump failure

 This patch fixes the Kdump failure reported by Redhat wich was caused by
 be2iscsi resetting the Chip when be2iscsi detects it is in crashdump mode. If
 be2net was loaded before be2iscsi then this leaves be2net driver hanging on to
 resources that the chip stopped recognising after the reset.

 This patch replaces  chip reset with Function reset so that only the
 particular function and not the whole chip is affected
---
 be_cmds.c |   19 +++++++++++++++++++
 be_cmds.h |    2 ++
 be_main.c |    2 +-
 3 files changed, 22 insertions(+), 1 deletions(-)

Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
13 years agobe2iscsi 4.1.239.0 [PATCH 04/10] Add pci_disable device
Chuck Anderson [Sat, 17 Dec 2011 04:04:56 +0000 (20:04 -0800)]
be2iscsi 4.1.239.0 [PATCH 04/10]  Add pci_disable device

Dec. 16, 2011
Oracle bugzilla 13257
Oracle bug 13465921
be2iscsi HBA driver v4.1.239.0 patch set for UEK R2(2.6.39)
jayamohan.kallickal@emulex.com

Ported driver version 4.1.239.0 to UEK2 2.6.39-100.0.17 (was 2.103.298.0)

Comments from the patch headers:

 Commit ID : 8dce69ff481a8d17a7d1027f23595083f28b4556
 [SCSI] be2iscsi: Add pci_disable device

   This patch adds call to pci_disable_device during
   rmmod and shutdown. The lack of this call was causing hang in
   insmod - rmmod loop test
---
 be_main.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
13 years agobe2iscsi 4.1.239.0 [PATCH 03/10] Adding a shutdown Routine
Chuck Anderson [Sat, 17 Dec 2011 04:04:19 +0000 (20:04 -0800)]
be2iscsi 4.1.239.0 [PATCH 03/10]  Adding a shutdown Routine

Dec. 16, 2011
Oracle bugzilla 13257
Oracle bug 13465921
be2iscsi HBA driver v4.1.239.0 patch set for UEK R2(2.6.39)
jayamohan.kallickal@emulex.com

Ported driver version 4.1.239.0 to UEK2 2.6.39-100.0.17 (was 2.103.298.0)

Comments from the patch headers:

 Commit ID : 25602c97f50e4b7fea84d2c81326dc5e372ca868
 [SCSI] be2iscsi: Adding a shutdown Routine

 This patch adds a shutdown routine. It fixes a bug where when be2net
 and be2iscsi are both used be2iscsi was not cleaning up its resources
 properly causing be2net to fail to get loaded when the system is
 rebooted.
---
 be_main.c |   38 ++++++++++++++++++++++++++++++--------
 1 files changed, 30 insertions(+), 8 deletions(-)

Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
13 years agobe2iscsi 4.1.239.0 [PATCH 02/10] Fixing the /proc/interrupts problem V3
Chuck Anderson [Sat, 17 Dec 2011 04:03:30 +0000 (20:03 -0800)]
be2iscsi 4.1.239.0 [PATCH 02/10]  Fixing the /proc/interrupts problem V3

Dec. 16, 2011
Oracle bugzilla 13257
Oracle bug 13465921
be2iscsi HBA driver v4.1.239.0 patch set for UEK R2(2.6.39)
jayamohan.kallickal@emulex.com

Ported driver version 4.1.239.0 to UEK2 2.6.39-100.0.17 (was 2.103.298.0)

Comments from the patch headers:

 Commit ID : 8fcfb21073ea4f4261c8ee3ccd2fde8e281a4f28

 [SCSI] be2iscsi: Fixing the /proc/interrupts problem V3

 Fix be2iscsi driver to use a separate pointer for each irq action->name
 field and avoid display corruption in /proc/interrupts. The be2iscsi driver
 was using a single static array in a function for the irq action->name field.
 This results in garbage output from  /proc/interrupts

 The pointer for action->name is garbage and scribbles the output on the screen.

 This patch fixes the problem:

 156:          0          0          0          0          0          0
 0          0          0          0          0          0          0
 0          0          0          0          0          0          0
 0          0          0          0       PCI-MSI-X  beiscsi_msix_0017
---
 be_main.c |   34 ++++++++++++++++++++++++++--------
 be_main.h |    3 +++
 2 files changed, 29 insertions(+), 8 deletions(-)

Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
13 years agobe2iscsi 4.1.239.0 [PATCH 01/10] Remove host and session casts
Chuck Anderson [Sat, 17 Dec 2011 03:01:28 +0000 (19:01 -0800)]
be2iscsi 4.1.239.0 [PATCH 01/10]   Remove host and session casts

Dec. 16, 2011
Oracle bugzilla 13257
Oracle bug 13465921
be2iscsi HBA driver v4.1.239.0 patch set for UEK R2(2.6.39)
jayamohan.kallickal@emulex.com

Ported driver version 4.1.239.0 to UEK2 2.6.39-100.0.17 (was 2.103.298.0)

Comments from the patch headers:

  Commit ID : 3093b0484d77ea774d74dfd7f5419831a716a9aa
  [SCSI] be2iscsi: remove host and session casts

  iscsi_session_to_shost is a macro around dev_to_shost which returns a
  Scsi_Host so there is no need to cast.

  iscsi_session_to_shost is a macro around shost_priv which
  returns a void pointer so no need to cast.
---
 be_iscsi.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
13 years agoMerge branch 'uek2-stable_BE2NET.bug13448441' of git://ca-git.us.oracle.com/linux...
Guru Anbalagane [Sat, 17 Dec 2011 02:53:09 +0000 (18:53 -0800)]
Merge branch 'uek2-stable_BE2NET.bug13448441' of git://ca-git.us.oracle.com/linux-muvarov-public into uek2-stable

13 years agoMerge branch 'uek2-stable' of git://ca-git.us.oracle.com/linux-uek-2.6.39 into uek2...
Maxim Uvarov [Sat, 17 Dec 2011 01:42:25 +0000 (17:42 -0800)]
Merge branch 'uek2-stable' of git://ca-git.us.oracle.com/linux-uek-2.6.39 into uek2-stable_16dec_mpt2sas

13 years agoMerge branch 'uek2-stable_qla2xxx' of ca-git.us.oracle.com:linux-muvarov-public into...
Guru Anbalagane [Sat, 17 Dec 2011 01:05:28 +0000 (17:05 -0800)]
Merge branch 'uek2-stable_qla2xxx' of ca-git.us.oracle.com:linux-muvarov-public into uek2-stable

13 years agoMerge branch 3.0.13 stable into uek2-stable
Maxim Uvarov [Sat, 17 Dec 2011 01:01:27 +0000 (17:01 -0800)]
Merge branch 3.0.13 stable into uek2-stable

Conflicts:
drivers/scsi/mpt2sas/mpt2sas_scsih.c (commit: 2a31a73f)

13 years agoMerge branch 'uek2-qla4xxx' of git://ca-git.us.oracle.com/linux-ganbalag-public into...
Guru Anbalagane [Sat, 17 Dec 2011 00:59:27 +0000 (16:59 -0800)]
Merge branch 'uek2-qla4xxx' of git://ca-git.us.oracle.com/linux-ganbalag-public into uek2-stable

13 years agoSCSI, qla2xxx: remove redundant semicolon
Jesper Juhl [Mon, 21 Nov 2011 18:22:21 +0000 (12:22 -0600)]
SCSI, qla2xxx: remove redundant semicolon

One ';' at the end of the return statement is enough.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
13 years agoqla2xxx: Do not check for minidump when device state is QLA82XX_DEV_READY.
Chad Dupuis [Wed, 19 Oct 2011 15:11:02 +0000 (10:11 -0500)]
qla2xxx: Do not check for minidump when device state is QLA82XX_DEV_READY.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Move initialization of some variables before iospace_config.
Chad Dupuis [Sat, 17 Sep 2011 14:43:02 +0000 (10:43 -0400)]
qla2xxx: Move initialization of some variables before iospace_config.

Some variables need to be initialized before we config PCI I/O config space
or else strange firmware initialization errors may occur.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Ensure there's enough request-queue space for passthru IOCBs.
Andrew Vasquez [Fri, 23 Sep 2011 22:09:46 +0000 (15:09 -0700)]
qla2xxx: Ensure there's enough request-queue space for passthru IOCBs.

The driver should ensure there's a sufficient number of IOCBs
to satisfy the number of scatter-gather entries specified in the
command.  Add a 'count' to the control structure, srb_ctx, to use
in qla2x00_alloc_iocbs().

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Implement FCP priority tagging for 82xx adapters.
Saurav Kashyap [Tue, 20 Sep 2011 14:54:51 +0000 (09:54 -0500)]
qla2xxx: Implement FCP priority tagging for 82xx adapters.

This provides a capability to set a priority in the FCP packet.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Consolidated IOCB processing routines.
Giridhar Malavali [Fri, 16 Dec 2011 08:59:04 +0000 (00:59 -0800)]
qla2xxx: Consolidated IOCB processing routines.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Process marker IOCB request on request queue 0.
Giridhar Malavali [Fri, 19 Aug 2011 01:43:55 +0000 (18:43 -0700)]
qla2xxx: Process marker IOCB request on request queue 0.

When multiple request queues are created process the marker IOCB request
on request queue 0.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Added a new entry to ISP specific function pointers structure.
Giridhar Malavali [Thu, 18 Aug 2011 20:31:21 +0000 (13:31 -0700)]
qla2xxx: Added a new entry to ISP specific function pointers structure.

Add a new function to ISP specific pointers structure to take care of ISP
specific PCI IO space configuration.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Corrected the display of firmware dump availability for ISP82xx.
Giridhar Malavali [Wed, 14 Sep 2011 22:21:26 +0000 (22:21 +0000)]
qla2xxx: Corrected the display of firmware dump availability for ISP82xx.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Corrected the default setting of the help text of Minidump capture mask.
Giridhar Malavali [Thu, 1 Sep 2011 18:57:18 +0000 (11:57 -0700)]
qla2xxx: Corrected the default setting of the help text of Minidump capture mask.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic>
13 years agoqla2xxx: Corrections to returned sysfs error codes.
Joe Carnuccio [Thu, 1 Sep 2011 17:32:39 +0000 (10:32 -0700)]
qla2xxx: Corrections to returned sysfs error codes.

Correct the erroneous return codes introduced by the following patch:
"Return sysfs error codes appropriate to conditions".

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Correct report-id acquisition check
Giridhar Malavali [Mon, 19 Sep 2011 21:00:44 +0000 (16:00 -0500)]
qla2xxx: Correct report-id acquisition check

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Fix to include FCE data as part of dump.
Giridhar Malavali [Wed, 31 Aug 2011 23:00:25 +0000 (16:00 -0700)]
qla2xxx: Fix to include FCE data as part of dump.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Limit excessive DPC cycles.
Andrew Vasquez [Sat, 3 Sep 2011 00:09:27 +0000 (00:09 +0000)]
qla2xxx: Limit excessive DPC cycles.

The 'continue' cases neglected to place the thread in an
interruptible state, causing the DPC routine to wake immediately.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Only read requested mailbox registers.
Andrew Vasquez [Fri, 2 Sep 2011 23:59:27 +0000 (16:59 -0700)]
qla2xxx: Only read requested mailbox registers.

When reading the incoming mailbox registers, read only the specified ones.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Proper cleanup of pass through commands when firmware returns error.
Giridhar Malavali [Fri, 9 Sep 2011 07:35:56 +0000 (00:35 -0700)]
qla2xxx: Proper cleanup of pass through commands when firmware returns error.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Update to dynamic logging.
Chad Dupuis [Fri, 16 Dec 2011 08:49:42 +0000 (00:49 -0800)]
qla2xxx: Update to dynamic logging.

This patch contains minor fixes to our new logging infrastructure:

- Remove extranous messages.
- Re-add 'nexus' and 'hdl' information.
- Adjusted the message ids to fill up the holes.
- Display FCP_CMND priority on update.
- Log only mail box error conditions.
- Do not print "Firmware ready **** FAILED ****" if cable is unplugged.
- Drop noisy 'fw_state...curr time...' message.
- Correct nexus display during abort.
- Add a special case error-logging set to '1'.
- Catagorize I/O exception display handling.
- Correct the bsg msg code printing.
- Dont use dynamic logging after host is removed.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Make the logging functions verify their arguments and fixed the current...
Joe Perches [Fri, 5 Aug 2011 17:08:01 +0000 (10:08 -0700)]
qla2xxx: Make the logging functions verify their arguments and fixed the current broken uses as appropriate.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Use less stack to emit logging messages.
Joe Perches [Tue, 2 Aug 2011 12:54:22 +0000 (05:54 -0700)]
qla2xxx: Use less stack to emit logging messages.

Return early when logging level too low.
Use normal kernel codeing style for function braces.
Add const where appropriate to logging functions.
Remove now unused #define QL_DBG_BUF_LEN.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Update version number to 8.03.07.12-k.
Chad Dupuis [Tue, 15 Nov 2011 15:06:36 +0000 (09:06 -0600)]
qla2xxx: Update version number to 8.03.07.12-k.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Submit all chained IOCBs for passthrough commands on request queue 0.
Giridhar Malavali [Thu, 8 Sep 2011 18:04:56 +0000 (11:04 -0700)]
qla2xxx: Submit all chained IOCBs for passthrough commands on request queue 0.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Correct fc_host port_state display.
Saurav Kashyap [Mon, 3 Oct 2011 13:36:30 +0000 (08:36 -0500)]
qla2xxx: Correct fc_host port_state display.

Add more fine grain parsing of vha->loop_state to export a more accurate
fc_host port_state.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Display IPE error message for ISP82xx.
Chad Dupuis [Mon, 17 Oct 2011 20:29:21 +0000 (15:29 -0500)]
qla2xxx: Display IPE error message for ISP82xx.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Return the correct value for a mailbox command if 82xx is in reset recovery.
Andrew Vasquez [Mon, 10 Oct 2011 20:28:39 +0000 (15:28 -0500)]
qla2xxx: Return the correct value for a mailbox command if 82xx is in reset recovery.

We need to return QLA_FUNCTION_TIMEOUT immediately otherwise we mess up the
mailbox command state machine.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Enable Minidump by default with default capture mask 0x1f.
Giridhar Malavali [Thu, 29 Sep 2011 17:49:47 +0000 (12:49 -0500)]
qla2xxx: Enable Minidump by default with default capture mask 0x1f.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Stop unconditional completion of mailbox commands issued in interrupt mode...
Giridhar Malavali [Thu, 29 Sep 2011 17:46:07 +0000 (12:46 -0500)]
qla2xxx: Stop unconditional completion of mailbox commands issued in interrupt mode during firmware hang.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Revert back the request queue mapping to request queue 0.
Giridhar Malavali [Mon, 19 Sep 2011 19:50:01 +0000 (19:50 +0000)]
qla2xxx: Revert back the request queue mapping to request queue 0.

If there is an error creating multiple response queues then we need to revert
the request queue mapping back to request queue 0.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Don't call alloc_fw_dump for ISP82XX.
Saurav Kashyap [Thu, 11 Aug 2011 20:05:55 +0000 (13:05 -0700)]
qla2xxx: Don't call alloc_fw_dump for ISP82XX.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Check for SCSI status on underruns.
Arun Easi [Mon, 25 Jul 2011 23:59:51 +0000 (16:59 -0700)]
qla2xxx: Check for SCSI status on underruns.

Signed-off-by: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Remove qla2x00_wait_for_loop_ready function.
Saurav Kashyap [Thu, 11 Aug 2011 20:09:37 +0000 (13:09 -0700)]
qla2xxx: Remove qla2x00_wait_for_loop_ready function.

This function can wait for 5min under certain scenarios. One of them is when
the port is down from switch and bus reset is issued. The bus reset used to
wait for 5 minutes for the loop and upper layer callers used to hang and give
stack trace because of getting stuck for 120 sec. Its legacy code that was used
when the driver used to do queuing of the commands.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
13 years agoqla2xxx: Correct inadvertent clearing of RISC_INTR status.
Andrew Vasquez [Wed, 26 Oct 2011 21:20:13 +0000 (14:20 -0700)]
qla2xxx: Correct inadvertent clearing of RISC_INTR status.

During heavy I/O (CPU-affinity mode enabled) and CLI/Agent
interactions, the driver would report periodic mailbox command
timeout statuses.  Within the CPU-affinity ISR handler, the
driver should check the 'disable-msix-handshake' flag in deciding
whether or not to clear HCCRX_CLR_RISC_INT.  The mode is not
specific to a dedicated queue, instead, applies to the current
'ha' context.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Fix crash in qla2x00_abort_all_cmds() on unload
Roland Dreier [Thu, 22 Sep 2011 07:06:05 +0000 (00:06 -0700)]
qla2xxx: Fix crash in qla2x00_abort_all_cmds() on unload

I hit a crash in qla2x00_abort_all_cmds() if the qla2xxx module is
unloaded right after it is loaded.  I debugged this down to the abort
handling improperly treating a command of type SRB_ADISC_CMD as if it
had a bsg_job to complete when that command actually uses the iocb_cmd
part of the union.  (I guess to hit this one has to unload the module
while the async FC initialization is still in progress)

It seems we should only look for a bsg_job if type is SRB_ELS_CMD_RPT,
SRB_ELS_CMD_HST or SRB_CT_CMD, so switch the test to make that explicit.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoscsi: fix qla2xxx printk format warning
Randy Dunlap [Fri, 23 Sep 2011 22:40:50 +0000 (15:40 -0700)]
scsi: fix qla2xxx printk format warning

sector_t can be different types, so cast it to its largest possible
type.

  drivers/scsi/qla2xxx/qla_isr.c:1509:5: warning: format '%lx' expects type 'long unsigned int', but argument 5 has type 'sector_t'

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
13 years agoqla2xxx: Fix "active_mask" may be used uninitialized warning.
Chad Dupuis [Tue, 16 Aug 2011 18:31:55 +0000 (11:31 -0700)]
qla2xxx: Fix "active_mask" may be used uninitialized warning.

Since active_mask is first assigned in an "else" block, the compiler throws
a warning saying that the active_mask variable may be used uninitialized in
a print statement later.  Initialize active_mask to 0 in the declaration to
stop the warning.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Issue mailbox command only when firmware hung bit is reset for ISP82xx.
Giridhar Malavali [Tue, 16 Aug 2011 18:31:54 +0000 (11:31 -0700)]
qla2xxx: Issue mailbox command only when firmware hung bit is reset for ISP82xx.

Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Return sysfs error codes appropriate to conditions.
Joe Carnuccio [Tue, 16 Aug 2011 18:31:53 +0000 (11:31 -0700)]
qla2xxx: Return sysfs error codes appropriate to conditions.

Return sysfs error codes that match the conditions encountered.
This prevents sysfs from retrying a request which is conditioned
to fail under the current circumstance.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Provide method for updating I2C attached VPD.
Joe Carnuccio [Tue, 16 Aug 2011 18:31:52 +0000 (11:31 -0700)]
qla2xxx: Provide method for updating I2C attached VPD.

Provide bsg interface for updating VPD attached on the I2C serial bus.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Correction to sysfs edc interface.
Joe Carnuccio [Tue, 16 Aug 2011 18:31:51 +0000 (11:31 -0700)]
qla2xxx: Correction to sysfs edc interface.

Corrects the return value for the cases where read/write edc fails;
this prevents sysfs from retrying the operation until forever.

Corrects the printk width specifier for the first byte of buf.

Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: During loopdown perform Diagnostic loopback.
Saurav Kashyap [Tue, 16 Aug 2011 18:31:50 +0000 (11:31 -0700)]
qla2xxx: During loopdown perform Diagnostic loopback.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Fix array out of bound warning.
Saurav Kashyap [Tue, 16 Aug 2011 18:31:49 +0000 (11:31 -0700)]
qla2xxx: Fix array out of bound warning.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: check for marker IOCB during response queue processing.
Saurav Kashyap [Tue, 16 Aug 2011 18:31:48 +0000 (11:31 -0700)]
qla2xxx: check for marker IOCB during response queue processing.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Enable write permission to some debug related module parameters to be change...
Chad Dupuis [Tue, 16 Aug 2011 18:31:47 +0000 (11:31 -0700)]
qla2xxx: Enable write permission to some debug related module parameters to be changed dynamically.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Prevent CPU lockups when "ql2xdontresethba" module param is set.
Saurav Kashyap [Tue, 16 Aug 2011 18:31:46 +0000 (11:31 -0700)]
qla2xxx: Prevent CPU lockups when "ql2xdontresethba" module param is set.

Driver is not releasing the lock if ql2xdontresethba is set, this might lead
to a lockup.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Implemeted beacon on/off for ISP82XX.
Saurav Kashyap [Tue, 16 Aug 2011 18:31:45 +0000 (11:31 -0700)]
qla2xxx: Implemeted beacon on/off for ISP82XX.

[jejb: fix up checkpatch.pl errors]
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Add support for ISP82xx to capture dump (minidump) on failure.
Giridhar Malavali [Tue, 16 Aug 2011 18:31:44 +0000 (11:31 -0700)]
qla2xxx: Add support for ISP82xx to capture dump (minidump) on failure.

Minidump allows us to catpure a snapshot of the firmware/hardware states at the
time of failure for further analysis.

[jejb: added missing #include <linux/vmalloc.h>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> ]
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Update version number to 8.03.07.07-k.
Chad Dupuis [Tue, 16 Aug 2011 18:29:30 +0000 (11:29 -0700)]
qla2xxx: Update version number to 8.03.07.07-k.

Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Set the task attributes after memsetting fcp cmnd.
Saurav Kashyap [Tue, 16 Aug 2011 18:29:29 +0000 (11:29 -0700)]
qla2xxx: Set the task attributes after memsetting fcp cmnd.

The memset of the fcp_cmnd struct needs to be moved so that it will not
zero-out valid data.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Save and restore irq in the response queue interrupt handler.
Saurav Kashyap [Tue, 16 Aug 2011 18:29:27 +0000 (11:29 -0700)]
qla2xxx: Save and restore irq in the response queue interrupt handler.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Double check for command completion if abort mailbox command fails.
Chad Dupuis [Tue, 16 Aug 2011 18:29:26 +0000 (11:29 -0700)]
qla2xxx: Double check for command completion if abort mailbox command fails.

Close a small window where we could falsely fail an abort request if the mailbox
command fails but the command was returned during interrupt context.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Acquire hardware lock while manipulating dsd list.
Saurav Kashyap [Tue, 16 Aug 2011 18:29:25 +0000 (11:29 -0700)]
qla2xxx: Acquire hardware lock while manipulating dsd list.

The dsd list shouldn't be manipulated without taking the per host hardware
lock to prevent multiple callers from trampling upon one another.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Fix qla24xx revision check while enabling interrupts.
Chad Dupuis [Tue, 16 Aug 2011 18:29:24 +0000 (11:29 -0700)]
qla2xxx: Fix qla24xx revision check while enabling interrupts.

Since we enable interrupts before initializing the firmware, use the chip
revision from PCI config space directly to perform the chip revision check.
Also remove the unnecessary firmware attributes test.

Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: T10 DIF - Fix incorrect error reporting.
Arun Easi [Tue, 16 Aug 2011 18:29:23 +0000 (11:29 -0700)]
qla2xxx: T10 DIF - Fix incorrect error reporting.

This fix:
    - Disables app tag peeking; correct tag check will be added when the
      SCSI API is available.
    - Always derive ref_tag from scsi_get_lba()
    - Removes incorrect swap of FCP_LUN in FCP_CMND
    - Moves app-tag error check before ref-tag check. The reason being,
      currently there is no interface in SCSI to retrieve the app-tag
      for protection I/Os, so driver puts zero for app-tag in the
      firmware interface, but requests not to validate it, but when a
      ref-tag error is detected by firmware, it would put
      expected/actual tags for all the protection tags (guard/app/ref).
      As driver checks for app tag error first, a ref-tag error is
      incorrectly flagged as app-tag error.
    - Convert HBA specific checks to capability based.

Signed-off-by: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: T10 DIF - Handle uninitalized sectors.
Arun Easi [Tue, 16 Aug 2011 18:29:22 +0000 (11:29 -0700)]
qla2xxx: T10 DIF - Handle uninitalized sectors.

Driver needs to update protection bytes for uninitialized sectors as they are
not DMA-d.

Signed-off-by: Arun Easi <arun.easi@qlogic.com>
Reviewed-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Cleanup of previous infrastructure.
Saurav Kashyap [Thu, 14 Jul 2011 19:00:14 +0000 (12:00 -0700)]
qla2xxx: Cleanup of previous infrastructure.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Code changes to support new dynamic logging infrastructure.
Saurav Kashyap [Thu, 14 Jul 2011 19:00:13 +0000 (12:00 -0700)]
qla2xxx: Code changes to support new dynamic logging infrastructure.

The code is changed to support the new dynamic logging infrastructure.
Following are the levels added.
Default is 0 - no logging.  0x40000000 - Module Init & Probe.
0x20000000 - Mailbox Cmnds. 0x10000000 - Device Discovery.
0x08000000 - IO tracing.    0x04000000 - DPC Thread.
0x02000000 - Async events.  0x01000000 - Timer routines.
0x00800000 - User space.    0x00400000 - Task Management.
0x00200000 - AER/EEH.       0x00100000 - Multi Q.
0x00080000 - P3P Specific.  0x00040000 - Virtual Port.
0x00020000 - Buffer Dump.   0x00010000 - Misc.
0x7fffffff - For enabling all logs, can be too many logs.

Setting ql2xextended_error_logging module parameter to any of the above
value, will enable the debug for that particular level.
Do LOGICAL OR of the value to enable more than one level.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Joe Carnuccio <joe.carnuccio@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoqla2xxx: Basic infrastructure for dynamic logging.
Saurav Kashyap [Thu, 14 Jul 2011 19:00:12 +0000 (12:00 -0700)]
qla2xxx: Basic infrastructure for dynamic logging.

This patch adds the dynamic logging framework to the qla2xxx driver.
The user will be able to change the logging levels on the fly i.e.
without load/unload of the driver. This also enables logging to be
enabled for a particular section of the driver such as initialization,
device discovery etc.

Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
13 years agoscsi: qla_isr.c: fix comment typo 'hammmer'
Justin P. Mattock [Fri, 24 Jun 2011 06:22:27 +0000 (23:22 -0700)]
scsi: qla_isr.c: fix comment typo 'hammmer'

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
13 years agoMerge branch 'uek2' of git://ca-git.us.oracle.com/linux-mason-public into uek2-stable
Guru Anbalagane [Fri, 16 Dec 2011 21:54:03 +0000 (13:54 -0800)]
Merge branch 'uek2' of git://ca-git.us.oracle.com/linux-mason-public into uek2-stable

13 years agoMerge branch 'uek2-mpt2sas' of git://ca-git.us.oracle.com/linux-mkp-public into uek2...
Guru Anbalagane [Fri, 16 Dec 2011 21:50:53 +0000 (13:50 -0800)]
Merge branch 'uek2-mpt2sas' of git://ca-git.us.oracle.com/linux-mkp-public into uek2-stable

13 years agoBtrfs: unplug every once and a while
Chris Mason [Thu, 15 Dec 2011 20:38:41 +0000 (15:38 -0500)]
Btrfs: unplug every once and a while

The btrfs io submission threads can build up massive plug lists.  This
keeps things more reasonable so we don't hand over huge dumps of IO at
once.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit d85c8a6f1bc083279215ff6e79b7c292bf3ec905)

13 years agoBtrfs: deal with NULL srv_rsv in the delalloc inode reservation code
Chris Mason [Thu, 15 Dec 2011 18:36:29 +0000 (13:36 -0500)]
Btrfs: deal with NULL srv_rsv in the delalloc inode reservation code

btrfs_update_inode is sometimes called with a null reservation.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit e755d9ab387c4c2401dce5b6f435432a829f41cb)

13 years agoBtrfs: only set cache_generation if we setup the block group
Josef Bacik [Tue, 13 Dec 2011 21:04:54 +0000 (16:04 -0500)]
Btrfs: only set cache_generation if we setup the block group

A user reported a problem booting into a new kernel with the old format inodes.
He was panicing in cow_file_range while writing out the inode cache.  This is
because if the block group is not cached we'll just skip writing out the cache,
however if it gets dirtied again in the same transaction and it finished caching
we'd go ahead and write it out, but since we set cache_generation to the transid
we think we've already truncated it and will just carry on, running into
cow_file_range and blowing up.  We need to make sure we only set
cache_generation if we've done the truncate.  The user tested this patch and
verified that the panic no longer occured.  Thanks,

Reported-and-Tested-by: Klaus Bitto <klaus.bitto@gmail.com>
Signed-off-by: Josef Bacik <josef@redhat.com>
(cherry picked from commit e65cbb94e036058128a5dec6398be2fd64cf88ba)

13 years agoBtrfs: don't panic if orphan item already exists
Josef Bacik [Tue, 13 Dec 2011 17:55:58 +0000 (12:55 -0500)]
Btrfs: don't panic if orphan item already exists

I've been hitting this BUG_ON() in btrfs_orphan_add when running xfstest 269 in
a loop.  This is because we will add an orphan item, do the truncate, the
truncate will fail for whatever reason (*cough*ENOSPC*cough*) and then we're
left with an orphan item still in the fs.  Then we come back later to do another
truncate and it blows up because we already have an orphan item.  This is ok so
just fix the BUG_ON() to only BUG() if ret is not EEXIST.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
(cherry picked from commit ee4d89f0c4967c624c92516fcc37b41069bfdc23)

13 years agoBtrfs: fix leaked space in truncate
Josef Bacik [Fri, 9 Dec 2011 18:26:22 +0000 (13:26 -0500)]
Btrfs: fix leaked space in truncate

We were occasionaly leaking space when running xfstest 269.  This is because if
we failed to start the transaction in the truncate loop we'd just goto out, but
we need to break so that the inode is removed from the orphan list and the space
is properly freed.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
(cherry picked from commit 7041ee97281c30a78658904140c7bd9373a36142)

13 years agoBtrfs: fix how we do delalloc reservations and how we free reservations on error
Josef Bacik [Fri, 9 Dec 2011 16:18:51 +0000 (11:18 -0500)]
Btrfs: fix how we do delalloc reservations and how we free reservations on error

Running xfstests 269 with some tracing my scripts kept spitting out errors about
releasing bytes that we didn't actually have reserved.  This took me down a huge
rabbit hole and it turns out the way we deal with reserved_extents is wrong,
we need to only be setting it if the reservation succeeds, otherwise the free()
method will come in and unreserve space that isn't actually reserved yet, which
can lead to other warnings and such.  The math was all working out right in the
end, but it caused all sorts of other issues in addition to making my scripts
yell and scream and generally make it impossible for me to track down the
original issue I was looking for.  The other problem is with our error handling
in the reservation code.  There are two cases that we need to deal with

1) We raced with free.  In this case free won't free anything because csum_bytes
is modified before we dro the lock in our reservation path, so free rightly
doesn't release any space because the reservation code may be depending on that
reservation.  However if we fail, we need the reservation side to do the free at
that point since that space is no longer in use.  So as it stands the code was
doing this fine and it worked out, except in case #2

2) We don't race with free.  Nobody comes in and changes anything, and our
reservation fails.  In this case we didn't reserve anything anyway and we just
need to clean up csum_bytes but not free anything.  So we keep track of
csum_bytes before we drop the lock and if it hasn't changed we know we can just
decrement csum_bytes and carry on.

Because of the case where we can race with free()'s since we have to drop our
spin_lock to do the reservation, I'm going to serialize all reservations with
the i_mutex.  We already get this for free in the heavy use paths, truncate and
file write all hold the i_mutex, just needed to add it to page_mkwrite and
various ioctl/balance things.  With this patch my space leak scripts no longer
scream bloody murder.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
(cherry picked from commit 660d3f6cde552323578b85fc5a09a6742f1fe804)

13 years agoBtrfs: deal with enospc from dirtying inodes properly
Chris Mason [Fri, 16 Dec 2011 19:54:14 +0000 (14:54 -0500)]
Btrfs: deal with enospc from dirtying inodes properly

Now that we're properly keeping track of delayed inode space we've been getting
a lot of warnings out of btrfs_dirty_inode() when running xfstest 83.  This is
because a bunch of people call mark_inode_dirty, which is void so we can't
return ENOSPC.  This needs to be fixed in a few areas

1) file_update_time - this updates the mtime and such when writing to a file,
which will call mark_inode_dirty.  So copy file_update_time into btrfs so we can
call btrfs_dirty_inode directly and return an error if we get one appropriately.

2) fix symlinks to use btrfs_setattr for ->setattr.  For some reason we weren't
setting ->setattr for symlinks, even though we should have been.  This catches
one of the cases where we were getting errors in mark_inode_dirty.

3) Fix btrfs_setattr and btrfs_setsize to call btrfs_dirty_inode directly
instead of mark_inode_dirty.  This lets us return errors properly for truncate
and chown/anything related to setattr.

4) Add a new btrfs_fs_dirty_inode which will just call btrfs_dirty_inode and
print an error if we have one.  The only remaining user we can't control for
this is touch_atime(), but we don't really want to keep people from walking
down the tree if we don't have space to save the atime update, so just complain
but don't worry about it.

With this patch xfstests 83 complains a handful of times instead of hundreds of
times.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
(cherry picked from commit 22c44fe65adacd20a174f3f54686509ee94ef7be with conflicts)

Conflicts:

fs/btrfs/inode.c

Signed-off-by: Chris Mason <chris.mason@oracle.com>
13 years agoBtrfs: fix num_workers_starting bug and other bugs in async thread
Josef Bacik [Fri, 18 Nov 2011 19:37:27 +0000 (14:37 -0500)]
Btrfs: fix num_workers_starting bug and other bugs in async thread

Al pointed out we have some random problems with the way we account for
num_workers_starting in the async thread stuff.  First of all we need to make
sure to decrement num_workers_starting if we fail to start the worker, so make
__btrfs_start_workers do this.  Also fix __btrfs_start_workers so that it
doesn't call btrfs_stop_workers(), there is no point in stopping everybody if we
failed to create a worker.  Also check_pending_worker_creates needs to call
__btrfs_start_work in it's work function since it already increments
num_workers_starting.

People only start one worker at a time, so get rid of the num_workers argument
everywhere, and make btrfs_queue_worker a void since it will always succeed.
Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
(cherry picked from commit 0dc3b84a73267f47a75468f924f5d58a840e3152)

13 years agoBTRFS: Establish i_ops before calling d_instantiate
Casey Schaufler [Thu, 15 Dec 2011 15:09:07 +0000 (10:09 -0500)]
BTRFS: Establish i_ops before calling d_instantiate

The Smack LSM hook for security_d_instantiate checks
the inode's i_op->getxattr value to determine if the
containing filesystem supports extended attributes.
The BTRFS filesystem sets the inode's i_op value only
after it has instantiated the inode. This results in
Smack incorrectly giving new BTRFS inodes attributes
from the filesystem defaults on the assumption that
values can't be stored on the filesystem. This patch
moves the assignment of inode operation vectors ahead
of the calls to d_instantiate, letting Smack know that
the filesystem supports extended attributes. There
should be no impact on the performance or behavior of
BTRFS.

Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit ad19db71f498fd858dd84ce603efcf97e321f184)

13 years agoBtrfs: add a cond_resched() into the worker loop
Chris Mason [Thu, 15 Dec 2011 14:29:43 +0000 (09:29 -0500)]
Btrfs: add a cond_resched() into the worker loop

If we have a constant stream of end_io completions or crc work,
we can hit softlockup messages from the async helper threads.  This
adds a cond_resched() into the loop to avoid them.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit 8f3b65a3d66bcc086e1eb040b7545e70681f2ed1)

13 years agoBtrfs: fix ctime update of on-disk inode
Li Zefan [Thu, 15 Dec 2011 01:12:02 +0000 (20:12 -0500)]
Btrfs: fix ctime update of on-disk inode

To reproduce the bug:

    # touch /mnt/tmp
    # stat /mnt/tmp | grep Change
    Change: 2011-12-09 09:32:23.412105981 +0800
    # chattr +i /mnt/tmp
    # stat /mnt/tmp | grep Change
    Change: 2011-12-09 09:32:43.198105295 +0800
    # umount /mnt
    # mount /dev/loop1 /mnt
    # stat /mnt/tmp | grep Change
    Change: 2011-12-09 09:32:23.412105981 +0800

We should update ctime of in-memory inode before calling
btrfs_update_inode().

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit 306424cc880a0fbbdc99eee1f43d056a301a180f)

13 years agobtrfs: keep orphans for subvolume deletion
Arne Jansen [Thu, 15 Dec 2011 01:12:02 +0000 (20:12 -0500)]
btrfs: keep orphans for subvolume deletion

Since we have the free space caches, btrfs_orphan_cleanup also runs for
the tree_root. Unfortunately this also cleans up the orphans used to mark
subvol deletions in progress.

Currently if a subvol deletion gets interrupted twice by umount/mount, the
deletion will not be continued and the space permanently lost, though it
would be possible to write a tool to recover those lost subvol deletions.
This patch checks if the orphan belongs to a subvol (dead root) and skips
the deletion.

Signed-off-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit f8e9e0b07be0464e12366631da3da73a1a62449c)

13 years agoBtrfs: fix inaccurate available space on raid0 profile
Miao Xie [Thu, 15 Dec 2011 01:12:02 +0000 (20:12 -0500)]
Btrfs: fix inaccurate available space on raid0 profile

When we use raid0 as the data profile, df command may show us a very
inaccurate value of the available space, which may be much less than the
real one. It may make the users puzzled. Fix it by changing the calculation
of the available space, and making it be more similar to a fake chunk
allocation.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit 39fb26c398ddf8d7794a85e896cfe1a42e55524b)

13 years agoBtrfs: fix wrong disk space information of the files
Miao Xie [Thu, 15 Dec 2011 01:12:02 +0000 (20:12 -0500)]
Btrfs: fix wrong disk space information of the files

Btrfsck report errors after the 83th case of xfstests was run, The error
number is 400, it means the used disk space of the file is wrong.

The reason of this bug is that:
The file truncation may fail when the space of the file system is not enough,
and leave some file extents, whose offset are beyond the end of the files.
When we want to expand those files, we will drop those file extents, and
put in dummy file extents, and then we should update the i-node. But btrfs
forgets to do it.

This patch adds the forgotten i-node update.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit 3642320e07444cc46327b24977d752f99706dac2)

13 years agoBtrfs: fix wrong i_size when truncating a file to a larger size
Miao Xie [Thu, 15 Dec 2011 01:12:01 +0000 (20:12 -0500)]
Btrfs: fix wrong i_size when truncating a file to a larger size

Btrfsck report error 100 after the 83th case of xfstests was run, it means
the i_size of the file is wrong.

The reason of this bug is that:
Btrfs increased i_size of the file at the beginning, but it failed to expand
the file, and failed to update the i_size to the old size because there is no
enough space in the file system, so we found a wrong i_size.

This patch fixes this bug by updating the i_size just when we pass the file
expanding and get enough space to update i-node.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit f4a2f4c548296168832ad4ab7e7f7b0cd0bf1214)

13 years agoBtrfs: fix btrfs_end_bio to deal with write errors to a single mirror
Chris Mason [Fri, 9 Dec 2011 16:07:37 +0000 (11:07 -0500)]
Btrfs: fix btrfs_end_bio to deal with write errors to a single mirror

btrfs_end_bio checks the number of errors on a bio against the max
number of errors allowed before sending any EIOs up to the higher
levels.

If we got enough copies of the bio done for a given raid level, it is
supposed to clear the bio error flag and return success.

We have pointers to the original bio sent down by the higher layers and
pointers to any cloned bios we made for raid purposes.  If the original
bio happens to be the one that got an io error, but not the last one to
finish, it might not have the BIO_UPTODATE bit set.

Then, when the last bio does finish, we'll call bio_end_io on the
original bio.  It won't have the uptodate bit set and we'll end up
sending EIO to the higher layers.

We already had a check for this, it just was conditional on getting the
IO error on the very last bio.  Make the check unconditional so we eat
the EIOs properly.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit 5dbc8fca8ef5d719014f22345d990e957dcfc692)

13 years agoBtrfs: drop spin lock when memory alloc fails
Liu Bo [Thu, 8 Dec 2011 01:08:40 +0000 (20:08 -0500)]
Btrfs: drop spin lock when memory alloc fails

Drop spin lock in convert_extent_bit() when memory alloc fails,
otherwise, it will be a deadlock.

Signed-off-by: Liu Bo <liubo2009@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit 1cf4ffdb3289624a6462c94f2ce05545b32ef736)

13 years agoBtrfs: check if the to-be-added device is writable
Li Zefan [Thu, 8 Dec 2011 01:08:40 +0000 (20:08 -0500)]
Btrfs: check if the to-be-added device is writable

If we call ioctl(BTRFS_IOC_ADD_DEV) directly, we'll succeed in adding
a readonly device to a btrfs filesystem, and btrfs will write to
that device, emitting kernel errors:

[ 3109.833692] lost page write due to I/O error on loop2
[ 3109.833720] lost page write due to I/O error on loop2
...

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit a5d16333612718569ffd26064270e535cb9c3928)

13 years agoBtrfs: try cluster but don't advance in search list
Alexandre Oliva [Thu, 8 Dec 2011 01:08:40 +0000 (20:08 -0500)]
Btrfs: try cluster but don't advance in search list

When we find an existing cluster, we switch to its block group as the
current block group, possibly skipping multiple blocks in the process.
Furthermore, under heavy contention, multiple threads may fail to
allocate from a cluster and then release just-created clusters just to
proceed to create new ones in a different block group.

This patch tries to allocate from an existing cluster regardless of its
block group, and doesn't switch to that group, instead proceeding to
try to allocate a cluster from the group it was iterating before the
attempt.

Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit 274bd4fb3ed6b72c1d77ef8850511f09fc6b8e4d)

13 years agoBtrfs: try to allocate from cluster even at LOOP_NO_EMPTY_SIZE
Alexandre Oliva [Thu, 8 Dec 2011 00:50:42 +0000 (19:50 -0500)]
Btrfs: try to allocate from cluster even at LOOP_NO_EMPTY_SIZE

If we reach LOOP_NO_EMPTY_SIZE, we won't even try to use a cluster that
others might have set up.  Odds are that there won't be one, but if
someone else succeeded in setting it up, we might as well use it, even
if we don't try to set up a cluster again.

Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit 062c05c46bd4358aad7a0e0cb5ffeb98ab935286)

13 years agoBtrfs: fix meta data raid-repair merge problem
Jan Schmidt [Thu, 1 Dec 2011 14:30:36 +0000 (09:30 -0500)]
Btrfs: fix meta data raid-repair merge problem

Commit 4a54c8c16 introduced raid-repair, killing the individual
readpage_io_failed_hook entries from inode.c and disk-io.c. Commit
4bb31e92 introduced new readahead code, adding a readpage_io_failed_hook to
disk-io.c.

The raid-repair commit had logic to disable raid-repair, if
readpage_io_failed_hook is set. Thus, the readahead commit effectively
disabled raid-repair for meta data.

This commit changes the logic to always attempt raid-repair when needed and
call the readpage_io_failed_hook in case raid-repair fails. This is much
more straight forward and should have been like that from the beginning.

Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Reported-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
(cherry picked from commit f4a8e6563ea5366f563cb741a27fe90c5fa7f0fc)