mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +00:00
DEVEL15-linux-dont-flush-writes-on-exec-20080326
LICENSE IPL10
FIXES 17509
because of when fds are NULL'd in file_table this should work except when one process has the same file open for read and for write in different FDs; otherwise,
the last write fd to close collects the error.
(cherry picked from commit 1cf6c12a07
)
This commit is contained in:
parent
f64f192d63
commit
f5e8415f16
@ -582,18 +582,24 @@ afs_linux_flush(struct file *fp)
|
||||
#endif
|
||||
{
|
||||
struct vrequest treq;
|
||||
struct vcache *vcp = VTOAFS(FILE_INODE(fp));
|
||||
cred_t *credp = crref();
|
||||
struct vcache *vcp;
|
||||
cred_t *credp;
|
||||
int code;
|
||||
|
||||
AFS_GLOCK();
|
||||
|
||||
if (fp->f_flags | O_RDONLY) /* readers dont flush */
|
||||
return 0;
|
||||
|
||||
credp = crref();
|
||||
vcp = VTOAFS(FILE_INODE(fp));
|
||||
|
||||
code = afs_InitReq(&treq, credp);
|
||||
if (code)
|
||||
goto out;
|
||||
|
||||
ObtainSharedLock(&vcp->lock, 535);
|
||||
if (vcp->execsOrWriters > 0) {
|
||||
if ((vcp->execsOrWriters > 0) && (file_count(fp) == 1)) {
|
||||
UpgradeSToWLock(&vcp->lock, 536);
|
||||
code = afs_StoreAllSegments(vcp, &treq, AFS_SYNC | AFS_LASTSTORE);
|
||||
ConvertWToSLock(&vcp->lock);
|
||||
|
Loading…
Reference in New Issue
Block a user