• J
    io_uring: add ->show_fdinfo() for the io_uring file descriptor · 80f00261
    Jens Axboe 提交于
    to #26323588
    
    commit 87ce955b24c9940cb2ca7e5173fcf175578d9fe9 upstream.
    
    It can be hard to know exactly what is registered with the ring.
    Especially for credentials, it'd be handy to be able to see which
    ones are registered, what personalities they have, and what the ID
    of each of them is.
    
    This adds support for showing information registered in the ring from
    the fdinfo of the io_uring fd. Here's an example from a test case that
    registers 4 files (two of them sparse), 4 buffers, and 2 personalities:
    
    pos:	0
    flags:	02000002
    mnt_id:	14
    UserFiles:	4
        0: file-no-1
        1: file-no-2
        2: <none>
        3: <none>
    UserBufs:	4
        0: 0x563817c46000/128
        1: 0x563817c47000/256
        2: 0x563817c48000/512
        3: 0x563817c49000/1024
    Personalities:
        1
    	Uid:	0		0		0		0
    	Gid:	0		0		0		0
    	Groups:	0
    	CapEff:	0000003fffffffff
        2
    	Uid:	0		0		0		0
    	Gid:	0		0		0		0
    	Groups:	0
    	CapEff:	0000003fffffffff
    Suggested-by: NJann Horn <jannh@google.com>
    Signed-off-by: NJens Axboe <axboe@kernel.dk>
    Signed-off-by: NJoseph Qi <joseph.qi@linux.alibaba.com>
    Acked-by: NXiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
    80f00261
io_uring.c 163.7 KB