From 9d80f7539a91c0154e40fc9e4ae5e818dd8f102e Mon Sep 17 00:00:00 2001 From: Joel Becker Date: Tue, 22 Apr 2008 11:46:44 -0700 Subject: ocfs2: Correct merge of 52f7c21 (Move /sys/o2cb to /sys/fs/o2cb) Commit 52f7c21b613f80cb425d115c9e5b4ed958a133c0 was intended to move /sys/o2cb to /sys/fs/o2cb, providing /sys/o2cb as a symlink for backwards compatibility. However, the merge apparently added the symlink but failed to move the directory, resulting in a duplicate filename error. It's a one-line change that was missing. Signed-off-by: Joel Becker Acked-by: Randy Dunlap Signed-off-by: Mark Fasheh --- fs/ocfs2/cluster/sys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs') diff --git a/fs/ocfs2/cluster/sys.c b/fs/ocfs2/cluster/sys.c index 98429fd6849..bc702dab5d1 100644 --- a/fs/ocfs2/cluster/sys.c +++ b/fs/ocfs2/cluster/sys.c @@ -65,7 +65,7 @@ int o2cb_sys_init(void) { int ret; - o2cb_kset = kset_create_and_add("o2cb", NULL, NULL); + o2cb_kset = kset_create_and_add("o2cb", NULL, fs_kobj); if (!o2cb_kset) return -ENOMEM; -- cgit v1.2.3 From 4d8755b5e667df8f01647773ba744a5ac97e68e6 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 21 Apr 2008 11:49:26 +0300 Subject: ocfs2: make struct ocfs2_control_device static This patch makes the needlessly global struct ocfs2_control_device static. Signed-off-by: Adrian Bunk Acked-by: Joel Becker Signed-off-by: Mark Fasheh --- fs/ocfs2/stack_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs') diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c index 7428663f9cb..b503772cd0e 100644 --- a/fs/ocfs2/stack_user.c +++ b/fs/ocfs2/stack_user.c @@ -635,7 +635,7 @@ static const struct file_operations ocfs2_control_fops = { .owner = THIS_MODULE, }; -struct miscdevice ocfs2_control_device = { +static struct miscdevice ocfs2_control_device = { .minor = MISC_DYNAMIC_MINOR, .name = "ocfs2_control", .fops = &ocfs2_control_fops, -- cgit v1.2.3 From 4af694e672aaa85940d6e29d27b7eeea5f6eb258 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 21 Apr 2008 11:49:31 +0300 Subject: ocfs2: make struct o2cb_stack_ops static This patch makes the needlessly global struct o2cb_stack_ops static. Signed-off-by: Adrian Bunk Acked-by: Joel Becker Signed-off-by: Mark Fasheh --- fs/ocfs2/stack_o2cb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs') diff --git a/fs/ocfs2/stack_o2cb.c b/fs/ocfs2/stack_o2cb.c index ac1d74c63bf..bbd1667aa7d 100644 --- a/fs/ocfs2/stack_o2cb.c +++ b/fs/ocfs2/stack_o2cb.c @@ -385,7 +385,7 @@ static int o2cb_cluster_this_node(unsigned int *node) return 0; } -struct ocfs2_stack_operations o2cb_stack_ops = { +static struct ocfs2_stack_operations o2cb_stack_ops = { .connect = o2cb_cluster_connect, .disconnect = o2cb_cluster_disconnect, .hangup = o2cb_cluster_hangup, -- cgit v1.2.3 From 95642e56647d84963428a1168baa8a73cb782ac3 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 21 Apr 2008 11:49:37 +0300 Subject: ocfs2/dlm: dlmdebug.c: make 2 functions static This patch makes the following needlessly global functions static: - stringify_lockname() - dlm_debug_put() Signed-off-by: Adrian Bunk Acked-by: Sunil Mushran Signed-off-by: Mark Fasheh --- fs/ocfs2/dlm/dlmdebug.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'fs') diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c index 5f6d858770a..1b81dcba175 100644 --- a/fs/ocfs2/dlm/dlmdebug.c +++ b/fs/ocfs2/dlm/dlmdebug.c @@ -44,7 +44,8 @@ #define MLOG_MASK_PREFIX ML_DLM #include "cluster/masklog.h" -int stringify_lockname(const char *lockname, int locklen, char *buf, int len); +static int stringify_lockname(const char *lockname, int locklen, char *buf, + int len); void dlm_print_one_lock_resource(struct dlm_lock_resource *res) { @@ -251,7 +252,8 @@ EXPORT_SYMBOL_GPL(dlm_errname); * * For more on lockname formats, please refer to dlmglue.c and ocfs2_lockid.h. */ -int stringify_lockname(const char *lockname, int locklen, char *buf, int len) +static int stringify_lockname(const char *lockname, int locklen, char *buf, + int len) { int out = 0; __be64 inode_blkno_be; @@ -368,7 +370,7 @@ static void dlm_debug_free(struct kref *kref) kfree(dc); } -void dlm_debug_put(struct dlm_debug_ctxt *dc) +static void dlm_debug_put(struct dlm_debug_ctxt *dc) { if (dc) kref_put(&dc->debug_refcnt, dlm_debug_free); -- cgit v1.2.3 From bc535809c06ada210d89f5a43b335c68ecbb8e1b Mon Sep 17 00:00:00 2001 From: Sunil Mushran Date: Fri, 18 Apr 2008 10:23:53 -0700 Subject: ocfs2: Allow uid/gid/perm changes of symlinks This patch adds the ability to change attributes of a symlink. Fixes oss bugzilla#963 http://oss.oracle.com/bugzilla/show_bug.cgi?id=963 Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh --- fs/ocfs2/file.c | 4 ++++ fs/ocfs2/symlink.c | 2 ++ 2 files changed, 6 insertions(+) (limited to 'fs') diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 9154c82d325..57e0d30cde9 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -1048,6 +1048,10 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) mlog_entry("(0x%p, '%.*s')\n", dentry, dentry->d_name.len, dentry->d_name.name); + /* ensuring we don't even attempt to truncate a symlink */ + if (S_ISLNK(inode->i_mode)) + attr->ia_valid &= ~ATTR_SIZE; + if (attr->ia_valid & ATTR_MODE) mlog(0, "mode change: %d\n", attr->ia_mode); if (attr->ia_valid & ATTR_UID) diff --git a/fs/ocfs2/symlink.c b/fs/ocfs2/symlink.c index 7134007ba22..ba9dbb51d25 100644 --- a/fs/ocfs2/symlink.c +++ b/fs/ocfs2/symlink.c @@ -167,9 +167,11 @@ const struct inode_operations ocfs2_symlink_inode_operations = { .readlink = page_readlink, .follow_link = ocfs2_follow_link, .getattr = ocfs2_getattr, + .setattr = ocfs2_setattr, }; const struct inode_operations ocfs2_fast_symlink_inode_operations = { .readlink = ocfs2_readlink, .follow_link = ocfs2_follow_link, .getattr = ocfs2_getattr, + .setattr = ocfs2_setattr, }; -- cgit v1.2.3 From 4ba1c5bfd2e5a6c9528eb7777b66c297e70f61ca Mon Sep 17 00:00:00 2001 From: Sunil Mushran Date: Fri, 18 Apr 2008 15:03:59 -0700 Subject: ocfs2: Use GFP_NOFS in kmalloc during localalloc window move kmalloc() during a localalloc window move can trigger the mm to prune the dcache which inturn can trigger the fs to delete an inode causing it start a recursive transaction. The fix also makes the change in kmalloc during localalloc shutdown just to be safe. Fixes oss bugzilla#901 http://oss.oracle.com/bugzilla/show_bug.cgi?id=901 Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh --- fs/ocfs2/localalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'fs') diff --git a/fs/ocfs2/localalloc.c b/fs/ocfs2/localalloc.c index ce0dc147602..be774bdc8b3 100644 --- a/fs/ocfs2/localalloc.c +++ b/fs/ocfs2/localalloc.c @@ -260,7 +260,7 @@ void ocfs2_shutdown_local_alloc(struct ocfs2_super *osb) bh = osb->local_alloc_bh; alloc = (struct ocfs2_dinode *) bh->b_data; - alloc_copy = kmalloc(bh->b_size, GFP_KERNEL); + alloc_copy = kmalloc(bh->b_size, GFP_NOFS); if (!alloc_copy) { status = -ENOMEM; goto out_commit; @@ -931,7 +931,7 @@ static int ocfs2_local_alloc_slide_window(struct ocfs2_super *osb, * local alloc shutdown won't try to double free main bitmap * bits. Make a copy so the sync function knows which bits to * free. */ - alloc_copy = kmalloc(osb->local_alloc_bh->b_size, GFP_KERNEL); + alloc_copy = kmalloc(osb->local_alloc_bh->b_size, GFP_NOFS); if (!alloc_copy) { status = -ENOMEM; mlog_errno(status); -- cgit v1.2.3