Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107191780
D46465.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
D46465.diff
View Options
diff --git a/sys/kern/kern_rangelock.c b/sys/kern/kern_rangelock.c
--- a/sys/kern/kern_rangelock.c
+++ b/sys/kern/kern_rangelock.c
@@ -82,6 +82,24 @@
#define RL_RET_CHEAT_RLOCKED 0x1100
#define RL_RET_CHEAT_WLOCKED 0x2200
+static void
+rangelock_cheat_drain(struct rangelock *lock)
+{
+ uintptr_t v;
+
+ DROP_GIANT();
+ for (;;) {
+ v = (uintptr_t)atomic_load_ptr(&lock->head);
+ if ((v & RL_CHEAT_DRAINING) == 0)
+ break;
+ sleepq_add(&lock->head, NULL, "ranged1", 0, 0);
+ sleepq_wait(&lock->head, PRI_USER);
+ sleepq_lock(&lock->head);
+ }
+ sleepq_release(&lock->head);
+ PICKUP_GIANT();
+}
+
static bool
rangelock_cheat_lock(struct rangelock *lock, int locktype, bool trylock,
void **cookie)
@@ -99,17 +117,7 @@
}
sleepq_lock(&lock->head);
drain1:
- DROP_GIANT();
- for (;;) {
- v = (uintptr_t)atomic_load_ptr(&lock->head);
- if ((v & RL_CHEAT_DRAINING) == 0)
- break;
- sleepq_add(&lock->head, NULL, "ranged1", 0, 0);
- sleepq_wait(&lock->head, PRI_USER);
- sleepq_lock(&lock->head);
- }
- sleepq_release(&lock->head);
- PICKUP_GIANT();
+ rangelock_cheat_drain(lock);
return (false);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 12, 10:44 AM (21 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15768609
Default Alt Text
D46465.diff (1 KB)
Attached To
Mode
D46465: kern_copy_file_range(): handle rangelock recursion
Attached
Detach File
Event Timeline
Log In to Comment