commit 2f5bf1f2d061dea5146aa283685ce2b00cea2f3d Author: Sunil Mushran Date: Thu Mar 22 17:08:32 2007 -0700 ocfs2_dlm: Check for migrateable lockres in dlm_empty_lockres() In dlm_migrate_lockres(), we check upfront whether the lockres is a candidate for migration. This patch encapsulates that code in a separate function so that dlm_empty_lockres() can also use it during umount. This patch addresses the umount process spinning problem. Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit 78062cb2e54ffe0df811dce5e68b54da9b8c9025 Author: Sunil Mushran Date: Thu Mar 22 17:01:07 2007 -0700 ocfs2_dlm: Fix lockres ref counting bug During umount, the umount thread migrates the lockres' and the dlm_thread frees the empty lockres'. Due to a race, the reference counting on the lockres goes awry leading to extra puts. Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit b36c3f84988eebf38acaccc756e05f6b70e333ab Author: Sunil Mushran Date: Mon Mar 12 13:25:44 2007 -0700 ocfs2_dlm: Add missing locks in dlm_empty_lockres __dlm_lockres_unused() expects the caller to take the lockres spinlock. Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit 3fca0894a4b5e52c278421b04435b88e32b423ad Author: Sunil Mushran Date: Mon Mar 12 13:24:34 2007 -0700 ocfs2_dlm: Missing get/put lockres in dlm_run_purge_lockres In some circumstances, this was causing us to reference freed memory. Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit 03f981cf2ec95dd8bc43d2ecccaec4e83c8375e2 Author: Joel Becker Date: Thu Jan 4 14:54:41 2007 -0800 ocfs2: add some missing address space callbacks Under load, OCFS2 would crash in invalidate_inode_pages2_range() because invalidate_complete_page2() was unable to invalidate a page. It would appear that JBD is holding on to the page. ext3 has a specific ->releasepage() handler to cover this case. Steal ext3's ->releasepage(), ->invalidatepage(), and ->migratepage(), as they appear completely appropriate for OCFS2. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit e6c352dbc0f4dc7e3f82feafb9e6207c5814a189 Author: Joel Becker Date: Sat Feb 3 03:04:20 2007 -0800 ocfs2: Concurrent access of o2hb_region->hr_task was not locked This means that a build-up and a teardown could race which would result in a double-kthread_stop(). Protect the setting and clearing of hr_task with o2hb_live_lock, as it's not a common thing and not performance critical. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit c24f72cc7ca829bbad0532ddf315ace3ae1c359e Author: Joel Becker Date: Sat Feb 3 03:14:30 2007 -0800 ocfs2: Proper cleanup in case of error in ocfs2_register_hb_callbacks() If ocfs2_register_hb_callbacks() succeeds on its first callback but fails its second, it doesn't release the first on the way out. Fix that. While we're at it, o2hb_unregister_callback() never returns anything but 0, so let's make it void. Signed-off-by: Joel Becker Signed-off-by: Mark Fasheh commit 1b3c3714cb4767d00f507cc6854d3339d82c5b9d Author: Uwe Kleine-König Date: Sat Feb 17 19:23:03 2007 +0100 Fix typos concerning hierarchy heirarchical, hierachical -> hierarchical heirarchy, hierachy -> hierarchy Signed-off-by: Uwe Kleine-König Signed-off-by: Adrian Bunk commit 0b4d414714f0d2f922d39424b0c5c82ad900a381 Author: Eric W. Biederman Date: Wed Feb 14 00:34:09 2007 -0800 [PATCH] sysctl: remove insert_at_head from register_sysctl The semantic effect of insert_at_head is that it would allow new registered sysctl entries to override existing sysctl entries of the same name. Which is pain for caching and the proc interface never implemented. I have done an audit and discovered that none of the current users of register_sysctl care as (excpet for directories) they do not register duplicate sysctl entries. So this patch simply removes the support for overriding existing entries in the sys_sysctl interface since no one uses it or cares and it makes future enhancments harder. Signed-off-by: Eric W. Biederman Acked-by: Ralf Baechle Acked-by: Martin Schwidefsky Cc: Russell King Cc: David Howells Cc: "Luck, Tony" Cc: Ralf Baechle Cc: Paul Mackerras Cc: Martin Schwidefsky Cc: Andi Kleen Cc: Jens Axboe Cc: Corey Minyard Cc: Neil Brown Cc: "John W. Linville" Cc: James Bottomley Cc: Jan Kara Cc: Trond Myklebust Cc: Mark Fasheh Cc: David Chinner Cc: "David S. Miller" Cc: Patrick McHardy Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 0e03036c97b70b2602f7dedaa3a223ed7563c2c9 Author: Eric W. Biederman Date: Wed Feb 14 00:33:57 2007 -0800 [PATCH] sysctl: register the ocfs2 sysctl numbers ocfs2 was did not have the binary number it uses under CTL_FS registered in sysctl.h. Register it to avoid future conflicts, and change the name of the definition to be in line with the rest of the sysctl numbers. Signed-off-by: Eric W. Biederman Acked-by: Mark Fasheh Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit ee9b6d61a2a43c5952eb43283f8db284a4e70b8a Author: Josef 'Jeff' Sipek Date: Mon Feb 12 00:55:41 2007 -0800 [PATCH] Mark struct super_operations const This patch is inspired by Arjan's "Patch series to mark struct file_operations and struct inode_operations const". Compile tested with gcc & sparse. Signed-off-by: Josef 'Jeff' Sipek Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 92e1d5be91a0e3ffa5c4697eeb09b2aa22792122 Author: Arjan van de Ven Date: Mon Feb 12 00:55:39 2007 -0800 [PATCH] mark struct inode_operations const 2 Many struct inode_operations in the kernel can be "const". Marking them const moves these to the .rodata section, which avoids false sharing with potential dirty data. In addition it'll catch accidental writes at compile time to these shared resources. Signed-off-by: Arjan van de Ven Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit 00977a59b951207d38380c75f03a36829950265c Author: Arjan van de Ven Date: Mon Feb 12 00:55:34 2007 -0800 [PATCH] mark struct file_operations const 6 Many struct file_operations in the kernel can be "const". Marking them const moves these to the .rodata section, which avoids false sharing with potential dirty data. In addition it'll catch accidental writes at compile time to these shared resources. Signed-off-by: Arjan van de Ven Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds commit b559292e066f6d570cd5aa5dbd41de61dd04bdce Author: Philipp Reisner Date: Thu Jan 11 10:58:10 2007 +0100 [PATCH] ocfs2 heartbeat: clean up bio submission code As was already pointed out Mathieu Avila on Thu, 07 Sep 2006 03:15:25 -0700 that OCFS2 is expecting bio_add_page() to add pages to BIOs in an easily predictable manner. That is not true, especially for devices with own merge_bvec_fn(). Therefore OCFS2's heartbeat code is very likely to fail on such devices. Move the bio_put() call into the bio's bi_end_io() function. This makes the whole idea of trying to predict the behaviour of bio_add_page() unnecessary. Removed compute_max_sectors() and o2hb_compute_request_limits(). Signed-off-by: Philipp Reisner Signed-off-by: Mark Fasheh commit 925037bcba7691db2403684141a276930ad184f3 Author: Zhen Wei Date: Tue Jan 23 17:19:59 2007 -0800 ocfs2: introduce sc->sc_send_lock to protect outbound outbound messages When there is a lot of multithreaded I/O usage, two threads can collide while sending out a message to the other nodes. This is due to the lack of locking between threads while sending out the messages. When a connected TCP send(), sendto(), or sendmsg() arrives in the Linux kernel, it eventually comes through tcp_sendmsg(). tcp_sendmsg() protects itself by acquiring a lock at invocation by calling lock_sock(). tcp_sendmsg() then loops over the buffers in the iovec, allocating associated sk_buff's and cache pages for use in the actual send. As it does so, it pushes the data out to tcp for actual transmission. However, if one of those allocation fails (because a large number of large sends is being processed, for example), it must wait for memory to become available. It does so by jumping to wait_for_sndbuf or wait_for_memory, both of which eventually cause a call to sk_stream_wait_memory(). sk_stream_wait_memory() contains a code path that calls sk_wait_event(). Finally, sk_wait_event() contains the call to release_sock(). The following patch adds a lock to the socket container in order to properly serialize outbound requests. From: Zhen Wei Acked-by: Jeff Mahoney Signed-off-by: Mark Fasheh commit 0dd82141b236ce36253e3056c6068ee3d5732196 Author: Sunil Mushran Date: Mon Jan 29 15:44:27 2007 -0800 ocfs2_dlm: Add timeout to dlm join domain Currently the ocfs2 dlm has no timeout during dlm join domain. While this is not a problem in normal operation, this does become an issue if, say, the other node is refusing to let the node join the domain because of a stuck recovery. This patch adds a 90 sec timeout. Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit e4968476a9bc5a6b30076076b4f3ce3e692e0d79 Author: Sunil Mushran Date: Mon Jan 29 15:37:02 2007 -0800 ocfs2_dlm: Silence some messages during join domain These messages can easily be activated using the mlog infrastructure and don't need to be enabled by default. Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit 1faf289454b9eeb6e463da3eee47f7009668370d Author: Srinivas Eeda Date: Mon Jan 29 15:31:35 2007 -0800 ocfs2_dlm: disallow a domain join if node maps mismatch There is a small window where a joining node may not see the node(s) that just died but are still part of the domain. To fix this, we must disallow join requests if the joining node has a different node map. A new field node_map is added to dlm_query_join_request to send the current nodes nodemap along with join request. On the receiving end the nodes that are part of the cluster verifies if this new node sees all the nodes that are still part of the cluster. They disallow the join if the maps mismatch. Signed-off-by: Srinivas Eeda Signed-off-by: Mark Fasheh commit f3f854648de64c4b6f13f6f13113bc9525c621e5 Author: Sunil Mushran Date: Mon Jan 29 15:19:16 2007 -0800 ocfs2_dlm: Ensure correct ordering of set/clear refmap bit on lockres Eventhough the set refmap bit message is sent before the clear refmap message, currently there is no guarentee that the set message will be handled before the clear. This patch prevents the clear refmap to be processed while the node is sending assert master messages to other nodes. (The set refmap message is sent as a response to the assert master request). Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit ab81afd30bc154bb1e8749e5aeeffe9b93c90834 Author: Sunil Mushran Date: Mon Jan 29 14:57:14 2007 -0800 ocfs2: Binds listener to the configured ip address This patch binds the o2net listener to the configured ip address instead of INADDR_ANY for security. Fixes oss.oracle.com bugzilla#814. Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit 3b8118cffad224415c6f6f35abe7ca2a1d79c05a Author: Kurt Hackel Date: Wed Jan 17 17:05:53 2007 -0800 ocfs2_dlm: Calling post handler function in assert master handler This patch prevents the dlm from sending the clear refmap message before the set refmap. We use the newly created post function handler routine to accomplish the task. Signed-off-by: Kurt Hackel Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit d74c9803a90d733f5fb7270475aa6d14b45796c6 Author: Kurt Hackel Date: Wed Jan 17 17:04:25 2007 -0800 ocfs2: Added post handler callable function in o2net message handler Currently o2net allows one handler function per message type. This patch adds the ability to call another function to be called after the handler has returned the message to the other node. Handlers are now given the option of returning a context (in the form of a void **) which will be passed back into the post message handler function. Signed-off-by: Kurt Hackel Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit 74aa25856c693d20a886cdb31a004aaca411d135 Author: Kurt Hackel Date: Wed Jan 17 15:11:36 2007 -0800 ocfs2_dlm: Cookies in locks not being printed correctly in error messages The dlm encodes the node number and a sequence number in the lock cookie. It also stores the cookie in the lockres in the big endian format to avoid swapping 8 bytes on each lock request. The bug here was that it was assuming the cookie to be in the cpu format when decoding it for printing the error message. This patch swaps the bytes before the print. Signed-off-by: Kurt Hackel Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit 90aaaf1c235a70daee04e897e9501415b766de69 Author: Kurt Hackel Date: Wed Jan 17 15:01:45 2007 -0800 ocfs2_dlm: Silence a failed convert When the lockres is in migrate or recovery state, all convert requests are denied with the appropriate error status that is handled on the requester node. This patch silences the erroneous error message printed on the master node. Signed-off-by: Kurt Hackel Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit a6fa36402aba96362311318200d710ea1719e59b Author: Kurt Hackel Date: Wed Jan 17 14:59:12 2007 -0800 ocfs2_dlm: wake up sleepers on the lockres waitqueue The dlm was not waking up threads waiting on the lockres wait queue, waiting for the lockres to be no longer be in the DLM_LOCK_RES_IN_PROGRESS and the DLM_LOCK_RES_MIGRATING states. Signed-off-by: Kurt Hackel Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit 28b72d9c92ed43e01e4094f57bcad1814b002779 Author: Kurt Hackel Date: Wed Jan 17 14:57:50 2007 -0800 ocfs2_dlm: Dlm dispatch was stopping too early dlm_dispatch_work was not processing the queued up tasks at the first sign of the node leaving the domain leading to not only incompleted tasks but also a mismatch in the dlm refcnt. Signed-off-by: Kurt Hackel Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit 50635f15b324cbf45a58f103e6b4c7e42502b683 Author: Kurt Hackel Date: Wed Jan 17 14:54:39 2007 -0800 ocfs2_dlm: Drop inflight refmap even if no locks found on the lockres Signed-off-by: Kurt Hackel Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit 1cd04dbe3364be71b93e3aaf4545daa1e261aaa1 Author: Kurt Hackel Date: Wed Jan 17 14:53:37 2007 -0800 ocfs2_dlm: Flush dlm workqueue before starting to migrate This is to prevent the condition in which a previously queued up assert master asserts after we start the migration. Now migration ensures the workqueue is flushed before proceeding with migrating the lock to another node. This condition is typically encountered during parallel umounts. Signed-off-by: Kurt Hackel Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit e17e75ecb86b8ce9b51b219b5348517561031f80 Author: Kurt Hackel Date: Fri Jan 5 15:04:49 2007 -0800 ocfs2_dlm: Fix migrate lockres handler queue scanning The migrate lockres handler was only searching for its lock on migrated lockres on the expected queue. This could be problematic as the new master could have also issued a convert request during the migration and thus moved the lock to the convert queue. We now search for the lock on all three queues. Signed-off-by: Kurt Hackel Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit 71ac1062435ba2d58bf64817b47a6e44f316752e Author: Kurt Hackel Date: Fri Jan 5 15:02:30 2007 -0800 ocfs2_dlm: Make dlmunlock() wait for migration to complete dlmunlock() was not waiting for migration to complete before releasing locks on locally mastered locks. Signed-off-by: Kurt Hackel Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit ddc09c8ddac8d0f170ba8caa8128801f358dccff Author: Kurt Hackel Date: Fri Jan 5 15:00:17 2007 -0800 ocfs2_dlm: Fixes race between migrate and dirty dlmthread was removing lockres' from the dirty list and resetting the dirty flag before shuffling the list. This patch retains the dirty state flag until the lists are shuffled. Signed-off-by: Kurt Hackel Signed-off-by: Sunil Mushran Signed-off-by: Mark Fasheh commit faf0ec9f13defb57f4269ecb22ed86f2874ee89a Author: Adrian Bunk Date: Thu Dec 14 00:17:32 2006 +0100 [PATCH] fs/ocfs2/dlm/: make functions static This patch makes some needlessly global functions static. Signed-off-by: Adrian Bunk Signed-off-by: Mark Fasheh commit ba2bf2185121db74e075c703fbf986761733dd1d Author: Kurt Hackel Date: Fri Dec 1 14:47:20 2006 -0800 ocfs2_dlm: fix cluster-wide refcounting of lock resources This was previously broken and migration of some locks had to be temporarily disabled. We use a new (and backward-incompatible) set of network messages to account for all references to a lock resources held across the cluster. once these are all freed, the master node may then free the lock resource memory once its local references are dropped. Signed-off-by: Kurt Hackel Signed-off-by: Mark Fasheh commit e051fda4fd14fe878e6d2183b3a4640febe9e9a8 Author: Mark Fasheh Date: Thu Feb 1 11:40:16 2007 -0800 ocfs2: ocfs2_link() journal credits update Commit 592282cf2eaa33409c6511ddd3f3ecaa57daeaaa fixed some missing directory c/mtime updates in part by introducing a dinode update in ocfs2_add_entry(). Unfortunately, ocfs2_link() (which didn't update the directory inode before) is now missing a single journal credit. Fix this by doubling the number of inode updates expected during hard link creation. Signed-off-by: Mark Fasheh