Re: [PATCH] dmabuf: ensure unique directory name for dmabuf stats

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

 



Am 10.05.22 um 14:16 schrieb Charan Teja Kalla:
Thanks Christian for the inputs!!

On 5/10/2022 5:05 PM, Christian König wrote:
And what's to keep the seconds field from also being the same?
Well exporting two DMA-bufs with the same ino in the same nanosecond
should be basically impossible, but I would rather opt for using a 64bit
atomic in that function.

This should be 100% UAPI compatible and even if we manage to create one
buffer ever ns we need ~500years to wrap around.
I see that the inode->i_ctime->tv_sec is already defined as
64bit(time64_t tv_sec), hence used it. This way we don't need extra
static atomic_t variable just to get a unique name.

Just pasting excerpt from the reply posted to Greg about why this secs
will always be a unique: with secs field added, to get the same
inode-secs string, the uint should overflow in the same second which is
impossible.

Let me know If you still opt for atomic variable only.

I think just using a static atomic variable here would be cleaner, that is 100% unique.

Your approach should probably work as well, but it looks quite constructed.

Regards,
Christian.



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux