aboutsummaryrefslogtreecommitdiff
path: root/fs/ocfs2/cluster/tcp.c
AgeCommit message (Collapse)AuthorFilesLines
2013-01-09treewide: Fix typo in various driversMasanari Iida1-1/+1
Correct spelling typo in printk within various drivers. Signed-off-by: Masanari Iida <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
2012-04-21sock: Introduce named constants for sk_reusePavel Emelyanov1-1/+1
Name them in a "backward compatible" manner, i.e. reuse or not are still 1 and 0 respectively. The reuse value of 2 means that the socket with it will forcibly reuse everyone else's port. Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-12-01Merge branch 'upstream-linus' of ↵Linus Torvalds1-66/+72
git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2 * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2: (31 commits) ocfs2: avoid unaligned access to dqc_bitmap ocfs2: Use filemap_write_and_wait() instead of write_inode_now() ocfs2: honor O_(D)SYNC flag in fallocate ocfs2: Add a missing journal credit in ocfs2_link_credits() -v2 ocfs2: send correct UUID to cleancache initialization ocfs2: Commit transactions in error cases -v2 ocfs2: make direntry invalid when deleting it fs/ocfs2/dlm/dlmlock.c: free kmem_cache_zalloc'd data using kmem_cache_free ocfs2: Avoid livelock in ocfs2_readpage() ocfs2: serialize unaligned aio ocfs2: Implement llseek() ocfs2: Fix ocfs2_page_mkwrite() ocfs2: Add comment about orphan scanning ocfs2: Clean up messages in the fs ocfs2/cluster: Cluster up now includes network connections too ocfs2/cluster: Add new function o2net_fill_node_map() ocfs2/cluster: Fix output in file elapsed_time_in_ms ocfs2/dlm: dlmlock_remote() needs to account for remastery ocfs2/dlm: Take inflight reference count for remotely mastered resources too ocfs2/dlm: Cleanup dlm_wait_for_node_death() and dlm_wait_for_node_recovery() ...
2011-10-31fs: add export.h to files using EXPORT_SYMBOL/THIS_MODULE macrosPaul Gortmaker1-0/+1
These files were getting <linux/module.h> via an implicit include path, but we want to crush those out of existence since they cost time during compiles of processing thousands of lines of headers for no reason. Give them the lightweight header that just contains the EXPORT_SYMBOL infrastructure. Signed-off-by: Paul Gortmaker <[email protected]>
2011-07-24ocfs2/cluster: Add new function o2net_fill_node_map()Sunil Mushran1-0/+19
Patch adds function o2net_fill_node_map() to return the bitmap of nodes that it is connected to. This bitmap is also accessible by the user via the debugfs file, /sys/kernel/debug/o2net/connected_nodes. Signed-off-by: Sunil Mushran <[email protected]>
2011-07-24ocfs2/cluster: Clean up messages in o2netSunil Mushran1-66/+53
o2net messages needed a facelift. Signed-off-by: Sunil Mushran <[email protected]>
2011-03-31Fix common misspellingsLucas De Marchi1-1/+1
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <[email protected]>
2011-03-28fs,ocfs2: Move o2net_get_func_run_time under CONFIG_OCFS2_FS_STATS.Rakib Mullick1-5/+5
When CONFIG_DEBUG_FS=y and CONFIG_OCFS2_FS_STATS=n, we get the following warning: fs/ocfs2/cluster/tcp.c:213:16: warning: ‘o2net_get_func_run_time’ defined but not used Since o2net_get_func_run_time is only called from o2net_update_recv_stats, so move it under CONFIG_OCFS2_FS_STATS. Signed-off-by: Rakib Mullick <[email protected]> Signed-off-by: jlbec <[email protected]>
2011-01-07ocfs2: fix build for OCFS2_FS_STATS not enabledRandy Dunlap1-0/+2
When CONFIG_OCFS2_FS_STATS is not enabled: fs/ocfs2/cluster/tcp.c:1254: error: implicit declaration of function 'o2net_update_recv_stats' Signed-off-by: Randy Dunlap <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: [email protected] Signed-off-by: Joel Becker <[email protected]>
2010-12-22ocfs2/cluster: Track process message timing stats for each socketSunil Mushran1-0/+15
Tracks total time taken to process messages received on a socket. Signed-off-by: Sunil Mushran <[email protected]> Signed-off-by: Joel Becker <[email protected]>
2010-12-22ocfs2/cluster: Track send message timing stats for each socketSunil Mushran1-0/+24
Tracks total send and status times for all messages sent on a socket. Signed-off-by: Sunil Mushran <[email protected]> Signed-off-by: Joel Becker <[email protected]>
2010-12-22ocfs2/cluster: Use ktime instead of timeval in struct o2net_sock_containerSunil Mushran1-38/+53
Replace time trackers in struct o2net_sock_container from struct timeval to union ktime. Signed-off-by: Sunil Mushran <[email protected]> Signed-off-by: Joel Becker <[email protected]>
2010-12-22ocfs2/cluster: Replace timeval with ktime in struct o2net_send_trackingSunil Mushran1-3/+3
Replace time trackers in struct o2net_send_tracking from struct timeval to union ktime. Signed-off-by: Sunil Mushran <[email protected]> Signed-off-by: Joel Becker <[email protected]>
2010-12-16ocfs2/cluster: Pin the remote node item in configfsSunil Mushran1-0/+9
o2net pins the node item of the remote node in configfs before initiating the connection. It is unpinned on disconnect. This is to prevent the node item from being unlinked while it is still in use. Signed-off-by: Sunil Mushran <[email protected]> Signed-off-by: Joel Becker <[email protected]>
2010-10-07ocfs2/cluster: Check slots for unconfigured live nodesSunil Mushran1-0/+5
o2hb currently checks slots for configured nodes only. This patch makes it check the slots for the live nodes too to take care of a race in which a node is removed from the configuration but not from the live map. Signed-off-by: Sunil Mushran <[email protected]>
2010-09-18ocfs2/net: fix uninitialized ret in o2net_send_message_vec()Wu Fengguang1-1/+1
mmotm/fs/ocfs2/cluster/tcp.c: In function ‘o2net_send_message_vec’: mmotm/fs/ocfs2/cluster/tcp.c:980:6: warning: ‘ret’ may be used uninitialized in this function It seems a real bug introduced by commit 9af0b38ff3 (ocfs2/net: Use wait_event() in o2net_send_message_vec()). cc: Sunil Mushran <[email protected]> Signed-off-by: Wu Fengguang <[email protected]> Signed-off-by: Joel Becker <[email protected]>
2010-08-07O2net: Disallow o2net accept connection request from itself.Tristan Ye1-5/+12
Currently, o2net_accept_one() is allowed to accept a connection from listening node itself, such a fake connection will not be successfully established due to no handshake detected afterwards, and later end up with triggering connecting worker in a loop. We're going to fix this by treating such connection request as 'invalid', since we've got no chance of requesting connection from a node to itself in a OCFS2 cluster. The fix doesn't hurt user's scan for o2net-listener, it always gets a successful connection from userpace. Signed-off-by: Tristan Ye <[email protected]> Acked-by: Sunil Mushran <[email protected]> Signed-off-by: Joel Becker <[email protected]>
2010-05-05o2net: log socket state changesSrinivas Eeda1-0/+3
This patch logs socket state changes that lead to socket shutdown. Signed-off-by: Srinivas Eeda <[email protected]> Signed-off-by: Joel Becker <[email protected]>
2010-03-12fs/ocfs2/cluster/tcp.c: remove use of NIPQUAD, use %pI4Joe Perches1-2/+2
Signed-off-by: Joe Perches <[email protected]> Cc: Mark Fasheh <[email protected]> Acked-by: Joel Becker <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2010-02-08ocfs2/cluster: Make o2net connect messages KERN_NOTICESunil Mushran1-3/+3
Connect and disconnect messages are more than informational as they are required during root cause analysis for failures. This patch changes them from KERN_INFO to KERN_NOTICE. Signed-off-by: Sunil Mushran <[email protected]> Acked-by: Mark Faseh <[email protected]> Signed-off-by: Joel Becker <[email protected]>
2010-01-25ocfs2/trivial: Remove trailing whitespacesSunil Mushran1-2/+2
Patch removes trailing whitespaces. Signed-off-by: Sunil Mushran <[email protected]> Signed-off-by: Joel Becker <[email protected]>
2009-06-15ocfs2/net: Use wait_event() in o2net_send_message_vec()Sunil Mushran1-5/+2
Replace wait_event_interruptible() with wait_event() in o2net_send_message_vec(). This is because this function is called by the dlm that expects signals to be blocked. Fixes oss bugzilla#1126 http://oss.oracle.com/bugzilla/show_bug.cgi?id=1126 Signed-off-by: Sunil Mushran <[email protected]> Signed-off-by: Joel Becker <[email protected]>
2008-10-31fs: replace NIPQUAD()Harvey Harrison1-15/+14
Using NIPQUAD() with NIPQUAD_FMT, %d.%d.%d.%d or %u.%u.%u.%u can be replaced with %pI4 Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-08-22[PATCH] ocfs2/cluster/tcp.c: make some functions staticAdrian Bunk1-7/+37
Commit 0f475b2abed6cbccee1da20a0bef2895eb2a0edd (ocfs2/net: Silence build warnings) made sense as far as it fixed compile warnings, but it was not required that it made the functions global. Signed-off-by: Adrian Bunk <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2008-05-30[PATCH 3/3] ocfs2/net: Silence build warningsSunil Mushran1-19/+9
This patch silences the build warnings concerning o2net_init_nst() and friends when building without CONFIG_DEBUG_FS enabled. Signed-off-by: Sunil Mushran <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2008-04-18ocfs2/net: Add debug interface to o2netSunil Mushran1-0/+68
This patch exposes o2net information via debugfs. The information includes the list of sockets (sock_containers) as well as the list of outstanding messages (send_tracking). Useful for o2dlm debugging. (This patch is derived from an earlier one written by Zach Brown that exposed the same information via /proc.) [Mark: checkpatch fixes] Signed-off-by: Sunil Mushran <[email protected]> Reviewed-by: Joel Becker <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2008-04-18ocfs2/cluster: Get rid of arguments to the timeout routinesJeff Mahoney1-27/+20
We keep seeing bug reports related to NULL pointer derefs in o2net_set_nn_state(). When I originally wrote up the configurable timeout patch, I had tried to plan for multiple clusters. This was silly. The timeout routines all use o2nm_single_cluster so there's no point in passing an argument at all. This patch removes the arguments and kills those bugs dead. Signed-off-by: Jeff Mahoney <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2008-04-18ocfs2: Reconnect after idle time out.Tao Ma1-15/+36
Currently, o2net connects to a node on hb_up and disconnects on hb_down and net timeout. It disconnects on net timeout is ok, but it should attempt to reconnect back. This is because sometimes nodes get overloaded enough that the network connection breaks but the disk hb does not. And if we get into that situation, we either fence (unnecessarily) or wait for its disk hb to die (and sometimes hang in the process). So in this updated scheme, when the network disconnects, we keep attempting to reconnect till we succeed or we get a disk hb down event. If the other node is really dead, then we will eventually get a node down event. If not, we should be able to connect again and continue. Signed-off-by: Tao Ma <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2008-03-10ocfs2: Fix NULL pointer dereferences in o2netTao Ma1-5/+4
In some situations, ocfs2_set_nn_state might get called with sc = NULL and valid = 0. If sc = NULL, we can't dereference it to get the o2nm_node member. Instead, do what o2net_initialize_handshake does and use NULL when calling o2net_reconnect_delay and o2net_idle_timeout. Signed-off-by: Tao Ma <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2007-12-05remove nonsense force-casts from ocfs2Al Viro1-14/+6
endianness annotations in networking code had been in place for quite a while; in particular, sin_port and s_addr are annotated as big-endian. Code in ocfs2 had __force casts added apparently to shut the sparse warnings up; of course, these days they only serve to *produce* warnings for no reason whatsoever... Signed-off-by: Al Viro <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2007-11-12[NET]: Add the helper kernel_sock_shutdown()Trond Myklebust1-2/+2
...and fix a couple of bugs in the NBD, CIFS and OCFS2 socket handlers. Looking at the sock->op->shutdown() handlers, it looks as if all of them take a SHUT_RD/SHUT_WR/SHUT_RDWR argument instead of the RCV_SHUTDOWN/SEND_SHUTDOWN arguments. Add a helper, and then define the SHUT_* enum to ensure that kernel users of shutdown() don't get confused. Signed-off-by: Trond Myklebust <[email protected]> Acked-by: Mark Fasheh <[email protected]> Acked-by: David Howells <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2007-08-09ocfs2: Retry sendpage() if it returns EAGAINSunil Mushran1-8/+16
Instead of treating EAGAIN, returned from sendpage(), as an error, this patch retries the operation. Signed-off-by: Sunil Mushran <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2007-07-10[PATCH] ocfs2: use list_for_each_entry where beneficalChristoph Hellwig1-9/+4
Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2007-07-10ocfs2: Depend on configfs heartbeat items.Joel Becker1-4/+4
ocfs2 mounts require a heartbeat region. Use the new configfs_depend_item() facility to actually depend on them so they can't go away from under us. First, teach cluster/nodemanager.c to depend an item on the o2cb subsystem. Then teach o2hb_register_callbacks to take a UUID and depend on the appropriate region. Finally, teach all users of o2hb to pass a UUID or NULL if they don't require a pin. Signed-off-by: Joel Becker <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2007-05-02ocfs2: fix sparse warnings in fs/ocfs2/clusterMark Fasheh1-5/+5
Signed-off-by: Mark Fasheh <[email protected]>
2007-03-14ocfs2: Proper cleanup in case of error in ocfs2_register_hb_callbacks()Joel Becker1-11/+2
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 <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2007-02-07ocfs2: introduce sc->sc_send_lock to protect outbound outbound messagesZhen Wei1-0/+8
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 <[email protected]> Acked-by: Jeff Mahoney <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2007-02-07ocfs2: Binds listener to the configured ip addressSunil Mushran1-7/+8
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 <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2007-02-07ocfs2: Added post handler callable function in o2net message handlerKurt Hackel1-1/+11
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 <[email protected]> Signed-off-by: Sunil Mushran <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2006-12-13[PATCH] Fix numerous kcalloc() calls, convert to kzalloc()Robert P. J. Day1-5/+5
All kcalloc() calls of the form "kcalloc(1,...)" are converted to the equivalent kzalloc() calls, and a few kcalloc() calls with the incorrect ordering of the first two arguments are fixed. Signed-off-by: Robert P. J. Day <[email protected]> Cc: Jeff Garzik <[email protected]> Cc: Alan Cox <[email protected]> Cc: Dominik Brodowski <[email protected]> Cc: Adam Belay <[email protected]> Cc: James Bottomley <[email protected]> Cc: Greg KH <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Trond Myklebust <[email protected]> Cc: Neil Brown <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-12-11[patch 3/3] OCFS2 Configurable timeouts - Protocol changesAndrew Beekhof1-9/+83
Modify the OCFS2 handshake to ensure essential timeouts are configured identically on all nodes. Only allow changes when there are no connected peers Improves the logic in o2net_advance_rx() which broke now that sizeof(struct o2net_handshake) is greater than sizeof(struct o2net_msg) Included is the field for userspace-heartbeat timeout to avoid the need for further protocol changes. Uses a global spinlock to ensure the decisions to update configfs entries are made on the correct value. The region covered by the spinlock when incrementing the counter is much larger as this is the more critical case. Small cleanup contributed by Adrian Bunk <[email protected]> Signed-off-by: Andrew Beekhof <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2006-12-07[patch 2/3] OCFS2 Configurable timeoutsJeff Mahoney1-12/+48
Allow configuration of OCFS2 timeouts from userspace via configfs Signed-off-by: Andrew Beekhof <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2006-11-22WorkStruct: make allyesconfigDavid Howells1-34/+44
Fix up for make allyesconfig. Signed-Off-By: David Howells <[email protected]>
2006-06-29ocfs2: Cleanup message printsSunil Mushran1-7/+7
Signed-off-by: Sunil Mushran <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2006-06-27[PATCH] spin/rwlock init cleanupsIngo Molnar1-1/+1
locking init cleanups: - convert " = SPIN_LOCK_UNLOCKED" to spin_lock_init() or DEFINE_SPINLOCK() - convert rwlocks in a similar manner this patch was generated automatically. Motivation: - cleanliness - lockdep needs control of lock initialization, which the open-coded variants do not give - it's also useful for -rt and for lock debugging in general Signed-off-by: Ingo Molnar <[email protected]> Signed-off-by: Arjan van de Ven <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2006-03-01[PATCH] ocfs2: added source addr to bind() in o2net_start_connect()Sunil Mushran1-2/+12
to prevent confusion when a virtual ip is created on the same interface Signed-off-by: Sunil Mushran <[email protected]> Signed-off-by: Mark Fasheh <[email protected]>
2006-02-03[PATCH] ocfs2: fix compile warningsMark Fasheh1-7/+9
Fix a couple of compile warnings found when compiling on a ppc64 build box. Signed-off-by: Mark Fasheh <[email protected]>
2006-01-03[PATCH] OCFS2: The Second Oracle Cluster FilesystemZach Brown1-0/+1829
Node messaging via tcp. Used by the dlm and the file system for point to point communication between nodes. Signed-off-by: Mark Fasheh <[email protected]> Signed-off-by: Kurt Hackel <[email protected]>