Re: [PATCH 1/1] sget_dev() bug fix: dev_t passed by value but stored via stack address

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

 



> I don't think &dev makes sense here - it was passed by value so its
> address won't make sense outside the current context, right?. It seems

I don't follow, we only need that address to be valid until sget_dev()
returns as sget_key isn't used anymore. And we store the value, not the
address. Other than that it's a bit ugly it's fine afaict. Related
issues would exist with fuse or gfs2 where the lifetime of the key ends
right after the respective sget call returns. We could smooth this out
here by storing the value in the pointer via
#define devt_to_sget_key(dev) ((void *)((uintptr_t)(dev)))
#define sget_key_to_devt(key) ((dev_t)((uintptr_t)(key)))
but I'm not sure it's necessary. Unless I'm really missing something.




[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