Re: [PATCH 12/25] aio: Refcounting cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>  struct kioctx {
>  	atomic_t		users;
> -	int			dead;
> +	atomic_t		dead;

Do we want to be paranoid and atomic_set() that to 0 when the ioctx is
allocated?

> +	while (!list_empty(&ctx->active_reqs)) {
> +		struct list_head *pos = ctx->active_reqs.next;
> +		struct kiocb *iocb = list_kiocb(pos);

I'd use list_first_entry() and ignore the list_kiocb() wrapper, I think.

> +	if (!atomic_xchg(&ctx->dead, 1)) {
> +		hlist_del_rcu(&ctx->list);
> +		synchronize_rcu();

> +	hlist_for_each_entry_rcu(ctx, n, &mm->ioctx_list, list)
> +		if (ctx->user_id == ctx_id){
> +			BUG_ON(atomic_read(&ctx->dead));

Hmm.  Won't it be possible to race lookup and io_destroy() to hit this
BUG?

- z
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux