VERSION = 2
PATCHLEVEL = 2
SUBLEVEL = 22
-EXTRAVERSION = rc2
+EXTRAVERSION = rc3
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
set_fs(old_fs);
if (retval < 0) {
- printk(KERN_WARNING "loop: cannot create block - FS write failed: code %d\n",
- retval);
+ printk(KERN_WARNING
+ "loop: cannot create block - FS write failed: code %d\n",
+ (int)retval);
return FALSE;
} else {
return TRUE;
goto out;
}
chidx = isdn_minor2chan(minor);
+ if (count > 131072) {
+ retval = -EINVAL;
+ goto out;
+ }
if (!(p = kmalloc(count, GFP_KERNEL))) {
retval = -ENOMEM;
goto out;
get_user_ret(bufsize, &info->oprom_size, -EFAULT);
- if (bufsize <= 0 || bufsize > OPROMMAXPARAM)
+ if (bufsize == 0 || bufsize > OPROMMAXPARAM)
return -EINVAL;
if (!(*opp_p = kmalloc(sizeof(int) + bufsize + 1, GFP_KERNEL)))
1.02.00.024 - Fix bug in raw command post with data ioctl method.
Fix bug where rollcall sometimes failed with cable errors.
1.02.00.025 - Print unit # on all command timeouts.
+ 1.02.00.026 - Fix possible infinite retry bug with power glitch induced
+ drive timeouts.
+ Cleanup some AEN severity levels.
+ 1.02.00.027 - Add drive not supported AEN code for SATA controllers.
+ Remove spurious unknown ioctl error message.
*/
#include <linux/module.h>
};
/* Globals */
-char *tw_driver_version="1.02.00.025";
+char *tw_driver_version="1.02.00.027";
TW_Device_Extension *tw_device_extension_list[TW_MAX_SLOT];
int tw_device_extension_count = 0;
{
TW_Param *param;
unsigned short aen;
- int error = 0;
+ int error = 0, table_max = 0;
if (tw_dev->alignment_virtual_address[request_id] == NULL) {
printk(KERN_WARNING "3w-xxxx: tw_aen_complete(): Bad alignment virtual address.\n");
if (aen == 0x0ff) {
printk(KERN_WARNING "3w-xxxx: scsi%d: AEN: INFO: AEN queue overflow.\n", tw_dev->host->host_no);
} else {
- if ((aen & 0x0ff) < TW_AEN_STRING_MAX) {
+ table_max = sizeof(tw_aen_string)/sizeof(char *);
+ if ((aen & 0x0ff) < table_max) {
if ((tw_aen_string[aen & 0xff][strlen(tw_aen_string[aen & 0xff])-1]) == '#') {
printk(KERN_WARNING "3w-xxxx: scsi%d: AEN: %s%d.\n", tw_dev->host->host_no, tw_aen_string[aen & 0xff], aen >> 8);
} else {
int first_reset = 0;
int queue = 0;
int imax, i;
- int found = 0;
+ int found = 0, table_max = 0;
dprintk(KERN_NOTICE "3w-xxxx: tw_aen_drain_queue()\n");
if (aen == 0x0ff) {
printk(KERN_WARNING "3w-xxxx: AEN: INFO: AEN queue overflow.\n");
} else {
- if ((aen & 0x0ff) < TW_AEN_STRING_MAX) {
+ table_max = sizeof(tw_aen_string)/sizeof(char *);
+ if ((aen & 0x0ff) < table_max) {
if ((tw_aen_string[aen & 0xff][strlen(tw_aen_string[aen & 0xff])-1]) == '#') {
printk(KERN_WARNING "3w-xxxx: AEN: %s%d.\n", tw_aen_string[aen & 0xff], aen >> 8);
} else {
/* If error, command failed */
if (error == 1) {
- tw_dev->srb[request_id]->result = (DID_RESET << 16);
+ /* Ask for a host reset */
+ tw_dev->srb[request_id]->result = (DID_OK << 16) | (CHECK_CONDITION << 1);
}
/* Now complete the io */
return 1;
}
default:
- printk(KERN_WARNING "3w-xxxx: Unknown ioctl 0x%x.\n", opcode);
+ dprintk(KERN_WARNING "3w-xxxx: Unknown ioctl 0x%x.\n", opcode);
tw_dev->state[request_id] = TW_S_COMPLETED;
tw_state_request_finish(tw_dev, request_id);
tw_dev->srb[request_id]->result = (DID_OK << 16);
"INFO: Verify started: Unit #", // 0x029
"ERROR: Verify failed: Port #", // 0x02A
"INFO: Verify complete: Unit #", // 0x02B
- "ERROR: Overwrote bad sector during rebuild: Port #", //0x02C
- "ERROR: Encountered bad sector during rebuild: Port #", //0x02D
- "INFO: Replacement drive is too small: Port #", //0x02E
- "WARNING: Verify error: Unit not previously initialized: Unit #" //0x02F
+ "WARNING: Overwrote bad sector during rebuild: Port #", //0x02C
+ "ERROR: Encountered bad sector during rebuild: Port #", //0x02D
+ "ERROR: Replacement drive is too small: Port #", //0x02E
+ "WARNING: Verify error: Unit not previously initialized: Unit #", //0x02F
+ "ERROR: Drive not supported: Port #" // 0x030
};
-#define TW_AEN_STRING_MAX 0x030
-
/*
Sense key lookup table
Format: ESDC/flags,SenseKey,AdditionalSenseCode,AdditionalSenseCodeQualifier
*/
static ssize_t mdc800_device_read (struct file *file, char *buf, size_t len, loff_t *pos)
{
- int left=len, sts=len; /* single transfer size */
+ size_t left=len, sts=len; /* single transfer size */
char* ptr=buf;
spin_lock (&mdc800->io_lock);
*/
static ssize_t mdc800_device_write (struct file *file, const char *buf, size_t len, loff_t *pos)
{
- int i=0;
+ size_t i=0;
spin_lock (&mdc800->io_lock);
if (mdc800->state != READY)
static ssize_t usblp_write(struct file *file, const char *buffer, size_t count, loff_t *ppos)
{
struct usblp *usblp = file->private_data;
- int timeout, err = 0, writecount = 0;
+ int timeout, err = 0;
+ size_t writecount = 0;
while (writecount < count) {
nfs_list_remove_request(req);
if (task->tk_status >= 0) {
- char *p = page_address(page);
+ char *p = (char *)page_address(page);
if (count < PAGE_CACHE_SIZE) {
memset(p + count, 0, PAGE_CACHE_SIZE - count);
count = 0;
if (!area)
return NULL;
size += PAGE_SIZE;
+ if (!size) {
+ kfree(area);
+ return NULL;
+ }
addr = VMALLOC_START;
for (p = &vmlist; (tmp = *p) ; p = &tmp->next) {
if ((size + addr) < addr) {
set_fs(oldfs);
#endif
- dprintk("svc: socket %p sendto([%p %d... ], %d, %d) = %d\n",
- rqstp->rq_sock,
- iov[0].iov_base, iov[0].iov_len, nr,
- buflen, len);
+ dprintk("svc: socket %p sendto([%p %lu... ], %d, %d) = %d\n",
+ rqstp->rq_sock,
+ iov[0].iov_base, (unsigned long)iov[0].iov_len, nr,
+ buflen, len);
return len;
}
set_fs(oldfs);
#endif
- dprintk("svc: socket %p recvfrom(%p, %d) = %d\n", rqstp->rq_sock,
- iov[0].iov_base, iov[0].iov_len, len);
+ dprintk("svc: socket %p recvfrom(%p, %lu) = %d\n", rqstp->rq_sock,
+ iov[0].iov_base, (unsigned long)iov[0].iov_len,
+ len);
return len;
}