--- /dev/null
+From stable-bounces@linux.kernel.org Wed Mar 28 14:41:38 2007
+From: Steve French <sfrench@us.ibm.com>
+Date: Wed, 28 Mar 2007 17:40:03 -0400
+Subject: CIFS: Allow reset of file to ATTR_NORMAL when archive bit not set
+To: linux-stable <stable@kernel.org>
+Message-ID: <460AE0B3.4070304@redhat.com>
+
+
+From: Steve French <sfrench@us.ibm.com>
+
+[CIFS] Allow reset of file to ATTR_NORMAL when archive bit not set
+
+When a file had a dos attribute of 0x1 (readonly - but dos attribute
+of archive was not set) - doing chmod 0777 or equivalent would
+try to set a dos attribute of 0 (which some servers ignore)
+rather than ATTR_NORMAL (0x20) which most servers accept.
+Does not affect servers which support the CIFS Unix Extensions.
+
+[<cebbert@redhat.com>: removed changelog part of patch]
+
+Cc: Chuck Ebbert <cebbert@redhat.com>
+Acked-by: Prasad Potluri <pvp@us.ibm.com>
+Acked-by: Shirish Pargaonkar <shirishp@us.ibm.com>
+Signed-off-by: Steve French <sfrench@us.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+
+---
+ fs/cifs/inode.c | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+--- a/fs/cifs/inode.c
++++ b/fs/cifs/inode.c
+@@ -1133,6 +1133,7 @@ int cifs_setattr(struct dentry *direntry
+ struct cifsFileInfo *open_file = NULL;
+ FILE_BASIC_INFO time_buf;
+ int set_time = FALSE;
++ int set_dosattr = FALSE;
+ __u64 mode = 0xFFFFFFFFFFFFFFFFULL;
+ __u64 uid = 0xFFFFFFFFFFFFFFFFULL;
+ __u64 gid = 0xFFFFFFFFFFFFFFFFULL;
+@@ -1269,15 +1270,23 @@ int cifs_setattr(struct dentry *direntry
+ else if (attrs->ia_valid & ATTR_MODE) {
+ rc = 0;
+ if ((mode & S_IWUGO) == 0) /* not writeable */ {
+- if ((cifsInode->cifsAttrs & ATTR_READONLY) == 0)
++ if ((cifsInode->cifsAttrs & ATTR_READONLY) == 0) {
++ set_dosattr = TRUE;
+ time_buf.Attributes =
+ cpu_to_le32(cifsInode->cifsAttrs |
+ ATTR_READONLY);
++ }
+ } else if ((mode & S_IWUGO) == S_IWUGO) {
+- if (cifsInode->cifsAttrs & ATTR_READONLY)
++ if (cifsInode->cifsAttrs & ATTR_READONLY) {
++ set_dosattr = TRUE;
+ time_buf.Attributes =
+ cpu_to_le32(cifsInode->cifsAttrs &
+ (~ATTR_READONLY));
++ /* Windows ignores set to zero */
++ if(time_buf.Attributes == 0)
++ time_buf.Attributes |=
++ cpu_to_le32(ATTR_NORMAL);
++ }
+ }
+ /* BB to be implemented -
+ via Windows security descriptors or streams */
+@@ -1315,7 +1324,7 @@ int cifs_setattr(struct dentry *direntry
+ } else
+ time_buf.ChangeTime = 0;
+
+- if (set_time || time_buf.Attributes) {
++ if (set_time || set_dosattr) {
+ time_buf.CreationTime = 0; /* do not change */
+ /* In the future we should experiment - try setting timestamps
+ via Handle (SetFileInfo) instead of by path */
--- /dev/null
+From stable-bounces@linux.kernel.org Wed Mar 28 14:41:50 2007
+From: Alan Tyson <atyson@hp.com>
+Date: Wed, 28 Mar 2007 17:40:35 -0400
+Subject: CIFS: reset mode when client notices that ATTR_READONLY is no longer set
+To: linux-stable <stable@kernel.org>
+Message-ID: <460AE0D3.5040703@redhat.com>
+
+From: Alan Tyson <atyson@hp.com>
+
+[CIFS] reset mode when client notices that ATTR_READONLY is no longer set
+
+[<cebbert@redhat.com>: removed changelog part of patch]
+
+Cc: Chuck Ebbert <cebbert@redhat.com>
+Signed-off-by: Alan Tyso <atyson@hp.com>
+Signed-off-by: Jeff Layton <jlayton@redhat.com>
+Signed-off-by: Steve French <sfrench@us.ibm.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+
+---
+ fs/cifs/inode.c | 6 ++++++
+ fs/cifs/readdir.c | 4 ++++
+ 2 files changed, 10 insertions(+)
+
+--- a/fs/cifs/inode.c
++++ b/fs/cifs/inode.c
+@@ -488,6 +488,12 @@ int cifs_get_inode_info(struct inode **p
+ mode e.g. 555 */
+ if (cifsInfo->cifsAttrs & ATTR_READONLY)
+ inode->i_mode &= ~(S_IWUGO);
++ else if ((inode->i_mode & S_IWUGO) == 0)
++ /* the ATTR_READONLY flag may have been */
++ /* changed on server -- set any w bits */
++ /* allowed by mnt_file_mode */
++ inode->i_mode |= (S_IWUGO &
++ cifs_sb->mnt_file_mode);
+ /* BB add code here -
+ validate if device or weird share or device type? */
+ }
+--- a/fs/cifs/readdir.c
++++ b/fs/cifs/readdir.c
+@@ -215,6 +215,10 @@ static void fill_in_inode(struct inode *
+ tmp_inode->i_mode |= S_IFREG;
+ if (attr & ATTR_READONLY)
+ tmp_inode->i_mode &= ~(S_IWUGO);
++ else if ((tmp_inode->i_mode & S_IWUGO) == 0)
++ /* the ATTR_READONLY flag may have been changed on */
++ /* server -- set any w bits allowed by mnt_file_mode */
++ tmp_inode->i_mode |= (S_IWUGO & cifs_sb->mnt_file_mode);
+ } /* could add code here - to validate if device or weird share type? */
+
+ /* can not fill in nlink here as in qpathinfo version and Unx search */
--- /dev/null
+From stable-bounces@linux.kernel.org Wed Mar 28 14:51:28 2007
+From: J. Bruce Fields <bfields@citi.umich.edu>
+Date: Wed, 28 Mar 2007 17:50:11 -0400
+Subject: CRYPTO: api: scatterwalk_copychunks() fails to advance through scatterlist
+To: linux-stable <stable@kernel.org>
+Message-ID: <460AE313.3050009@redhat.com>
+
+From: J. Bruce Fields <bfields@citi.umich.edu>
+
+[CRYPTO] api: scatterwalk_copychunks() fails to advance through scatterlist
+
+In the loop in scatterwalk_copychunks(), if walk->offset is zero,
+then scatterwalk_pagedone rounds that up to the nearest page boundary:
+
+ walk->offset += PAGE_SIZE - 1;
+ walk->offset &= PAGE_MASK;
+
+which is a no-op in this case, so we don't advance to the next element
+of the scatterlist array:
+
+ if (walk->offset >= walk->sg->offset + walk->sg->length)
+ scatterwalk_start(walk, sg_next(walk->sg));
+
+and we end up copying the same data twice.
+
+It appears that other callers of scatterwalk_{page}done first advance
+walk->offset, so I believe that's the correct thing to do here.
+
+This caused a bug in NFS when run with krb5p security, which would
+cause some writes to fail with permissions errors--for example, writes
+of less than 8 bytes (the des blocksize) at the start of a file.
+
+A git-bisect shows the bug was originally introduced by
+5c64097aa0f6dc4f27718ef47ca9a12538d62860, first in 2.6.19-rc1.
+
+Cc: Chuck Ebbert <cebbert@redhat.com>
+Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
+Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ crypto/scatterwalk.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/crypto/scatterwalk.c
++++ b/crypto/scatterwalk.c
+@@ -91,6 +91,8 @@ void scatterwalk_copychunks(void *buf, s
+ memcpy_dir(buf, vaddr, len_this_page, out);
+ scatterwalk_unmap(vaddr, out);
+
++ scatterwalk_advance(walk, nbytes);
++
+ if (nbytes == len_this_page)
+ break;
+
+@@ -99,7 +101,5 @@ void scatterwalk_copychunks(void *buf, s
+
+ scatterwalk_pagedone(walk, out, 1);
+ }
+-
+- scatterwalk_advance(walk, nbytes);
+ }
+ EXPORT_SYMBOL_GPL(scatterwalk_copychunks);
--- /dev/null
+From stable-bounces@linux.kernel.org Wed Mar 28 15:36:56 2007
+From: Mark Lord <liml@rtr.ca>
+Date: Wed, 28 Mar 2007 18:35:21 -0400
+Subject: libata bugfix: HDIO_DRIVE_TASK
+To: linux-stable <stable@kernel.org>
+Message-ID: <460AEDA9.6040901@redhat.com>
+
+From: Mark Lord <liml@rtr.ca>
+
+libata bugfix: HDIO_DRIVE_TASK
+
+I was trying to use HDIO_DRIVE_TASK for something today,
+and discovered that the libata implementation does not copy
+over the upper four LBA bits from args[6].
+
+This is serious, as any tools using this ioctl would have their
+commands applied to the wrong sectors on the drive, possibly resulting
+in disk corruption.
+
+Ideally, newer apps should use SG_IO/ATA_16 directly,
+avoiding this bug. But with libata poised to displace drivers/ide,
+better compatibility here is a must.
+
+This patch fixes libata to use the upper four LBA bits passed
+in from the ioctl.
+
+The original drivers/ide implementation copies over all bits
+except for the master/slave select bit. With this patch,
+libata will copy only the four high-order LBA bits,
+just in case there are assumptions elsewhere in libata (?).
+
+Signed-off-by: Mark Lord <mlord@pobox.com>
+Cc: Chuck Ebbert <cebbert@redhat.com>
+Signed-off-by: Jeff Garzik <jeff@garzik.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+
+---
+ drivers/ata/libata-scsi.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/ata/libata-scsi.c
++++ b/drivers/ata/libata-scsi.c
+@@ -295,6 +295,7 @@ int ata_task_ioctl(struct scsi_device *s
+ scsi_cmd[8] = args[3];
+ scsi_cmd[10] = args[4];
+ scsi_cmd[12] = args[5];
++ scsi_cmd[13] = args[6] & 0x0f;
+ scsi_cmd[14] = args[0];
+
+ /* Good values for timeout and retries? Values below
--- /dev/null
+From stable-bounces@linux.kernel.org Wed Mar 28 15:35:05 2007
+From: Tejun Heo <htejun@gmail.com>
+Date: Wed, 28 Mar 2007 18:33:39 -0400
+Subject: libata: clear TF before IDENTIFYing
+To: linux-stable <stable@kernel.org>
+Message-ID: <460AED43.5010101@redhat.com>
+
+From: Tejun Heo <htejun@gmail.com>
+
+libata: clear TF before IDENTIFYing
+
+Some devices chock if Feature is not clear when IDENTIFY is issued.
+Set ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE for IDENTIFY such that whole
+TF is cleared when reading ID data.
+
+Kudos to Art Haas for testing various futile patches over several
+months and Mark Lord for pointing out the fix.
+
+Signed-off-by: Tejun Heo <htejun@gmail.com>
+Cc: Art Haas <ahaas@airmail.net>
+Cc: Mark Lord <mlord@pobox.com>
+Cc: Chuck Ebbert <cebbert@redhat.com>
+Signed-off-by: Jeff Garzik <jeff@garzik.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/ata/libata-core.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+--- a/drivers/ata/libata-core.c
++++ b/drivers/ata/libata-core.c
+@@ -1478,7 +1478,16 @@ int ata_dev_read_id(struct ata_device *d
+ }
+
+ tf.protocol = ATA_PROT_PIO;
+- tf.flags |= ATA_TFLAG_POLLING; /* for polling presence detection */
++
++ /* Some devices choke if TF registers contain garbage. Make
++ * sure those are properly initialized.
++ */
++ tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
++
++ /* Device presence detection is unreliable on some
++ * controllers. Always poll IDENTIFY if available.
++ */
++ tf.flags |= ATA_TFLAG_POLLING;
+
+ err_mask = ata_exec_internal(dev, &tf, NULL, DMA_FROM_DEVICE,
+ id, sizeof(id[0]) * ATA_ID_WORDS);
--- /dev/null
+From stable-bounces@linux.kernel.org Wed Mar 28 15:39:38 2007
+From: Jeff Garzik <jeff@garzik.org>
+Date: Wed, 28 Mar 2007 18:38:16 -0400
+Subject: libata: sata_mv: don't touch reserved bits in EDMA config register
+To: linux-stable <stable@kernel.org>
+Message-ID: <460AEE58.2080205@redhat.com>
+
+From: Jeff Garzik <jeff@garzik.org>
+
+[libata] sata_mv: don't touch reserved bits in EDMA config register
+
+The code in mv_edma_cfg() reflected its 60xx origins, by doing things
+[slightly] incorrectly on the older 50xx and newer 6042/7042 chips.
+
+Clean up the EDMA configuration setup such that, each chip family
+carefully initializes its own EDMA setup.
+
+Cc: Chuck Ebbert <cebbert@redhat.com>
+Signed-off-by: Jeff Garzik <jeff@garzik.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+
+---
+ drivers/ata/sata_mv.c | 20 ++++++++++++--------
+ 1 file changed, 12 insertions(+), 8 deletions(-)
+
+--- a/drivers/ata/sata_mv.c
++++ b/drivers/ata/sata_mv.c
+@@ -843,23 +843,27 @@ static void mv_edma_cfg(struct mv_host_p
+ u32 cfg = readl(port_mmio + EDMA_CFG_OFS);
+
+ /* set up non-NCQ EDMA configuration */
+- cfg &= ~0x1f; /* clear queue depth */
+- cfg &= ~EDMA_CFG_NCQ; /* clear NCQ mode */
+ cfg &= ~(1 << 9); /* disable equeue */
+
+- if (IS_GEN_I(hpriv))
++ if (IS_GEN_I(hpriv)) {
++ cfg &= ~0x1f; /* clear queue depth */
+ cfg |= (1 << 8); /* enab config burst size mask */
++ }
+
+- else if (IS_GEN_II(hpriv))
++ else if (IS_GEN_II(hpriv)) {
++ cfg &= ~0x1f; /* clear queue depth */
+ cfg |= EDMA_CFG_RD_BRST_EXT | EDMA_CFG_WR_BUFF_LEN;
++ cfg &= ~(EDMA_CFG_NCQ | EDMA_CFG_NCQ_GO_ON_ERR); /* clear NCQ */
++ }
+
+ else if (IS_GEN_IIE(hpriv)) {
+- cfg |= (1 << 23); /* dis RX PM port mask */
+- cfg &= ~(1 << 16); /* dis FIS-based switching (for now) */
++ cfg |= (1 << 23); /* do not mask PM field in rx'd FIS */
++ cfg |= (1 << 22); /* enab 4-entry host queue cache */
+ cfg &= ~(1 << 19); /* dis 128-entry queue (for now?) */
+ cfg |= (1 << 18); /* enab early completion */
+- cfg |= (1 << 17); /* enab host q cache */
+- cfg |= (1 << 22); /* enab cutthrough */
++ cfg |= (1 << 17); /* enab cut-through (dis stor&forwrd) */
++ cfg &= ~(1 << 16); /* dis FIS-based switching (for now) */
++ cfg &= ~(EDMA_CFG_NCQ | EDMA_CFG_NCQ_GO_ON_ERR); /* clear NCQ */
+ }
+
+ writelfl(cfg, port_mmio + EDMA_CFG_OFS);
--- /dev/null
+From stable-bounces@linux.kernel.org Wed Mar 28 15:40:38 2007
+From: Jeff Garzik <jeff@garzik.org>
+Date: Wed, 28 Mar 2007 18:39:22 -0400
+Subject: libata: sata_mv: Fix 50xx irq mask
+To: linux-stable <stable@kernel.org>
+Message-ID: <460AEE9A.8000105@redhat.com>
+
+
+From: Jeff Garzik <jeff@garzik.org>
+
+[libata] sata_mv: Fix 50xx irq mask
+
+IRQ mask bits assumed a 60xx or newer generation chip, which is very
+wrong for the 50xx series. Luckily both generations shared the per-port
+interrupt mask bits, leaving only the "misc chip features" bits to be
+completely mismatched.
+
+Fix 50xx by ensuring we only program bits that exist.
+
+Cc: Chuck Ebbert <cebbert@redhat.com>
+Signed-off-by: Jeff Garzik <jeff@garzik.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+
+---
+ drivers/ata/sata_mv.c | 11 ++++++++++-
+ 1 file changed, 10 insertions(+), 1 deletion(-)
+
+--- a/drivers/ata/sata_mv.c
++++ b/drivers/ata/sata_mv.c
+@@ -139,14 +139,19 @@ enum {
+ PCI_ERR = (1 << 18),
+ TRAN_LO_DONE = (1 << 19), /* 6xxx: IRQ coalescing */
+ TRAN_HI_DONE = (1 << 20), /* 6xxx: IRQ coalescing */
++ PORTS_0_3_COAL_DONE = (1 << 8),
++ PORTS_4_7_COAL_DONE = (1 << 17),
+ PORTS_0_7_COAL_DONE = (1 << 21), /* 6xxx: IRQ coalescing */
+ GPIO_INT = (1 << 22),
+ SELF_INT = (1 << 23),
+ TWSI_INT = (1 << 24),
+ HC_MAIN_RSVD = (0x7f << 25), /* bits 31-25 */
++ HC_MAIN_RSVD_5 = (0x1fff << 19), /* bits 31-19 */
+ HC_MAIN_MASKED_IRQS = (TRAN_LO_DONE | TRAN_HI_DONE |
+ PORTS_0_7_COAL_DONE | GPIO_INT | TWSI_INT |
+ HC_MAIN_RSVD),
++ HC_MAIN_MASKED_IRQS_5 = (PORTS_0_3_COAL_DONE | PORTS_4_7_COAL_DONE |
++ HC_MAIN_RSVD_5),
+
+ /* SATAHC registers */
+ HC_CFG_OFS = 0,
+@@ -2287,7 +2292,11 @@ static int mv_init_host(struct pci_dev *
+
+ /* and unmask interrupt generation for host regs */
+ writelfl(PCI_UNMASK_ALL_IRQS, mmio + PCI_IRQ_MASK_OFS);
+- writelfl(~HC_MAIN_MASKED_IRQS, mmio + HC_MAIN_IRQ_MASK_OFS);
++
++ if (IS_50XX(hpriv))
++ writelfl(~HC_MAIN_MASKED_IRQS_5, mmio + HC_MAIN_IRQ_MASK_OFS);
++ else
++ writelfl(~HC_MAIN_MASKED_IRQS, mmio + HC_MAIN_IRQ_MASK_OFS);
+
+ VPRINTK("HC MAIN IRQ cause/mask=0x%08x/0x%08x "
+ "PCI int cause/mask=0x%08x/0x%08x\n",
jmicron-make-ide-jmicron-driver-play-nice-with-libata-ones.patch
i2o-block-io-errors-on-i2o-disk.patch
ide-revert-ide-fix-drive-side-80c-cable-check-take-2-for-now.patch
+cifs-allow-reset-of-file-to-attr_normal-when-archive-bit-not-set.patch
+cifs-reset-mode-when-client-notices-that-attr_readonly-is-no-longer-set.patch
+crypto-api-scatterwalk_copychunks-fails-to-advance-through-scatterlist.patch
+libata-clear-tf-before-identifying.patch
+libata-bugfix-hdio_drive_task.patch
+libata-sata_mv-don-t-touch-reserved-bits-in-edma-config-register.patch
+libata-sata_mv-fix-50xx-irq-mask.patch