diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2013-08-05 18:53:59 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2013-08-05 18:53:59 +0000 |
commit | 8239a7a878179bc34b2c695d1975d8c6e4d87358 (patch) | |
tree | 52e9296eaae28bf8ae2fb9cf87ba3ece87fd7e33 /sys/fs/tmpfs/tmpfs.h | |
parent | 7301d64abadfda5358c099eda74a18e2c63eaf77 (diff) | |
download | src-8239a7a878179bc34b2c695d1975d8c6e4d87358.tar.gz src-8239a7a878179bc34b2c695d1975d8c6e4d87358.zip |
The tmpfs_alloc_vp() is used to instantiate vnode for the tmpfs node,
in particular, from the tmpfs_lookup VOP method. If LK_NOWAIT is not
specified in the lkflags, the lookup is supposed to return an alive
vnode whenever the underlying node is valid.
Currently, the tmpfs_alloc_vp() returns ENOENT if the vnode attached
to node exists and is being reclaimed. This causes spurious ENOENT
errors from lookup on tmpfs and corresponding random 'No such file'
failures from syscalls working with tmpfs files.
Fix this by waiting for the doomed vnode to be detached from the tmpfs
node if sleepable allocation is requested.
Note that filesystems which use vfs_hash.c, correctly handle the case
due to vfs_hash_get() looping when vget() returns ENOENT for sleepable
requests.
Reported and tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=253967
Diffstat (limited to 'sys/fs/tmpfs/tmpfs.h')
-rw-r--r-- | sys/fs/tmpfs/tmpfs.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/fs/tmpfs/tmpfs.h b/sys/fs/tmpfs/tmpfs.h index 5a27ccf90a2a..196749ba1015 100644 --- a/sys/fs/tmpfs/tmpfs.h +++ b/sys/fs/tmpfs/tmpfs.h @@ -307,6 +307,7 @@ LIST_HEAD(tmpfs_node_list, tmpfs_node); #define TMPFS_VNODE_ALLOCATING 1 #define TMPFS_VNODE_WANT 2 #define TMPFS_VNODE_DOOMED 4 +#define TMPFS_VNODE_WRECLAIM 8 /* --------------------------------------------------------------------- */ /* |