* Does unmount() sync dirty buffers
@ 2012-02-14 14:13 Ravishankar
2012-02-15 8:27 ` Mulyadi Santosa
[not found] ` <CAE0An6daGXZXpKEThNnj_=Lo9WWVdrmcM-urGqSa5zu=4w=aAQ@mail.gmail.com>
0 siblings, 2 replies; 4+ messages in thread
From: Ravishankar @ 2012-02-14 14:13 UTC (permalink / raw)
To: kernelnewbies
Hello,
When we unmount a file system with the umount command or the umount()
system call, does the kernel sync the dirty buffers before the file system
is unmounted?I am assuming that the file system is not 'busy' (i.e no open
files etc) and no force options are specified. When I did a walk-through of
do_umount() call in fs/namespace.c, I could not find calls to sync any
dirty pages that might exist.
Thanks!
Ravi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120214/3c605067/attachment.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Does unmount() sync dirty buffers
2012-02-14 14:13 Does unmount() sync dirty buffers Ravishankar
@ 2012-02-15 8:27 ` Mulyadi Santosa
[not found] ` <CAE0An6daGXZXpKEThNnj_=Lo9WWVdrmcM-urGqSa5zu=4w=aAQ@mail.gmail.com>
1 sibling, 0 replies; 4+ messages in thread
From: Mulyadi Santosa @ 2012-02-15 8:27 UTC (permalink / raw)
To: kernelnewbies
Hi :)
On Tue, Feb 14, 2012 at 21:13, Ravishankar <cyberax82@gmail.com> wrote:
> Hello,
>
> When we unmount a file system with the umount command or the umount() system
> call, does the kernel sync the dirty buffers before the file system is
> unmounted?
Yep, it flushes them. But i forget the exact code path, since last
time I checked it, it was in 2.4.x
--
regards,
Mulyadi Santosa
Freelance Linux trainer and consultant
blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* Does unmount() sync dirty buffers
[not found] ` <CAE0An6daGXZXpKEThNnj_=Lo9WWVdrmcM-urGqSa5zu=4w=aAQ@mail.gmail.com>
@ 2012-02-15 8:38 ` Manish Katiyar
2012-02-15 11:38 ` Ravishankar
0 siblings, 1 reply; 4+ messages in thread
From: Manish Katiyar @ 2012-02-15 8:38 UTC (permalink / raw)
To: kernelnewbies
[Apparently I forgot to cc list]
On Tue, Feb 14, 2012 at 10:04 PM, Manish Katiyar <mkatiyar@gmail.com> wrote:
> On Tue, Feb 14, 2012 at 7:43 PM, Ravishankar <cyberax82@gmail.com> wrote:
>> Hello,
>>
>> When we unmount a file system with the umount command or the umount() system
>> call, does the kernel sync the dirty buffers before the file system is
>> unmounted?I am assuming that the file system is not 'busy' (i.e no open
>> files etc) and no force options are specified. When I did a walk-through of
>> do_umount() call in fs/namespace.c, I could not find calls to sync any dirty
>> pages that might exist.
>
> yes, most of the filesystem have their own function to sync fs. Look
> for the function pointer "sync_fs"
>
> For eg..for ext4
>
> generic_shutdown_super -> sync_filesystem -> __sync_filesystem ->
> sync_fs -> ext4_sync_fs
> --
> Thanks -
> Manish
--
Thanks -
Manish
^ permalink raw reply [flat|nested] 4+ messages in thread
* Does unmount() sync dirty buffers
2012-02-15 8:38 ` Manish Katiyar
@ 2012-02-15 11:38 ` Ravishankar
0 siblings, 0 replies; 4+ messages in thread
From: Ravishankar @ 2012-02-15 11:38 UTC (permalink / raw)
To: kernelnewbies
On Wed, Feb 15, 2012 at 2:08 PM, Manish Katiyar <mkatiyar@gmail.com> wrote:
> [Apparently I forgot to cc list]
>
> On Tue, Feb 14, 2012 at 10:04 PM, Manish Katiyar <mkatiyar@gmail.com>
> wrote:
> > On Tue, Feb 14, 2012 at 7:43 PM, Ravishankar <cyberax82@gmail.com>
> wrote:
> >> Hello,
> >>
> >> When we unmount a file system with the umount command or the umount()
> system
> >> call, does the kernel sync the dirty buffers before the file system is
> >> unmounted?I am assuming that the file system is not 'busy' (i.e no open
> >> files etc) and no force options are specified. When I did a
> walk-through of
> >> do_umount() call in fs/namespace.c, I could not find calls to sync any
> dirty
> >> pages that might exist.
> >
> > yes, most of the filesystem have their own function to sync fs. Look
> > for the function pointer "sync_fs"
> >
> > For eg..for ext4
> >
> > generic_shutdown_super -> sync_filesystem -> __sync_filesystem ->
> > sync_fs -> ext4_sync_fs
> > --
> > Thanks -
> > Manish
>
>
>
> --
> Thanks -
> Manish
>
Thanks a lot.Just to add, generic_shutdown_super() is called thus:
umount systemcall
-->mntput_no_expire()-->__mntput()-->deactivate_super()-->deactivate_locked_super()-->kill_block_super()-->generic_shutdown_super()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120215/255d3844/attachment.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-02-15 11:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-14 14:13 Does unmount() sync dirty buffers Ravishankar
2012-02-15 8:27 ` Mulyadi Santosa
[not found] ` <CAE0An6daGXZXpKEThNnj_=Lo9WWVdrmcM-urGqSa5zu=4w=aAQ@mail.gmail.com>
2012-02-15 8:38 ` Manish Katiyar
2012-02-15 11:38 ` Ravishankar
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).