| Summary: | Bug with kevent & umount -f | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | mitja.horvat <mitja.horvat> | ||||
| Component: | kern | Assignee: | dwmalone | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.2-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
mitja.horvat
2001-02-23 15:00:02 UTC
On Fri, Feb 23, 2001 at 03:59:59PM +0100, mitja.horvat@hermes.si wrote: > --- vfs_vnops.c.orig Mon Feb 12 14:17:19 2001 > +++ vfs_vnops.c Fri Feb 23 15:55:18 2001 > @@ -722,6 +722,15 @@ > struct vnode *vp = (struct vnode *)kn->kn_fp->f_data; > struct inode *ip = VTOI(vp); > > + /* > + * If the underlying inode was freed(this can happen > + * if the filesystem is forcibly unmounted with > + * umount -f), return as there was activity on the file, > + * so the process will be woken up and later it will > + * receive an error during read XXX > + */ > + if (ip == NULL) return 1; > + > kn->kn_data = ip->i_size - kn->kn_fp->f_offset; > return (kn->kn_data != 0); > } Amazingly, I suggested an almost identical patch earlier in the week for another problem due to revoking file discriptors. I'll try to get Peter or Jonathan to review the patch and I'll commit it. David. Responsible Changed From-To: freebsd-bugs->dwmalone I'll try to get someone to review this. On Friday 23 February 2001 16:38, you wrote: > On Fri, Feb 23, 2001 at 03:59:59PM +0100, mitja.horvat@hermes.si wrote: > > --- vfs_vnops.c.orig Mon Feb 12 14:17:19 2001 > > +++ vfs_vnops.c Fri Feb 23 15:55:18 2001 > > @@ -722,6 +722,15 @@ > > struct vnode *vp = (struct vnode *)kn->kn_fp->f_data; > > struct inode *ip = VTOI(vp); > > > > + /* > > + * If the underlying inode was freed(this can happen > > + * if the filesystem is forcibly unmounted with > > + * umount -f), return as there was activity on the file, > > + * so the process will be woken up and later it will > > + * receive an error during read XXX > > + */ > > + if (ip == NULL) return 1; > > + > > kn->kn_data = ip->i_size - kn->kn_fp->f_offset; > > return (kn->kn_data != 0); > > } > > Amazingly, I suggested an almost identical patch earlier in the > week for another problem due to revoking file discriptors. I'll > try to get Peter or Jonathan to review the patch and I'll commit > it. > > David. Great, I'm glad that I have contributed to the comunity. Hopefully this will get committed before 4.3-RELEASE. Regards, Mitja State Changed From-To: open->closed I believe the fix for this has now been merged into -stable. |