summaryrefslogtreecommitdiffstats
path: root/fs/dlm
Commit message (Collapse)AuthorAgeFilesLines
* configfs: Allow ->make_item() and ->make_group() to return detailed errors.Joel Becker2008-07-171-4/+4
| | | | | | | | | | | | | | | | | | The configfs operations ->make_item() and ->make_group() currently return a new item/group. A return of NULL signifies an error. Because of this, -ENOMEM is the only return code bubbled up the stack. Multiple folks have requested the ability to return specific error codes when these operations fail. This patch adds that ability by changing the ->make_item/group() ops to return ERR_PTR() values. These errors are bubbled up appropriately. NULL returns are changed to -ENOMEM for compatibility. Also updated are the in-kernel users of configfs. This is a rework of reverted commit 11c3b79218390a139f2d474ee1e983a672d5839a. Signed-off-by: Joel Becker <joel.becker@oracle.com>
* Revert "configfs: Allow ->make_item() and ->make_group() to return detailed ↵Joel Becker2008-07-171-28/+17
| | | | | | | | | errors." This reverts commit 11c3b79218390a139f2d474ee1e983a672d5839a. The code will move to PTR_ERR(). Signed-off-by: Joel Becker <joel.becker@oracle.com>
* Merge branch 'upstream-linus' of ↵Linus Torvalds2008-07-171-17/+28
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2 * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2: [PATCH] ocfs2: fix oops in mmap_truncate testing configfs: call drop_link() to cleanup after create_link() failure configfs: Allow ->make_item() and ->make_group() to return detailed errors. configfs: Fix failing mkdir() making racing rmdir() fail configfs: Fix deadlock with racing rmdir() and rename() configfs: Make configfs_new_dirent() return error code instead of NULL configfs: Protect configfs_dirent s_links list mutations configfs: Introduce configfs_dirent_lock ocfs2: Don't snprintf() without a format. ocfs2: Fix CONFIG_OCFS2_DEBUG_FS #ifdefs ocfs2/net: Silence build warnings on sparc64 ocfs2: Handle error during journal load ocfs2: Silence an error message in ocfs2_file_aio_read() ocfs2: use simple_read_from_buffer() ocfs2: fix printk format warnings with OCFS2_FS_STATS=n [PATCH 2/2] ocfs2: Instrument fs cluster locks [PATCH 1/2] ocfs2: Add CONFIG_OCFS2_FS_STATS config option
| * configfs: Allow ->make_item() and ->make_group() to return detailed errors.Joel Becker2008-07-141-17/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The configfs operations ->make_item() and ->make_group() currently return a new item/group. A return of NULL signifies an error. Because of this, -ENOMEM is the only return code bubbled up the stack. Multiple folks have requested the ability to return specific error codes when these operations fail. This patch adds that ability by changing the ->make_item/group() ops to return an int. Also updated are the in-kernel users of configfs. Signed-off-by: Joel Becker <joel.becker@oracle.com>
* | Merge commit 'v2.6.26' into bkl-removalJonathan Corbet2008-07-143-15/+16
|\ \ | |/
| * dlm: fix plock dev_write return valueDavid Teigland2008-05-191-1/+1
| | | | | | | | | | | | | | | | | | The return value on writes to the plock device should be the number of bytes written. It was returning 0 instead when an nfs lock callback was involved. Reported-by: Nathan Straz <nstraz@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
| * dlm: tcp_connect_to_sock should check for -EINVAL, not EINVALMarcin Slusarz2008-05-191-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: Christine Caulfield <ccaulfie@redhat.com> Cc: David Teigland <teigland@redhat.com> Cc: cluster-devel@redhat.com Signed-off-by: David Teigland <teigland@redhat.com>
| * dlm: section mismatch warning fixLeonardo Potenza2008-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | Removed the section mismatch message: WARNING: fs/dlm/dlm.o(.init.text+0x132): Section mismatch in reference from the function init_module() to the function .exit.text:dlm_netlink_exit() Since dlm_netlink_exit() is called in the init_dlm() error handling, the __exit annotation has been removed. Signed-off-by: Leonardo Potenza <lpotenza@inwind.it> Signed-off-by: David Teigland <teigland@redhat.com>
| * dlm: convert connections_lock in a mutexMatthias Kaehlcke2008-05-191-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | The semaphore connections_lock is used as a mutex. Convert it to the mutex API. Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net> Cc: Christine Caulfield <ccaulfie@redhat.com> Cc: David Teigland <teigland@redhat.com> Cc: Steven Whitehouse <swhiteho@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: David Teigland <teigland@redhat.com>
* | dlm-user: BKL pushdownArnd Bergmann2008-06-201-1/+8
|/ | | | Signed-off-by: Arnd Bergmann <arnd@arndb.de>
* fs: replace remaining __FUNCTION__ occurrencesHarvey Harrison2008-04-301-1/+1
| | | | | | | | __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge branch 'for-linus' of ↵Linus Torvalds2008-04-2210-23/+526
|\ | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm: dlm: linux/{dlm,dlm_device}.h: cleanup for userspace dlm: common max length definitions dlm: move plock code from gfs2 dlm: recover nodes that are removed and re-added dlm: save master info after failed no-queue request dlm: make dlm_print_rsb() static dlm: match signedness between dlm_config_info and cluster_set
| * dlm: common max length definitionsDavid Teigland2008-04-211-2/+0
| | | | | | | | | | | | | | | | | | Add central definitions for max lockspace name length and max resource name length. The lack of central definitions has resulted in scattered private definitions which we can now clean up, including an unused one in dlm_device.h. Signed-off-by: David Teigland <teigland@redhat.com>
| * dlm: move plock code from gfs2David Teigland2008-04-214-0/+449
| | | | | | | | | | | | | | Move the code that handles cluster posix locks from gfs2 into the dlm so that it can be used by both gfs2 and ocfs2. Signed-off-by: David Teigland <teigland@redhat.com>
| * dlm: recover nodes that are removed and re-addedDavid Teigland2008-04-215-16/+74
| | | | | | | | | | | | | | | | | | | | If a node is removed from a lockspace, and then added back before the dlm is notified of the removal, the dlm will not detect the removal and won't clear the old state from the node. This is fixed by using a list of added nodes so the membership recovery can detect when a newly added node is already in the member list. Signed-off-by: David Teigland <teigland@redhat.com>
| * dlm: save master info after failed no-queue requestDavid Teigland2008-04-211-2/+1
| | | | | | | | | | | | | | | | | | | | When a NOQUEUE request fails, the rsb res_master field is unnecessarily reset to -1, instead of leaving the valid master setting in place. We want to save the looked-up master values while the rsb is on the "toss list" so that another lookup can be avoided if the rsb is soon reused. The fix is to simply leave res_master value alone. Signed-off-by: David Teigland <teigland@redhat.com>
| * dlm: make dlm_print_rsb() staticAdrian Bunk2008-04-212-2/+1
| | | | | | | | | | | | | | dlm_print_rsb() can now become static. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: David Teigland <teigland@redhat.com>
| * dlm: match signedness between dlm_config_info and cluster_setHarvey Harrison2008-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | cluster_set is only called from the macro CLUSTER_ATTR which defines read/write access functions. Make the signedness match to avoid sparse warnings every time CLUSTER_ATTR is used (lines 149-159) all of the form: fs/dlm/config.c:149:1: warning: incorrect type in argument 3 (different signedness) fs/dlm/config.c:149:1: expected unsigned int *info_field fs/dlm/config.c:149:1: got int extern [toplevel] *<noident> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: David Teigland <teigland@redhat.com>
* | fs: Remove unnecessary inclusions of asm/semaphore.hMatthew Wilcox2008-04-181-1/+0
|/ | | | | | | None of these files use any of the functionality promised by asm/semaphore.h. Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
* dlm: fix rcom_names message to selfDavid Teigland2008-02-211-0/+2
| | | | | | | | | The recent patch to validate data lengths in rcom_names messages failed to account for fake messages a node directs to itself before ever sending it. In this case we need to fill in the message length in the header for the validation code to use. Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: add __init and __exit marks to init and exit functionsDenis Cheng2008-02-066-7/+7
| | | | | | | | it moves 365 bytes from .text to .init.text, and 30 bytes from .text to .exit.text, saves memory. Signed-off-by: Denis Cheng <crquan@gmail.com> Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: eliminate astparam type castingDavid Teigland2008-02-066-22/+18
| | | | | | | Put lkb_astparam in a union with a dlm_user_args pointer to eliminate a lot of type casting. Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: proper types for asts and bastsDavid Teigland2008-02-064-33/+44
| | | | | | | Use proper types for ast and bast functions, and use consistent type for ast param. Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: dlm/user.c input validation fixesAl Viro2008-02-041-11/+8
| | | | | | | | | a) in device_write(): add sentinel NUL byte, making sure that lspace.name will be NUL-terminated b) in compat_input() be keep it simple about the amounts of data we are copying. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: fix dlm_dir_lookup() handling of too long namesAl Viro2008-02-041-0/+3
| | | | | | | | ... those can happen and BUG() from DLM_ASSERT() in allocate_direntry() is not a good way to handle them. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: fix overflows when copying from ->m_extra to lvbAl Viro2008-02-041-0/+4
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: make find_rsb() fail gracefully when namelen is too largeAl Viro2008-02-041-1/+5
| | | | | | | | | | | | We *can* get there from receive_request() and dlm_recover_master_copy() with namelen too large if incoming request is invalid; BUG() from DLM_ASSERT() in allocate_rsb() is a bit excessive reaction to that and in case of dlm_recover_master_copy() we would actually oops before that while calculating hash of up to 64Kb worth of data - with data actually being 64 _bytes_ in kmalloc()'ed struct. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: receive_rcom_lock_args() overflow checkAl Viro2008-02-041-3/+4
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: verify that places expecting rcom_lock have packet long enoughAl Viro2008-02-042-1/+14
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: validate data in dlm_recover_directory()Al Viro2008-02-041-3/+20
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: missing length check in check_config()Al Viro2008-02-041-0/+7
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: use proper type for ->ls_recover_bufAl Viro2008-02-044-9/+10
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: do not byteswap rcom_configAl Viro2008-02-043-30/+11
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: do not byteswap rcom_lockAl Viro2008-02-044-76/+39
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: dlm_process_incoming_buffer() fixesAl Viro2008-02-044-24/+36
| | | | | | | | | | | * check that length is large enough to cover the non-variable part of message or rcom resp. (after checking that it's large enough to cover the header, of course). * kill more pointless casts Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: use proper C for dlm/requestqueue stuff (and fix alignment bug)Al Viro2008-02-043-8/+8
| | | | | | | | | | | a) don't cast the pointer to dlm_header *, we use it as dlm_message * anyway. b) we copy the message into a queue element, then pass the pointer to copy to dlm_receive_message_saved(); declare it properly to make sure that we have the right alignment. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: static initialization improvementsDenis Cheng2008-01-301-6/+7
| | | | | | | also change name_prefix from char pointer to char array. Signed-off-by: Denis Cheng <crquan@gmail.com> Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: clean upsDavid Teigland2008-01-302-31/+10
| | | | | | | | A couple small clean-ups. Remove unnecessary wrapper-functions in rcom.c, and remove unnecessary casting and an unnecessary ASSERT in util.c. Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: Sanity check namelen before copying itPatrick Caulfeld2008-01-301-3/+9
| | | | | | | | | | | | | The 32/64 compatibility code in the DLM does not check the validity of the lock name length passed into it, so it can easily overwrite memory if the value is rubbish (as early versions of libdlm can cause with unlock calls, it doesn't zero the field). This patch restricts the length of the name to the amount of data actually passed into the call. Signed-off-by: Patrick Caulfield <pcaulfie@redhat.com> Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: keep cached master rsbs during recoveryDavid Teigland2008-01-305-49/+61
| | | | | | | | | | | To prevent the master of an rsb from changing rapidly, an unused rsb is kept on the "toss list" for a period of time to be reused. The toss list was being cleared completely for each recovery, which is unnecessary. Much of the benefit of the toss list can be maintained if nodes keep rsb's in their toss list that they are the master of. These rsb's need to be included when the resource directory is rebuilt during recovery. Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: change error message to debugDavid Teigland2008-01-301-2/+3
| | | | | | | The invalid lockspace messages are normal and can appear relatively often. They should be suppressed without debugging enabled. Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: fix possible use-after-freeDavid Teigland2008-01-301-2/+2
| | | | | | | The dlm_put_lkb() can free the lkb and its associated ua structure, so we can't depend on using the ua struct after the put. Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: limit dir lookup loopDavid Teigland2008-01-301-2/+4
| | | | | | | | | | | In a rare case we may need to repeat a local resource directory lookup due to a race with removing the rsb and removing the resdir record. We'll never need to do more than a single additional lookup, though, so the infinite loop around the lookup can be removed. In addition to being unnecessary, the infinite loop is dangerous since some other unknown condition may appear causing the loop to never break. Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: reject normal unlock when lock is waiting for lookupDavid Teigland2008-01-301-4/+5
| | | | | | | Non-forced unlocks should be rejected if the lock is waiting on the rsb_lookup list for another lock to establish the master node. Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: validate messages before processingDavid Teigland2008-01-301-35/+104
| | | | | | | | | | | | | | | | | There was some hit and miss validation of messages that has now been cleaned up and unified. Before processing a message, the new validate_message() function checks that the lkb is the appropriate type, process-copy or master-copy, and that the message is from the correct nodeid for the the given lkb. Other checks and assertions on the lkb type and nodeid have been removed. The assertions were particularly bad since they would panic the machine instead of just ignoring the bad message. Although other recent patches have made processing old message unlikely, it still may be possible for an old message to be processed and caught by these checks. Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: reject messages from non-membersDavid Teigland2008-01-303-4/+12
| | | | | | | | | | | Messages from nodes that are no longer members of the lockspace should be ignored. When nodes are removed from the lockspace, recovery can sometimes complete quickly enough that messages arrive from a removed node after recovery has completed. When processed, these messages would often cause an error message, and could in some cases change some state, causing problems. Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: another call to confirm_master in receive_request_replyDavid Teigland2008-01-301-2/+6
| | | | | | | | | When a failed request (EBADR or ENOTBLK) is unlocked/canceled instead of retried, there may be other lkb's waiting on the rsb_lookup list for it to complete. A call to confirm_master() is needed to move on to the next waiting lkb since the current one won't be retried. Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: recover locks waiting for overlap repliesDavid Teigland2008-01-301-5/+32
| | | | | | | | | | | | When recovery looks at locks waiting for replies, it fails to consider locks that have already received a reply for their first remote operation, but not received a reply for secondary, overlapping unlock/cancel. The appropriate stub reply needs to be called for these waiters. Appears when we start doing recovery in the presence of a many overlapping unlock/cancel ops. Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: clear ast_type when removing from astqueueDavid Teigland2008-01-301-0/+1
| | | | | | | | | | | | | | The lkb_ast_type field indicates whether the lkb is on the astqueue list. When clearing locks for a process, lkb's were being removed from the astqueue list without clearing the field. If release_lockspace then happened immediately afterward, it could try to remove the lkb from the list a second time. Appears when process calls libdlm dlm_release_lockspace() which first closes the ls dev triggering clear_proc_locks, and then removes the ls (a write to control dev) causing release_lockspace(). Signed-off-by: David Teigland <teigland@redhat.com>
* dlm: use fixed errno values in messagesDavid Teigland2008-01-301-2/+55
| | | | | | | | | | | | | | | | | Some errno values differ across platforms. So if we return things like -EINPROGRESS from one node it can get misinterpreted or rejected on another one. This patch fixes up the errno values passed on the wire so that they match the x86 ones (so as not to break the protocol), and re-instates the platform-specific ones at the other end. Many thanks to Fabio for testing this patch. Initial patch from Patrick. Signed-off-by: Patrick Caulfield <pcaulfie@redhat.com> Signed-off-by: Fabio M. Di Nitto <fabbione@ubuntu.com> Signed-off-by: David Teigland <teigland@redhat.com>
OpenPOWER on IntegriCloud