summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ceph: mark MDS CREATE as a write opSage Weil2010-01-251-2/+2
| | | | | | CEPH_MDS_OP_CREATE was not correctly marked as a write operation. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: remove duplicate variable initializationJulia Lawall2010-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The variable client is initialized twice to the same (side effect-free) expression. Drop one initialization. A simplified version of the semantic match that finds this problem is: (http://coccinelle.lip6.fr/) // <smpl> @forall@ idexpression *x; identifier f!=ERR_PTR; @@ x = f(...) ... when != x ( x = f(...,<+...x...+>,...) | * x = f(...) ) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: display pgid in debugfs osd request dumpSage Weil2010-01-143-2/+7
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: remove unused erank fieldSage Weil2010-01-144-32/+15
| | | | | | | The ceph_entity_addr erank field is obsolete; remove it. Get rid of trivial addr comparison helpers while we're at it. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: change dentry offset and position after splice_dentryYehuda Sadeh2010-01-141-0/+29
| | | | | | | | | This fixes a bug, where we had the parent list have dentries with offsets that are not monotonically increasing, which caused the ceph dcache_readdir to skip entries. Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net> Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: fix copy_user_to_page_vector()Yehuda Sadeh2010-01-061-4/+4
| | | | | | | | The function was broken in the case where there was more than one page involved, broke the ceph sync_write case. Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net> Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: use ceph_pagelist for mds reconnect message; change encoding (protocol ↵Sage Weil2009-12-232-101/+57
| | | | | | | | | | | | change) Use the ceph_pagelist to encode the MDS reconnect message. We change the message encoding (protocol change!) at the same time to make our life easier (we don't know how many snaprealms we have when we start encoding). An empty message implies the session is closed/does not exist. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: support ceph_pagelist for message payloadSage Weil2009-12-235-5/+130
| | | | | | | | | | | The ceph_pagelist is a simple list of whole pages, strung together via their lru list_head. It facilitates encoding to a "buffer" of unknown size. Allow its use in place of the ceph_msg page vector. This will be used to fix the huge buffer preallocation woes of MDS reconnection. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: add feature bits to connection handshake (protocol change)Sage Weil2009-12-234-17/+53
| | | | | | | | Define supported and required feature set. Fail connection if the server requires features we do not support (TAG_FEATURES), or if the server does not support features we require. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: include transaction id in ceph_msg_header (protocol change)Sage Weil2009-12-237-27/+20
| | | | | | | | | | Many (most?) message types include a transaction id. By including it in the fixed size header, we always have it available even when we are unable to allocate memory for the (larger, variable sized) message body. This will allow us to error out the appropriate request instead of (silently) dropping the reply. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: more informative msgpool errorsSage Weil2009-12-231-1/+2
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: control access to page vector for incoming dataSage Weil2009-12-234-10/+67
| | | | | | | | | | | | | | When we issue an OSD read, we specify a vector of pages that the data is to be read into. The request may be sent multiple times, to multiple OSDs, if the osdmap changes, which means we can get more than one reply. Only read data into the page vector if the reply is coming from the OSD we last sent the request to. Keep track of which connection is using the vector by taking a reference. If another connection was already using the vector before and a new reply comes in on the right connection, revoke the pages from the other connection. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: use connection mutex to protect read and write stagesSage Weil2009-12-232-19/+33
| | | | | | | | | Use a single mutex (previously out_mutex) to protect both read and write activity from concurrent ceph_con_* calls. Drop the mutex when doing callbacks to avoid nested locking (the callback may need to call something like ceph_con_close). Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: unregister canceled/timed out osd requestsSage Weil2009-12-231-1/+2
| | | | | | | | Canceled or timed out osd requests were getting left in the request list and never deallocated (until umount). Unregister if they are canceled (control-c) or time out. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: only unregister registered bdiSage Weil2009-12-231-1/+2
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: do not touch_caps while iterating over caps listSage Weil2009-12-233-7/+19
| | | | | | | | | | Avoid confusing iterate_session_caps(), flag the session while we are iterating so that __touch_cap does not rearrange items on the list. All other modifiers of session->s_caps do so under the protection of s_mutex. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: fix incremental osdmap pg_temp decoding bugSage Weil2009-12-211-2/+1
| | | | | | | | | An incremental pg_temp wasn't being decoded properly (wrong bound on for loop). Also remove unused local variable, while we're at it. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: fix error paths for corrupt osdmap messagesSage Weil2009-12-212-5/+8
| | | | | | | Both osdmap_decode() and osdmap_apply_incremental() should never return NULL. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: do not drop lease during revalidateSage Weil2009-12-211-2/+0
| | | | | | | We need to hold session s_mutex for __ceph_mdsc_drop_dentry_lease(), which we don't, so skip it. It was purely an optimization. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: ensure rename target dentry fails revalidationSage Weil2009-12-211-0/+4
| | | | | | | | | | This works around a bug in vfs_rename_dir() that rehashes the target dentry. Ensure such dentries always fail revalidation by timing out the dentry lease and kicking it out of the current directory lease gen. This can be reverted when the vfs bug is fixed. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: writeback congestion controlYehuda Sadeh2009-12-214-2/+105
| | | | | | | | Set bdi congestion bit when amount of write data in flight exceeds adjustable threshold. Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net> Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: writepage grabs and releases inodeYehuda Sadeh2009-12-211-1/+6
| | | | | | | | Fixes a deadlock that is triggered due to kswapd, while the page was locked and the iput couldn't tear down the address space. Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
* ceph: remove unaccessible codeYehuda Sadeh2009-12-211-4/+0
| | | | Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
* ceph: include link to bdi in debugfsSage Weil2009-12-212-0/+8
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: make mds ops interruptibleSage Weil2009-12-211-6/+9
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: plug leak of incoming message during connection fault/closeSage Weil2009-12-211-2/+8
| | | | | | | If we explicitly close a connection, or there is a socket error, we need to drop any partially received message. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: hex dump corrupt server data to KERN_DEBUGSage Weil2009-12-2110-7/+41
| | | | | | Also, print fsid using standard format, NOT hex dump. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: fix msgpool reservation leakYehuda Sadeh2009-12-212-1/+5
| | | | Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
* ceph: don't save sent messages on lossy connectionsSage Weil2009-12-211-3/+7
| | | | | | | For lossy connections we drop all state on socket errors, so there is no reason to keep sent ceph_msg's around. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: detect lossy state of connectionSage Weil2009-12-211-2/+4
| | | | | | | The server indicates whether a connection is lossy; set our LOSSYTX bit appropriately. Do not set lossy bit on outgoing connections. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: plug msg leak in con_faultSage Weil2009-12-211-2/+7
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: carry explicit msg reference for currently sending messageSage Weil2009-12-212-4/+19
| | | | | | | Carry a ceph_msg reference for connection->out_msg. This will allow us to make out_sent optional. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: fix leak of monc mutexSage Weil2009-12-111-2/+3
| | | | | | | Fix leak of monc mutex on ENOMEM or bad fsid when receiving new mon map. Audited all other users. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: do not feed bad device ids to crushSage Weil2009-12-091-0/+5
| | | | | | Do not feed bad (large) device ids to CRUSH. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: use kref for ceph_msgSage Weil2009-12-073-35/+27
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: use kref for ceph_osd_requestSage Weil2009-12-072-22/+26
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: use kref for struct ceph_mds_requestSage Weil2009-12-072-38/+42
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: simplify ceph_buffer interfaceSage Weil2009-12-075-29/+35
| | | | | | | | | We never allocate the ceph_buffer and buffer separtely, so use a single constructor. Disallow put on NULL buffer; make the caller check. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: use kref for ceph_bufferSage Weil2009-12-072-12/+20
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: mark v0.18 releaseSage Weil2009-12-041-1/+1
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: update MAINTAINERS entry with correct git URLSage Weil2009-12-031-1/+1
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: allow preferred osd to be get/set via layout ioctlSage Weil2009-12-032-1/+5
| | | | | | | | | There is certainly no reason not to report this. The only real downside to allowing the user to set it is that you don't get default values by zeroing the layout struct (the default is -1). Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: hide /.ceph from readdir resultsSage Weil2009-12-032-0/+9
| | | | | | | We need to skip /.ceph in (cached) readdir results, and exclude "/.ceph" from the cached ENOENT lookup check. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: whitespace cleanupSage Weil2009-12-035-9/+9
| | | | Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: plug leak of request_mutexSage Weil2009-12-011-0/+1
| | | | | | Fix leak of osd client request_mutex on receiving dup ack. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: remove useless IS_ERR checksSage Weil2009-11-211-10/+0
| | | | | | | | ceph_lookup_snap_realm either returns a valid pointer or NULL; there is no need to check IS_ERR(result). Reported-by: Julia Lawall <julia@diku.dk> Signed-off-by: Sage Weil <sage@newdream.net>
* fs/ceph: Move a dereference below a NULL testJulia Lawall2009-11-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | If the NULL test is necessary, then the dereference should be moved below the NULL test. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/). // <smpl> @@ type T; expression E; identifier i,fld; statement S; @@ - T i = E->fld; + T i; ... when != E when != i if (E == NULL) S + i = E->fld; // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Sage Weil <sage@newdream.net>
* fs/ceph: introduce missing kfreeJulia Lawall2009-11-211-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Error handling code following a kmalloc should free the allocated data. The semantic match that finds this problem is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @r exists@ local idexpression x; statement S; expression E; identifier f,f1,l; position p1,p2; expression *ptr != NULL; @@ x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...); ... if (x == NULL) S <... when != x when != if (...) { <+...x...+> } ( x->f1 = E | (x->f1 == NULL || ...) | f(...,x->f1,...) ) ...> ( return \(0\|<+...x...+>\|ptr\); | return@p2 ...; ) @script:python@ p1 << r.p1; p2 << r.p2; @@ print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: remove dead codeSage Weil2009-11-201-21/+0
| | | | | | Left over from mount/auth protocol changes. Signed-off-by: Sage Weil <sage@newdream.net>
* ceph: reset msgr backoff during open, not after successful handshakeSage Weil2009-11-201-2/+1
| | | | | | | | Reset the backoff delay when we reopen the connection, so that the delays for any initial connection problems are reasonable. We were resetting only after a successful handshake, which was of limited utility. Signed-off-by: Sage Weil <sage@newdream.net>
OpenPOWER on IntegriCloud