Re: truncate implementation

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

 



On Tue, 2006-01-17 at 12:21 +0300, Jan Koss wrote:
> Thanks for reply.
> 
> > .. which isn't in the pagetable, and then the kernel notices it's
> > outside the file and causes a SIGBUS.
> But if length of file after truncate is 4 byte, for example,
> and I do p[5]=.., this didn't cause any error, so I can append some garbage
> after end of file, and this is not error?

this is an artifact of mmap... those writes are not valid code
obviously, and the kernel just throws them away. Which afaik is allowed
by all standards.

> 
> >
> > .. and removes the page from the pagetable.
> >
> I'm sorry for stupid question, but where we remove from pagetable,
> I see two places in ext2_truncate:
> 

there is truncate_inode_pages.

remember this sort of stuff is done on the vfs level not on the
filesystem level in linux. the filesystem gets told in the end to adjust
it's own metadata, not to do stuff that belongs in higher layers



--
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