* Block device files and the page cache
@ 2010-03-16 17:08 Alan Stern
2010-03-17 10:22 ` Jens Axboe
0 siblings, 1 reply; 3+ messages in thread
From: Alan Stern @ 2010-03-16 17:08 UTC (permalink / raw)
To: Jens Axboe, Alexander Viro; +Cc: linux-fsdevel, Kernel development list
Jens and Al:
Simple testing seems to show that when a program closes a file
descriptor for a block device file, the release method in the device
driver's block_device_operations structure doesn't get called (and the
close(2) system call doesn't return) until all the dirty pages for that
device have been written out.
Can anyone confirm that this always happens? Where in the kernel
source is this handled?
Thanks,
Alan Stern
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Block device files and the page cache
2010-03-16 17:08 Block device files and the page cache Alan Stern
@ 2010-03-17 10:22 ` Jens Axboe
2010-03-17 15:30 ` Alan Stern
0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2010-03-17 10:22 UTC (permalink / raw)
To: Alan Stern; +Cc: Alexander Viro, linux-fsdevel, Kernel development list
On Tue, Mar 16 2010, Alan Stern wrote:
> Jens and Al:
>
> Simple testing seems to show that when a program closes a file
> descriptor for a block device file, the release method in the device
> driver's block_device_operations structure doesn't get called (and the
> close(2) system call doesn't return) until all the dirty pages for that
> device have been written out.
>
> Can anyone confirm that this always happens? Where in the kernel
> source is this handled?
Alan, see fs/block_dev.c:__blkdev_put(). The last put of the device will
sync the device before calling fops->release().
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Block device files and the page cache
2010-03-17 10:22 ` Jens Axboe
@ 2010-03-17 15:30 ` Alan Stern
0 siblings, 0 replies; 3+ messages in thread
From: Alan Stern @ 2010-03-17 15:30 UTC (permalink / raw)
To: Jens Axboe; +Cc: Alexander Viro, linux-fsdevel, Kernel development list
On Wed, 17 Mar 2010, Jens Axboe wrote:
> On Tue, Mar 16 2010, Alan Stern wrote:
> > Jens and Al:
> >
> > Simple testing seems to show that when a program closes a file
> > descriptor for a block device file, the release method in the device
> > driver's block_device_operations structure doesn't get called (and the
> > close(2) system call doesn't return) until all the dirty pages for that
> > device have been written out.
> >
> > Can anyone confirm that this always happens? Where in the kernel
> > source is this handled?
>
> Alan, see fs/block_dev.c:__blkdev_put(). The last put of the device will
> sync the device before calling fops->release().
Ah, that's where it is! Thanks very much.
Alan Stern
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-17 15:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-16 17:08 Block device files and the page cache Alan Stern
2010-03-17 10:22 ` Jens Axboe
2010-03-17 15:30 ` Alan Stern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).