lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 19 Dec 2008 23:29:16 +0800
From:	"Peter Teoh" <htmldeveloper@...il.com>
To:	"Rohit Sharma" <imreckless@...il.com>
Cc:	"Jan Kara" <jack@...e.cz>,
	Kernelnewbies <kernelnewbies@...linux.org>,
	ext4 <linux-ext4@...r.kernel.org>
Subject: Re: block allocation for ext2_mkdir

On Fri, Dec 19, 2008 at 7:18 PM, Rohit Sharma <imreckless@...il.com> wrote:
> On Fri, Dec 19, 2008 at 3:05 PM, Peter Teoh <htmldeveloper@...il.com> wrote:
>> On Fri, Dec 19, 2008 at 3:42 PM, Rohit Sharma <imreckless@...il.com> wrote:
>>> On Fri, Dec 19, 2008 at 4:09 AM, Jan Kara <jack@...e.cz> wrote:
>>>>> On Fri, Dec 19, 2008 at 12:12 AM, Rohit Sharma <imreckless@...il.com> wrote:
>>>>> > How does ext2 allocate blocks for directory.
>>>>> >
>>>>> > ext2_mkdir               calls            ext2_make_empty
>>>>> >
>>>>> > ext2_make_empty     calls           __ext2_write_begin
>>>>> >
>>>>> > __ ext2_write_begin   calls           block_write_begin
>>>>> >
>>>>> > my query is that how does this function allocates blocks for directories. ??
>>>>> >
>>>>>
>>>>> Does ext2 uses ext2_get_block to allocate blocks for both files and
>>>>> directories. ??
>>>>  Yes, exactly. Ext2 (unlike ext3 or ext4) treats directories the same
>>>> ways as ordinary files and thus ext2_get_block is used for block
>>>> allocation.
>>>>
>>>
>>> Can i modify this function to restrict allocation of blocks
>>> to a particular block group ?
>>>
>>> Like i want that my abc.txt file should be in block group 5 suppose, then
>>> what should i do?
>>>
>>
>> I think this can be done.   Or is done in the kernel source in several
>> ways (indirectly).
>>
>> 1.   ext2_find_goal()-->this will look for the best new block.   when
>> searching, it will try to find the block to be allocated to follow the
>> one last allocated in the file, so as to maintain storage contiguity.
>>
>> 2.   looking into fs/ext2/balloc.c: ext2_try_to_allocate(), there is a
>> argument called group_goal, whose purpose is to specify the goal block
>> group, and the algorithm will start searching from the group specified
>> (look for "start=grp_goal").   Of course, if search is in vain it will
>> proceed to other block group, which u don't want ....so may be can
>> customize from here.
>>
>> Not sure if I am right?
>>
> When we create new file, do we use reservation window to allocate blocks
> or we use reservation window every time we need a new data blocks
> for file.
>
>

http://lwn.net/Articles/81357/ ===> from here, we deduced that it
should be done at every new block request level, and not at the file
level.   This is because when file level request is initiated, the
first thing is see if any existing block can be reused or not, before
allocating new block (which then comes with reservation features - to
ensure contiguity of datablocks).


-- 
Regards,
Peter Teoh

Ernest Hemingway - "Never mistake motion for action."
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ