mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-25 05:04:09 +08:00
NFS: Fix a tracepoint NULL-pointer dereference
Running xfstest generic/013 with the tracepoint nfs:nfs4_open_file enabled produces a NULL-pointer dereference when calculating fileid and filehandle of the opened file. Fix this by checking if state is NULL before trying to use the inode pointer. Reported-by: Olga Kornievskaia <aglo@umich.edu> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
parent
8dbb09570d
commit
39d0d3bdf7
@ -409,7 +409,7 @@ DECLARE_EVENT_CLASS(nfs4_open_event,
|
||||
__entry->flags = flags;
|
||||
__entry->fmode = (__force unsigned int)ctx->mode;
|
||||
__entry->dev = ctx->dentry->d_sb->s_dev;
|
||||
if (!IS_ERR(state))
|
||||
if (!IS_ERR_OR_NULL(state))
|
||||
inode = state->inode;
|
||||
if (inode != NULL) {
|
||||
__entry->fileid = NFS_FILEID(inode);
|
||||
|
Loading…
Reference in New Issue
Block a user