]> git.baikalelectronics.ru Git - kernel.git/commit
NFS4: Only set creation opendata if O_CREAT
authorBenjamin Coddington <bcodding@redhat.com>
Fri, 7 Jun 2019 10:37:30 +0000 (06:37 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Fri, 21 Jun 2019 18:43:25 +0000 (14:43 -0400)
commit9af85c76ea8fd7b4da58ee0c5522b13e662c1ff6
tree3be6cbff83397bca6bf272bf6197ec99f4c928c8
parentdfe8599ce9df636226c8e6e1f358008c8db823fe
NFS4: Only set creation opendata if O_CREAT

We can end up in nfs4_opendata_alloc during task exit, in which case
current->fs has already been cleaned up.  This leads to a crash in
current_umask().

Fix this by only setting creation opendata if we are actually doing an open
with O_CREAT.  We can drop the check for NULL nfs4_open_createattrs, since
O_CREAT will never be set for the recovery path.

Suggested-by: Trond Myklebust <trondmy@hammerspace.com>
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/nfs4proc.c