Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153617291
D20710.id58848.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
D20710.id58848.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/kern/vfs_vnops.c
===================================================================
--- sys/kern/vfs_vnops.c
+++ sys/kern/vfs_vnops.c
@@ -499,7 +499,8 @@
* closely related to the best I/O size for real disks than
* to any block size used by software.
*/
- fp->f_seqcount += howmany(uio->uio_resid, 16384);
+ fp->f_seqcount += MIN(IO_SEQMAX,
+ howmany(uio->uio_resid, 16384));
if (fp->f_seqcount > IO_SEQMAX)
fp->f_seqcount = IO_SEQMAX;
return (fp->f_seqcount << IO_SEQSHIFT);
Index: sys/sys/file.h
===================================================================
--- sys/sys/file.h
+++ sys/sys/file.h
@@ -179,7 +179,10 @@
/*
* DTYPE_VNODE specific fields.
*/
- int f_seqcount; /* (a) Count of sequential accesses. */
+ union {
+ int8_t f_seqcount; /* (a) Count of sequential accesses. */
+ int f_pipegen;
+ };
off_t f_nextoff; /* next expected read/write offset. */
union {
struct cdev_privdata *fvn_cdevpriv;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 23, 9:11 AM (7 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32012383
Default Alt Text
D20710.id58848.diff (1 KB)
Attached To
Mode
D20710: fcntl: fix overflow when setting F_READAHEAD
Attached
Detach File
Event Timeline
Log In to Comment