Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 109231
b: refs/heads/master
c: ee7cbab
h: refs/heads/master
i:
  109229: 66338cd
  109227: e4f06d5
  109223: d24264b
  109215: 196170d
v: v3
  • Loading branch information
Linus Torvalds committed Aug 27, 2008
1 parent 3e5a89e commit 99a54c9
Show file tree
Hide file tree
Showing 55 changed files with 703 additions and 590 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3ccd3ec6d4a7750c49c4d2bbcc1d0e82cd4c8a7f
refs/heads/master: ee7cbabbd359b5d9a60de3d5f1693163e07987ca
19 changes: 12 additions & 7 deletions trunk/arch/alpha/kernel/osf_sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,24 +121,29 @@ osf_filldir(void *__buf, const char *name, int namlen, loff_t offset,
if (reclen > buf->count)
return -EINVAL;
d_ino = ino;
if (sizeof(d_ino) < sizeof(ino) && d_ino != ino)
if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) {
buf->error = -EOVERFLOW;
return -EOVERFLOW;
}
if (buf->basep) {
if (put_user(offset, buf->basep))
return -EFAULT;
goto Efault;
buf->basep = NULL;
}
dirent = buf->dirent;
put_user(d_ino, &dirent->d_ino);
put_user(namlen, &dirent->d_namlen);
put_user(reclen, &dirent->d_reclen);
if (copy_to_user(dirent->d_name, name, namlen) ||
if (put_user(d_ino, &dirent->d_ino) ||
put_user(namlen, &dirent->d_namlen) ||
put_user(reclen, &dirent->d_reclen) ||
copy_to_user(dirent->d_name, name, namlen) ||
put_user(0, dirent->d_name + namlen))
return -EFAULT;
goto Efault;
dirent = (void __user *)dirent + reclen;
buf->dirent = dirent;
buf->count -= reclen;
return 0;
Efault:
buf->error = -EFAULT;
return -EFAULT;
}

asmlinkage int
Expand Down
30 changes: 19 additions & 11 deletions trunk/arch/parisc/hpux/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,22 +84,28 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset,
if (reclen > buf->count)
return -EINVAL;
d_ino = ino;
if (sizeof(d_ino) < sizeof(ino) && d_ino != ino)
if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) {
buf->error = -EOVERFLOW;
return -EOVERFLOW;
}
dirent = buf->previous;
if (dirent)
put_user(offset, &dirent->d_off);
if (put_user(offset, &dirent->d_off))
goto Efault;
dirent = buf->current_dir;
if (put_user(d_ino, &dirent->d_ino) ||
put_user(reclen, &dirent->d_reclen) ||
put_user(namlen, &dirent->d_namlen) ||
copy_to_user(dirent->d_name, name, namlen) ||
put_user(0, dirent->d_name + namlen))
goto Efault;
buf->previous = dirent;
put_user(d_ino, &dirent->d_ino);
put_user(reclen, &dirent->d_reclen);
put_user(namlen, &dirent->d_namlen);
copy_to_user(dirent->d_name, name, namlen);
put_user(0, dirent->d_name + namlen);
dirent = (void __user *)dirent + reclen;
buf->current_dir = dirent;
buf->current_dir = (void __user *)dirent + reclen;
buf->count -= reclen;
return 0;
Efault:
buffer->error = -EFAULT;
return -EFAULT;
}

#undef NAME_OFFSET
Expand All @@ -126,8 +132,10 @@ int hpux_getdents(unsigned int fd, struct hpux_dirent __user *dirent, unsigned i
error = buf.error;
lastdirent = buf.previous;
if (lastdirent) {
put_user(file->f_pos, &lastdirent->d_off);
error = count - buf.count;
if (put_user(file->f_pos, &lastdirent->d_off))
error = -EFAULT;
else
error = count - buf.count;
}

out_putf:
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/s390/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ SECTIONS
__start___ex_table = .;
*(__ex_table)
__stop___ex_table = .;
}
} :data

.data : { /* Data */
DATA_DATA
Expand Down
8 changes: 6 additions & 2 deletions trunk/arch/sparc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,24 @@ endif
export INIT_Y CORE_Y DRIVERS_Y NET_Y LIBS_Y HEAD_Y kallsyms.o

# Default target
all: image
all: zImage

boot := arch/sparc/boot

image tftpboot.img: vmlinux
image zImage tftpboot.img: vmlinux
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

archclean:
$(Q)$(MAKE) $(clean)=$(boot)

# This is the image used for packaging
KBUILD_IMAGE := $(boot)/zImage

CLEAN_FILES += arch/$(ARCH)/boot/System.map

# Don't use tabs in echo arguments.
define archhelp
echo '* image - kernel image ($(boot)/image)'
echo '* zImage - stripped kernel image ($(boot)/zImage)'
echo ' tftpboot.img - image prepared for tftp'
endef
6 changes: 6 additions & 0 deletions trunk/arch/sparc/boot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ quiet_cmd_sysmap = SYSMAP $(obj)/System.map
cmd_sysmap = $(CONFIG_SHELL) $(srctree)/scripts/mksysmap
quiet_cmd_image = LD $@
cmd_image = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_$(@F)) -o $@
quiet_cmd_strip = STRIP $@
cmd_strip = $(STRIP) -R .comment -R .note -K sun4u_init -K _end -K _start $(obj)/image -o $@


define rule_image
$(if $($(quiet)cmd_image), \
Expand Down Expand Up @@ -49,6 +52,9 @@ LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds $(BTOBJS) \
$(obj)/image: $(obj)/btfix.o FORCE
$(call if_changed_rule,image)

$(obj)/zImage: $(obj)/image
$(call if_changed,strip)

$(obj)/tftpboot.img: $(obj)/piggyback $(obj)/System.map $(obj)/image FORCE
$(call if_changed,elftoaout)
$(call if_changed,piggy)
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/sparc64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ endmenu

config NUMA
bool "NUMA support"
depends on SMP

config NODES_SHIFT
int
Expand Down
2 changes: 2 additions & 0 deletions trunk/block/blk-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,8 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id)

q->sg_reserved_size = INT_MAX;

blk_set_cmd_filter_defaults(&q->cmd_filter);

/*
* all done
*/
Expand Down
6 changes: 2 additions & 4 deletions trunk/block/blk-tag.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ static int __blk_free_tags(struct blk_queue_tag *bqt)

retval = atomic_dec_and_test(&bqt->refcnt);
if (retval) {
BUG_ON(bqt->busy);
BUG_ON(find_first_bit(bqt->tag_map, bqt->max_depth) <
bqt->max_depth);

kfree(bqt->tag_index);
bqt->tag_index = NULL;
Expand Down Expand Up @@ -147,7 +148,6 @@ static struct blk_queue_tag *__blk_queue_init_tags(struct request_queue *q,
if (init_tag_map(q, tags, depth))
goto fail;

tags->busy = 0;
atomic_set(&tags->refcnt, 1);
return tags;
fail:
Expand Down Expand Up @@ -313,7 +313,6 @@ void blk_queue_end_tag(struct request_queue *q, struct request *rq)
* unlock memory barrier semantics.
*/
clear_bit_unlock(tag, bqt->tag_map);
bqt->busy--;
}
EXPORT_SYMBOL(blk_queue_end_tag);

Expand Down Expand Up @@ -368,7 +367,6 @@ int blk_queue_start_tag(struct request_queue *q, struct request *rq)
bqt->tag_index[tag] = rq;
blkdev_dequeue_request(rq);
list_add(&rq->queuelist, &q->tag_busy_list);
bqt->busy++;
return 0;
}
EXPORT_SYMBOL(blk_queue_start_tag);
Expand Down
44 changes: 11 additions & 33 deletions trunk/block/bsg.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ struct bsg_device {
char name[BUS_ID_SIZE];
int max_queue;
unsigned long flags;
struct blk_scsi_cmd_filter *cmd_filter;
mode_t *f_mode;
};

enum {
Expand Down Expand Up @@ -174,7 +172,8 @@ static int bsg_io_schedule(struct bsg_device *bd)
}

static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq,
struct sg_io_v4 *hdr, struct bsg_device *bd)
struct sg_io_v4 *hdr, struct bsg_device *bd,
int has_write_perm)
{
if (hdr->request_len > BLK_MAX_CDB) {
rq->cmd = kzalloc(hdr->request_len, GFP_KERNEL);
Expand All @@ -187,8 +186,7 @@ static int blk_fill_sgv4_hdr_rq(struct request_queue *q, struct request *rq,
return -EFAULT;

if (hdr->subprotocol == BSG_SUB_PROTOCOL_SCSI_CMD) {
if (blk_cmd_filter_verify_command(bd->cmd_filter, rq->cmd,
bd->f_mode))
if (blk_verify_command(&q->cmd_filter, rq->cmd, has_write_perm))
return -EPERM;
} else if (!capable(CAP_SYS_RAWIO))
return -EPERM;
Expand Down Expand Up @@ -244,7 +242,7 @@ bsg_validate_sgv4_hdr(struct request_queue *q, struct sg_io_v4 *hdr, int *rw)
* map sg_io_v4 to a request.
*/
static struct request *
bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr)
bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, int has_write_perm)
{
struct request_queue *q = bd->queue;
struct request *rq, *next_rq = NULL;
Expand All @@ -266,7 +264,7 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr)
rq = blk_get_request(q, rw, GFP_KERNEL);
if (!rq)
return ERR_PTR(-ENOMEM);
ret = blk_fill_sgv4_hdr_rq(q, rq, hdr, bd);
ret = blk_fill_sgv4_hdr_rq(q, rq, hdr, bd, has_write_perm);
if (ret)
goto out;

Expand Down Expand Up @@ -568,25 +566,6 @@ static inline void bsg_set_block(struct bsg_device *bd, struct file *file)
set_bit(BSG_F_BLOCK, &bd->flags);
}

static void bsg_set_cmd_filter(struct bsg_device *bd,
struct file *file)
{
struct inode *inode;
struct gendisk *disk;

if (!file)
return;

inode = file->f_dentry->d_inode;
if (!inode)
return;

disk = inode->i_bdev->bd_disk;

bd->cmd_filter = &disk->cmd_filter;
bd->f_mode = &file->f_mode;
}

/*
* Check if the error is a "real" error that we should return.
*/
Expand All @@ -608,7 +587,6 @@ bsg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
dprintk("%s: read %Zd bytes\n", bd->name, count);

bsg_set_block(bd, file);
bsg_set_cmd_filter(bd, file);

bytes_read = 0;
ret = __bsg_read(buf, count, bd, NULL, &bytes_read);
Expand All @@ -621,7 +599,7 @@ bsg_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
}

static int __bsg_write(struct bsg_device *bd, const char __user *buf,
size_t count, ssize_t *bytes_written)
size_t count, ssize_t *bytes_written, int has_write_perm)
{
struct bsg_command *bc;
struct request *rq;
Expand Down Expand Up @@ -652,7 +630,7 @@ static int __bsg_write(struct bsg_device *bd, const char __user *buf,
/*
* get a request, fill in the blanks, and add to request queue
*/
rq = bsg_map_hdr(bd, &bc->hdr);
rq = bsg_map_hdr(bd, &bc->hdr, has_write_perm);
if (IS_ERR(rq)) {
ret = PTR_ERR(rq);
rq = NULL;
Expand Down Expand Up @@ -683,10 +661,11 @@ bsg_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
dprintk("%s: write %Zd bytes\n", bd->name, count);

bsg_set_block(bd, file);
bsg_set_cmd_filter(bd, file);

bytes_written = 0;
ret = __bsg_write(bd, buf, count, &bytes_written);
ret = __bsg_write(bd, buf, count, &bytes_written,
file->f_mode & FMODE_WRITE);

*ppos = bytes_written;

/*
Expand Down Expand Up @@ -792,7 +771,6 @@ static struct bsg_device *bsg_add_device(struct inode *inode,
bd->queue = rq;

bsg_set_block(bd, file);
bsg_set_cmd_filter(bd, file);

atomic_set(&bd->ref_count, 1);
mutex_lock(&bsg_mutex);
Expand Down Expand Up @@ -943,7 +921,7 @@ static long bsg_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
if (copy_from_user(&hdr, uarg, sizeof(hdr)))
return -EFAULT;

rq = bsg_map_hdr(bd, &hdr);
rq = bsg_map_hdr(bd, &hdr, file->f_mode & FMODE_WRITE);
if (IS_ERR(rq))
return PTR_ERR(rq);

Expand Down
Loading

0 comments on commit 99a54c9

Please sign in to comment.