This e-mail describes the OCFS2 patches which I intend to push upstream to Linus for 2.6.20. * Various ocfs2 cleanups, including a patchset by me intended to clean up some of the internal ocfs2 journal api. Mostly this revolves around removing the ocfs2_journal_handle wrapper around handle_t. The immediate benefits are better readability and a slightly smaller memory footprint for open journal transactions. * Configfs gets some small cleanups and some mutex annotations. * Atime updates - thanks to Tiger Yang <tiger.yang@oracle.com>, ocfs2 now writes to the inode atime field. This doesn't require any disk changes, and is completely backwards compatible with older ocfs2 versions. An inodes Atime is only updated if it hasn't changed within a certain quantum. The user can define their own value at mount time, with 0 indicating that atime should always be updated. This is very similar to the scheme implemented by gfs2. In the future, I'd like to see a "relative atime" mode, which functions in the manner described by Valerie Henson at: http://lkml.org/lkml/2006/8/25/380 * sys_splice - ocfs2 now has splice read and write support. Thanks again to Tiger for the bulk of this functionality. Mostly we make use of the generic_splice_read() and generic_file_splice_write_nolock() functions provided already in fs/splice.c. - There is one patch in the ocfs2 splice() series external to fs/ocfs2 - a simple export of should_remove_suid(). This is done for code reuse purposes. That particular patch can be seen at: http://ftp.kernel.org/pub/linux/kernel/people/mfasheh/ocfs2/ocfs2_git_patches/ocfs2-upstream-linus-20061201/0025-Export-should_remove_suid.txt I'll also attach it to this mail for review purposes. * Last in the list of notable patches is a somewhat involved fix by Kurt Hackel <kurt.hackel@oracle.com> within the ocfs2 dlm. We had temporarily disable automatic migration of certain lock types because it was causing us problems during stress testing. This patch fixes those problems and re-enables migration. Overall this should reduce memory usage of the ocfs2 dlm. The patches can be found in git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2.git upstream-linus Additionally, broken out patches are available at: http://ftp.kernel.org/pub/linux/kernel/people/mfasheh/ocfs2/ocfs2_git_patches/ocfs2-upstream-linus-20060924/ Thanks, --Mark -- Mark Fasheh Senior Software Developer, Oracle mark.fasheh@oracle.com [PATCH] Export should_remove_suid() This helps us avoid replicating the same logic within file system drivers. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com> --- mm/filemap.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) d23a147bb6e8d467e8df73b6589888717da3b9ce diff --git a/mm/filemap.c b/mm/filemap.c index 7b84dc8..13df01c 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1893,6 +1893,7 @@ int should_remove_suid(struct dentry *de return 0; } +EXPORT_SYMBOL(should_remove_suid); int __remove_suid(struct dentry *dentry, int kill) { -- 1.3.3
Hi Steve, On Mon, Dec 04, 2006 at 10:54:53AM +0000, Steven Whitehouse wrote:> > In the future, I'd like to see a "relative atime" mode, which functions > > in the manner described by Valerie Henson at: > > > > http://lkml.org/lkml/2006/8/25/380 > > > I'd like to second that. [adding Val Henson to the "to"] What (if > anything) remains to be done before the relative atime patch is ready to > go upstream? I'm happy to help out here if required,Last time I looked at them, things seemed to be in pretty good shape - it wasn't a very large patch series. The thing is (I'm going from memory here), gfs2 and ocfs2 are likely to just make use of the option parsing (and setting of the MNT_RELATIME flag), and ignore the changes to touch_atime() since we we handle our own atime updates. Overall I think it's a matter of pushing the patches to the kernel and to mount(8). For ocfs2/gfs2 we implement a small amount of the logic in our "lock and update atime" functions. --Mark -- Mark Fasheh Senior Software Developer, Oracle mark.fasheh@oracle.com
Mark Fasheh
2006-Dec-05 14:20 UTC
[Ocfs2-devel] Re: Relative atime (was Re: What's in ocfs2.git)
On Mon, Dec 04, 2006 at 04:36:20PM -0800, Valerie Henson wrote:> > Last time I looked at them, things seemed to be in pretty good shape - it > > wasn't a very large patch series. > > Yep, the relative atime patch is tiny and pretty much done - just > needs some soak time in -mm and a little more review (cc'd Viro and > fsdevel). Kernel patch against 2.6.18-rc4 appended, patch to mount > following. (Note that my web server suffered a RAID failure and my > patches page is unavailable till the restore finishes.)Well, here's what the ocfs2 patch would look like. If we care to push this forward, some time in -mm would be nice... --Mark From: Mark Fasheh <mark.fasheh@oracle.com> Date: Tue, 5 Dec 2006 14:13:41 -0800 Subject: [PATCH] ocfs2: relative atime support Update ocfs2_should_update_atime() to understand the MNT_RELATIME flag and to test against mtime / ctime accordingly. Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com> --- fs/ocfs2/file.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 8786b3c..16a9b5e 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -154,6 +154,15 @@ int ocfs2_should_update_atime(struct ino return 0; now = CURRENT_TIME; + + if (vfsmnt->mnt_flags & MNT_RELATIME) { + if ((timespec_compare(&inode->i_atime, &inode->i_mtime) < 0) || + (timespec_compare(&inode->i_atime, &inode->i_ctime) < 0)) + return 1; + + return 0; + } + if ((now.tv_sec - inode->i_atime.tv_sec <= osb->s_atime_quantum)) return 0; else -- 1.4.2.4
Andrew Morton
2006-Dec-05 20:58 UTC
[Ocfs2-devel] Re: Relative atime (was Re: What's in ocfs2.git)
> On Mon, 4 Dec 2006 16:36:20 -0800 Valerie Henson <val_henson@linux.intel.com> wrote: > Add "relatime" (relative atime) support. Relative atime only updates > the atime if the previous atime is older than the mtime or ctime. > Like noatime, but useful for applications like mutt that need to know > when a file has been read since it was last modified.That seems like a good idea. I found touch_atime() to be rather putrid, so I hacked it around a bit. The end result: void touch_atime(struct vfsmount *mnt, struct dentry *dentry) { struct inode *inode = dentry->d_inode; struct timespec now; if (IS_RDONLY(inode)) return; if (inode->i_flags & S_NOATIME) return; if (inode->i_sb->s_flags & MS_NOATIME) return; if ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode)) return; /* * We may have a NULL vfsmount when coming from NFSD */ if (mnt) { if (mnt->mnt_flags & MNT_NOATIME) return; if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode)) return; if (mnt->mnt_flags & MNT_RELATIME) { /* * With relative atime, only update atime if the * previous atime is earlier than either the ctime or * mtime. */ if (timespec_compare(&inode->i_mtime, &inode->i_atime) < 0 && timespec_compare(&inode->i_ctime, &inode->i_atime) < 0) return; } } now = current_fs_time(inode->i_sb); if (timespec_equal(&inode->i_atime, &now)) return; inode->i_atime = now; mark_inode_dirty_sync(inode); } Does it still look right? Note the reordering to avoid the current_fs_time() call if poss. That's the easy part. How are we going to get mount(8) patched?