Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177610706
D8030.1794834722.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D8030.1794834722.diff
View Options
Index: sys/kern/vfs_syscalls.c
===================================================================
--- sys/kern/vfs_syscalls.c
+++ sys/kern/vfs_syscalls.c
@@ -446,10 +446,11 @@
size_t *countp, enum uio_seg bufseg, int flags)
{
struct mount *mp, *nmp;
- struct statfs *sfsp, *sp, sb;
+ struct statfs *sfsp, *sp, sb, *tofree;
size_t count, maxcount;
int error;
+restart:
maxcount = bufsize / sizeof(struct statfs);
if (bufsize == 0)
sfsp = NULL;
@@ -464,8 +465,8 @@
mtx_unlock(&mountlist_mtx);
if (maxcount > count)
maxcount = count;
- sfsp = *buf = malloc(maxcount * sizeof(struct statfs), M_TEMP,
- M_WAITOK);
+ tofree = sfsp = *buf =
+ malloc(maxcount * sizeof(struct statfs), M_TEMP, M_WAITOK);
}
count = 0;
mtx_lock(&mountlist_mtx);
@@ -480,9 +481,17 @@
continue;
}
#endif
- if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) {
- nmp = TAILQ_NEXT(mp, mnt_list);
- continue;
+ if (flags == MNT_WAIT) {
+ if (vfs_busy(mp, MBF_MNTLSTLOCK)) {
+ mtx_unlock(&mountlist_mtx);
+ free(tofree, M_TEMP);
+ goto restart;
+ }
+ } else {
+ if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) {
+ nmp = TAILQ_NEXT(mp, mnt_list);
+ continue;
+ }
}
if (sfsp && count < maxcount) {
sp = &mp->mnt_stat;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 16, 1:12 PM (20 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41779198
Default Alt Text
D8030.1794834722.diff (1 KB)
Attached To
Mode
D8030: Make getfsstat(2) not skip filesystems being unmounted if passed MNT_WAIT flag.
Attached
Detach File
Event Timeline