Re: [PATCH 2/5] iomap: add per-iomap_iter private data

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

 



On Thu, May 05, 2022 at 11:06:50AM +0300, Nikolay Borisov wrote:
>> @@ -520,6 +520,14 @@ __iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter,
>>   	dio->submit.waiter = current;
>>   	dio->submit.poll_bio = NULL;
>>   +	/*
>> +	 * Transfer the private data that was passed by the caller to the
>> +	 * iomap_iter, and clear it in the iocb, as iocb->private will be
>> +	 * used for polled bio completion later.
>> +	 */
>> +	iomi.private = iocb->private;
>> +	WRITE_ONCE(iocb->private, NULL);
>
> nit: Why use WRITE_ONCE here? Generaly when it's used it will suggest to 
> the reader something funny is going on with accessing that variable without 
> holding a particular lock?

Because we use WRITE_ONCE on iocb->private later on when we use it to
store the bio that is polled for, and we really want the store that
clears it to NULL to be done before we start dealing with bio submission.



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

  Powered by Linux