mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
nfsd4: don't close read-write opens too soon
commit 0c7c3e67ab
upstream.
Don't actually close any opens until we don't need them at all.
This means being left with write access when it's not really necessary,
but that's better than putting a file that might still have posix locks
held on it, as we have been.
Reported-by: Toralf Förster <toralf.foerster@gmx.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ed9a34c5fc
commit
f71ce17ff8
1 changed files with 1 additions and 7 deletions
|
@ -213,13 +213,7 @@ static void __nfs4_file_put_access(struct nfs4_file *fp, int oflag)
|
|||
{
|
||||
if (atomic_dec_and_test(&fp->fi_access[oflag])) {
|
||||
nfs4_file_put_fd(fp, oflag);
|
||||
/*
|
||||
* It's also safe to get rid of the RDWR open *if*
|
||||
* we no longer have need of the other kind of access
|
||||
* or if we already have the other kind of open:
|
||||
*/
|
||||
if (fp->fi_fds[1-oflag]
|
||||
|| atomic_read(&fp->fi_access[1 - oflag]) == 0)
|
||||
if (atomic_read(&fp->fi_access[1 - oflag]) == 0)
|
||||
nfs4_file_put_fd(fp, O_RDWR);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue