Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144403331
D20710.id58838.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
932 B
Referenced Files
None
Subscribers
None
D20710.id58838.diff
View Options
Index: sys/kern/kern_descrip.c
===================================================================
--- sys/kern/kern_descrip.c
+++ sys/kern/kern_descrip.c
@@ -780,7 +780,9 @@
}
if (arg >= 0) {
bsize = fp->f_vnode->v_mount->mnt_stat.f_iosize;
- fp->f_seqcount = (arg + bsize - 1) / bsize;
+ arg = MIN(arg, INT_MAX - bsize + 1);
+ fp->f_seqcount = MIN(IO_SEQMAX,
+ (arg + bsize - 1) / bsize);
atomic_set_int(&fp->f_flag, FRDAHEAD);
} else {
atomic_clear_int(&fp->f_flag, FRDAHEAD);
Index: sys/sys/file.h
===================================================================
--- sys/sys/file.h
+++ sys/sys/file.h
@@ -179,7 +179,7 @@
/*
* DTYPE_VNODE specific fields.
*/
- int f_seqcount; /* (a) Count of sequential accesses. */
+ short f_seqcount; /* (a) Count of sequential accesses. */
off_t f_nextoff; /* next expected read/write offset. */
union {
struct cdev_privdata *fvn_cdevpriv;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 9, 6:29 AM (11 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28548176
Default Alt Text
D20710.id58838.diff (932 B)
Attached To
Mode
D20710: fcntl: fix overflow when setting F_READAHEAD
Attached
Detach File
Event Timeline
Log In to Comment