Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171781945
D8030.id21809.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D8030.id21809.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, Sep 14, 12:06 PM (15 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38906103
Default Alt Text
D8030.id21809.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
Log In to Comment