Re: mark_buffer_dirty

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Does anyone know if in general mark_buffer_dirty is called before the data is copied to the actual buffer or after? It feels like both of those are possible:

From whatever fs code I have seen, the buffer is marked dirty after data is copied.


1) If we copied first and dirtied after then the data could be discarded when the block has to be thrown out without being written to its backing device.

But presumably we will have locked the buffer, so it should not be discarded.


2) On the other hand, if we set it dirty first and copy later then there is a chance that things are flushed to the device before the dirty bit is even set that the actual new data is discarded later on.


Again, if we have a lock on the bh, it should not be flushed.

--Swapnil

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux