Re: [PATCH 3/8] iomap/xfs: wire up file_operations ->iopoll()

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

 



On 11/21/18 2:15 AM, Benny Halevy wrote:
>> +int iomap_dio_iopoll(struct kiocb *kiocb, bool spin)
>> +{
>> +	struct iomap_dio *dio = kiocb->private;
>> +	struct request_queue *q = READ_ONCE(dio->last_queue);
>> +
>> +	if (!q || dio->cookie == BLK_QC_T_NONE)
>> +		return 0;
>> +	return blk_poll(q, READ_ONCE(dio->cookie), spin);
> 
> How about:
> 	blk_qc_t cookie = READ_ONCE(dio->cookie);
> 
> 	if (!q || cookie == BLK_QC_T_NONE)
> 		return 0;
> 	return blk_poll(q, cookie, spin);
> 
> Is there a chance the dio->cookie in the if () condition
> will be stale?

I've rewritten this one, more importantly it needs to guard against
submission by ensuring that 'dio' is valid.

-- 
Jens Axboe




[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