Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88472
b: refs/heads/master
c: 1ae5c18
h: refs/heads/master
v: v3
  • Loading branch information
Roland Dreier committed Apr 17, 2008
1 parent 92c8485 commit 44a7791
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 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: 37608eea86a358ac6a18df0af55d4f77d08a1f30
refs/heads/master: 1ae5c187acb67c2929428479c23a79c4288f0c68
4 changes: 2 additions & 2 deletions trunk/drivers/infiniband/core/uverbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ struct ib_uverbs_device {

struct ib_uverbs_event_file {
struct kref ref;
struct file *file;
struct ib_uverbs_file *uverbs_file;
spinlock_t lock;
int is_async;
wait_queue_head_t poll_wait;
struct fasync_struct *async_queue;
struct list_head event_list;
int is_async;
int is_closed;
};

struct ib_uverbs_file {
Expand Down
9 changes: 4 additions & 5 deletions trunk/drivers/infiniband/core/uverbs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ static int ib_uverbs_event_close(struct inode *inode, struct file *filp)
struct ib_uverbs_event *entry, *tmp;

spin_lock_irq(&file->lock);
file->file = NULL;
file->is_closed = 1;
list_for_each_entry_safe(entry, tmp, &file->event_list, list) {
if (entry->counter)
list_del(&entry->obj_list);
Expand Down Expand Up @@ -390,7 +390,7 @@ void ib_uverbs_comp_handler(struct ib_cq *cq, void *cq_context)
return;

spin_lock_irqsave(&file->lock, flags);
if (!file->file) {
if (file->is_closed) {
spin_unlock_irqrestore(&file->lock, flags);
return;
}
Expand Down Expand Up @@ -423,7 +423,7 @@ static void ib_uverbs_async_handler(struct ib_uverbs_file *file,
unsigned long flags;

spin_lock_irqsave(&file->async_file->lock, flags);
if (!file->async_file->file) {
if (!file->async_file->is_closed) {
spin_unlock_irqrestore(&file->async_file->lock, flags);
return;
}
Expand Down Expand Up @@ -509,6 +509,7 @@ struct file *ib_uverbs_alloc_event_file(struct ib_uverbs_file *uverbs_file,
ev_file->uverbs_file = uverbs_file;
ev_file->async_queue = NULL;
ev_file->is_async = is_async;
ev_file->is_closed = 0;

*fd = get_unused_fd();
if (*fd < 0) {
Expand All @@ -522,8 +523,6 @@ struct file *ib_uverbs_alloc_event_file(struct ib_uverbs_file *uverbs_file,
goto err_fd;
}

ev_file->file = filp;

/*
* fops_get() can't fail here, because we're coming from a
* system call on a uverbs file, which will already have a
Expand Down

0 comments on commit 44a7791

Please sign in to comment.