From: Tristan Ye <tristan.ye@oracle.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH 2/8] Ocfs2: Add basic framework and source files for extent moving.
Date: Wed, 29 Dec 2010 14:30:59 +0800 [thread overview]
Message-ID: <4D1AD5A3.9060605@oracle.com> (raw)
In-Reply-To: <20101229054550.GA12275@laptop.jp.oracle.com>
Wengang Wang wrote:
> Hi,
>
> On 10-12-28 23:38, Tristan Ye wrote:
>> On 12/28/2010 11:11 PM, Tao Ma wrote:
>>
>>>> +
>>>> + up_write(&OCFS2_I(inode)->ip_alloc_sem);
>>>> + if (status) {
>>>> + mlog_errno(status);
>>>> + goto out_inode_unlock;
>>>> + }
>>>> +
>>>> + /*
>>>> + * We update mtime for these changes
>>>> + */
>>>> + handle = ocfs2_start_trans(osb, OCFS2_INODE_UPDATE_CREDITS);
>>>> + if (IS_ERR(handle)) {
>>>> + status = PTR_ERR(handle);
>>>> + mlog_errno(status);
>>>> + goto out_inode_unlock;
>>>> + }
>>>> +
>>>> + inode->i_mtime = CURRENT_TIME;
>>>> + status = ocfs2_mark_inode_dirty(handle, inode, di_bh);
>>> We really need such a heavy function in case you just want to set
>>> di->i_mtime and di->i_mtime_nsec?
>>
>> These above codes were almost borrowed from __ocfs2_change_file_space(),
>> it just called
>> ocfs2_mark_inode_dirty() when updating the mtime/ctime.
>>
>> Maybe you're right, I'll rethink about it.
>>
>
> Do we really need to update modify time or change time?
> modify time is "Time of last file write". no need I think since it's not a
> write(no touch on file contents).
> change time is "Time of last inode change". I think here, the inode
> status includes mode, gid, uid, size, ino..... no change in those area,
> right? so I guess no need to update mtime nor ctime.
>
> Also, even we need to update them, shall we check a status of the
> __ocfs2_move_extents_range() whether there is really a movement. think
> the case another node just finished defragmenting on this file.
Actually I borrowed these codes from ocfs2_change_file_space()
at the very beginning, your comments did make sense, but wait,
dedragmentation
has the possibility of changing dinode a bit, it's the btree root, right?
mtime may not be updated as you said;)
>
> And likely we have modified di_bh in __ocfs2_move_extents_range() and
> journaled it(though not checked yet). So if need, we'd better merge the
> transactins
Good point.
>
> BTW, just a thought, not checked all, do we only allow root to do this?
> Seems no security risk for the task to FS its self... attacks?
I did allow ordinary users to do this in this patch, didn't I?
>
> thanks,
> wengang.
next prev parent reply other threads:[~2010-12-29 6:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-28 11:40 [Ocfs2-devel] [PATCH 0/8] Ocfs2: Online defragmentaion V1 Tristan Ye
2010-12-28 11:40 ` [Ocfs2-devel] [PATCH 1/8] Ocfs2: Adding new ioctl code 'OCFS2_IOC_MOVE_EXT' to ocfs2 Tristan Ye
2010-12-28 11:40 ` [Ocfs2-devel] [PATCH 2/8] Ocfs2: Add basic framework and source files for extent moving Tristan Ye
2010-12-28 15:11 ` Tao Ma
2010-12-28 15:38 ` Tristan Ye
2010-12-29 5:45 ` Wengang Wang
2010-12-29 6:30 ` Tristan Ye [this message]
2010-12-28 11:40 ` [Ocfs2-devel] [PATCH 3/8] Ocfs2: Duplicate old clusters into new blk_offset by dirty and remap pages Tristan Ye
2010-12-28 11:40 ` [Ocfs2-devel] [PATCH 4/8] Ocfs2: move a range of extent Tristan Ye
2010-12-28 11:40 ` [Ocfs2-devel] [PATCH 5/8] Ocfs2: lock allocators and reserve metadata blocks and data clusters for extents moving Tristan Ye
2010-12-28 11:40 ` [Ocfs2-devel] [PATCH 6/8] Ocfs2: defrag a range of extent Tristan Ye
2010-12-28 11:40 ` [Ocfs2-devel] [PATCH 7/8] Ocfs2: move entire/partial extent Tristan Ye
2010-12-28 11:40 ` [Ocfs2-devel] [PATCH 8/8] Ocfs2: move extents within a certain range Tristan Ye
2010-12-28 12:05 ` [Ocfs2-devel] [PATCH 0/8] Ocfs2: Online defragmentaion V1 Wengang Wang
2010-12-28 15:44 ` Tristan Ye
-- strict thread matches above, loose matches on Subject: below --
2011-01-13 10:20 [Ocfs2-devel] [PATCH 0/8] Ocfs2: Online defragmentaion V2 Tristan Ye
2011-01-13 10:20 ` [Ocfs2-devel] [PATCH 2/8] Ocfs2: Add basic framework and source files for extent moving Tristan Ye
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4D1AD5A3.9060605@oracle.com \
--to=tristan.ye@oracle.com \
--cc=ocfs2-devel@oss.oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).