RDMA/core: Do not allow alloc_commit to fail
authorJason Gunthorpe <jgg@mellanox.com>
Wed, 8 Jan 2020 17:21:56 +0000 (19:21 +0200)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 13 Jan 2020 20:20:15 +0000 (16:20 -0400)
commit849e149063bd10eb6211c14617491a0bc9516c2f
tree0696e4f12a98b37cb37f29c1d119cf234258395f
parent93887e66ff3c1a62c36a7f0eca9445063399b39d
RDMA/core: Do not allow alloc_commit to fail

This is a left over from an earlier version that creates a lot of
complexity for error unwind, particularly for FD uobjects.

The only reason this was done is so that anon_inode_get_file() could be
called with the final fops and a fully setup uobject. Both need to be
setup since unwinding anon_inode_get_file() via fput will call the
driver's release().

Now that the driver does not provide release, we no longer need to worry
about this complicated sequence, simply create the struct file at the
start and allow the core code's release function to deal with the abort
case.

This allows all the confusing error paths around commit to be removed.

Link: https://lore.kernel.org/r/1578504126-9400-5-git-send-email-yishaih@mellanox.com
Signed-off-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/rdma_core.c
drivers/infiniband/core/rdma_core.h
drivers/infiniband/core/uverbs_cmd.c
drivers/infiniband/core/uverbs_ioctl.c
include/rdma/uverbs_std_types.h
include/rdma/uverbs_types.h