Sunil Mushran
2009-May-04 23:10 UTC
[Ocfs2-devel] [PATCH 1/3] ocfs2: Add missing iput() during error handling in ocfs2_dentry_attach_lock()
Mainline commit a5a0a630922a2f6a774b6dac19f70cb5abd86bb0 In ocfs2_dentry_attach_lock(), if unable to get the dentry lock, we need to call iput(inode) because a failure here means no d_instantiate(), which means the normally matching iput() will not be called during dput(dentry). This patch fixes the oops that accompanies the following message: (3996,1):dlm_empty_lockres:2708 ERROR: lockres W00000000000000000a1046b06a4382 still has local locks! kernel BUG in dlm_empty_lockres at /rpmbuild/smushran/BUILD/ocfs2-1.4.2/fs/ocfs2/dlm/dlmmaster.c:2709! Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> Signed-off-by: Joel Becker <joel.becker at oracle.com> --- fs/ocfs2/dcache.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c index fab4911..6bf070a 100644 --- a/fs/ocfs2/dcache.c +++ b/fs/ocfs2/dcache.c @@ -289,6 +289,21 @@ out_attach: else mlog_errno(ret); + /* + * In case of error, manually free the allocation and do the iput(). + * We need to do this because error here means no d_instantiate(), + * which means iput() will not be called during dput(dentry). + */ + if (ret < 0 && !alias) { + ocfs2_lock_res_free(&dl->dl_lockres); + BUG_ON(dl->dl_count != 1); + spin_lock(&dentry_attach_lock); + dentry->d_fsdata = NULL; + spin_unlock(&dentry_attach_lock); + kfree(dl); + iput(inode); + } + dput(alias); return ret; -- 1.5.6.3
Sunil Mushran
2009-May-04 23:10 UTC
[Ocfs2-devel] [PATCH 2/3] ocfs2: Hold mmap_sem while calling get_user_pages()
From: Kurt Garloff <garloff at novell.com> This patch adds locking around get_user_pages() in ocfs2_get_write_source() so as to prevent the vmas from changing underneath. Fixes Novell bugzilla# 485827 Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- fs/ocfs2/file.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 0c8e03a..267389c 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1967,9 +1967,11 @@ static struct page * ocfs2_get_write_source(char **ret_src_buf, * of the meta data locks in order to preserve locking * order in case of page fault. */ + down_read(¤t->mm->mmap_sem); ret = get_user_pages(current, current->mm, (unsigned long)buf & PAGE_CACHE_MASK, 1, 0, 0, &src_page, NULL); + up_read(¤t->mm->mmap_sem); if (ret == 1) *ret_src_buf = kmap(src_page) + off; else -- 1.5.6.3
Up version to 1.4.2. Also increase the required tools version to 1.4.2 as it includes some fixes for inline data. Signed-off-by: Sunil Mushran <sunil.mushran at oracle.com> --- configure.in | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.in b/configure.in index b7efa1b..34d6e74 100644 --- a/configure.in +++ b/configure.in @@ -9,11 +9,11 @@ AC_SUBST(PACKAGE) # Adjust these for the software version. MAJOR_VERSION=1 MINOR_VERSION=4 -MICRO_VERSION=1 +MICRO_VERSION=2 EXTRA_VERSION # Required version of ocfs-tools -TOOLS_REQUIRED_VERSION=1.4.1 +TOOLS_REQUIRED_VERSION=1.4.2 DIST_VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION if test -z "$EXTRA_VERSION"; then -- 1.5.6.3
Reasonably Related Threads
- [PATCH 1/1] ocfs2: Add missing iput() during error handling in ocfs2_dentry_attach_lock()
- [GIT PULL] ocfs2 fixes
- Need help for write rpm spec
- [PATCH] ocfs2: flush dentry lock drop when sync ocfs2 volume.
- [PATCH] virtio-balloon: Delete an unnecessary check before the function call "iput"