[Xen-devel] [PATCH v2 3/3] xen/blkback: Use refcount_t for refcount

2019-08-13 Thread Chuhong Yuan
Reference counters are preferred to use refcount_t instead of atomic_t. This is because the implementation of refcount_t can prevent overflows and detect possible use-after-free. So convert atomic_t ref counters to refcount_t. Signed-off-by: Chuhong Yuan --- Changes in v2: - Also convert

Re: [Xen-devel] [PATCH 3/3] xen/blkback: Use refcount_t for refcount

2019-08-13 Thread Chuhong Yuan
On Thu, Aug 8, 2019 at 9:35 PM Roger Pau Monné wrote: > > On Thu, Aug 08, 2019 at 09:11:00PM +0800, Chuhong Yuan wrote: > > Reference counters are preferred to use refcount_t instead of > > atomic_t. > > This is because the implementation of refcount_t can prevent

Re: [Xen-devel] [PATCH 3/3] xen/blkback: Use refcount_t for refcount

2019-08-08 Thread Chuhong Yuan
On Thu, Aug 8, 2019 at 9:35 PM Roger Pau Monné wrote: > > On Thu, Aug 08, 2019 at 09:11:00PM +0800, Chuhong Yuan wrote: > > Reference counters are preferred to use refcount_t instead of > > atomic_t. > > This is because the implementation of refcount_t can prevent

[Xen-devel] [PATCH 3/3] xen/blkback: Use refcount_t for refcount

2019-08-08 Thread Chuhong Yuan
Reference counters are preferred to use refcount_t instead of atomic_t. This is because the implementation of refcount_t can prevent overflows and detect possible use-after-free. So convert atomic_t ref counters to refcount_t. Signed-off-by: Chuhong Yuan --- drivers/block/xen-blkback/common.h