]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd4: preallocate nfs4_file in process_open1()
authorJ. Bruce Fields <bfields@redhat.com>
Thu, 13 Oct 2011 20:00:16 +0000 (16:00 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 17 Oct 2011 21:50:00 +0000 (17:50 -0400)
commit3e259ac3c52da24eda81ec1b2119e7aac44147f8
tree7d39ddbe4e421061f96d3dd5d64866b27117fd90
parent5ac6e79d9f698d711332287298b9efbc63c8c6a8
nfsd4: preallocate nfs4_file in process_open1()

Creating a new file is an irrevocable step--once it's visible in the
filesystem, other processes may have seen it and done something with it,
and unlinking it wouldn't simply undo the effects of the create.

Therefore, in the case where OPEN creates a new file, we shouldn't do
the create until we know that the rest of the OPEN processing will
succeed.

For example, we should preallocate a struct file in case we need it
until waiting to allocate it till process_open2(), which is already too
late.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4state.c
fs/nfsd/xdr4.h