aboutsummaryrefslogtreecommitdiff
path: root/fs/ceph
AgeCommit message (Collapse)Author
2009-12-23ceph: control access to page vector for incoming dataSage Weil
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>
2009-12-23ceph: use connection mutex to protect read and write stagesSage Weil
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>
2009-12-23ceph: unregister canceled/timed out osd requestsSage Weil
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>
2009-12-23ceph: only unregister registered bdiSage Weil
Signed-off-by: Sage Weil <sage@newdream.net>
2009-12-23ceph: do not touch_caps while iterating over caps listSage Weil
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>
2009-12-21ceph: fix incremental osdmap pg_temp decoding bugSage Weil
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>
2009-12-21ceph: fix error paths for corrupt osdmap messagesSage Weil
Both osdmap_decode() and osdmap_apply_incremental() should never return NULL. Signed-off-by: Sage Weil <sage@newdream.net>
2009-12-21ceph: do not drop lease during revalidateSage Weil
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>
2009-12-21ceph: ensure rename target dentry fails revalidationSage Weil
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>
2009-12-21ceph: writeback congestion controlYehuda Sadeh
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>
2009-12-21ceph: writepage grabs and releases inodeYehuda Sadeh
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>
2009-12-21ceph: remove unaccessible codeYehuda Sadeh
Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
2009-12-21ceph: include link to bdi in debugfsSage Weil
Signed-off-by: Sage Weil <sage@newdream.net>
2009-12-21ceph: make mds ops interruptibleSage Weil
Signed-off-by: Sage Weil <sage@newdream.net>
2009-12-21ceph: plug leak of incoming message during connection fault/closeSage Weil
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>
2009-12-21ceph: hex dump corrupt server data to KERN_DEBUGSage Weil
Also, print fsid using standard format, NOT hex dump. Signed-off-by: Sage Weil <sage@newdream.net>
2009-12-21ceph: fix msgpool reservation leakYehuda Sadeh
Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
2009-12-21ceph: don't save sent messages on lossy connectionsSage Weil
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>
2009-12-21ceph: detect lossy state of connectionSage Weil
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>
2009-12-21ceph: plug msg leak in con_faultSage Weil
Signed-off-by: Sage Weil <sage@newdream.net>
2009-12-21ceph: carry explicit msg reference for currently sending messageSage Weil
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>
2009-12-11ceph: fix leak of monc mutexSage Weil
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>
2009-12-09ceph: do not feed bad device ids to crushSage Weil
Do not feed bad (large) device ids to CRUSH. Signed-off-by: Sage Weil <sage@newdream.net>
2009-12-07ceph: use kref for ceph_msgSage Weil
Signed-off-by: Sage Weil <sage@newdream.net>
2009-12-07ceph: use kref for ceph_osd_requestSage Weil
Signed-off-by: Sage Weil <sage@newdream.net>
2009-12-07ceph: use kref for struct ceph_mds_requestSage Weil
Signed-off-by: Sage Weil <sage@newdream.net>
2009-12-07ceph: simplify ceph_buffer interfaceSage Weil
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>
2009-12-07ceph: use kref for ceph_bufferSage Weil
Signed-off-by: Sage Weil <sage@newdream.net>
2009-12-04ceph: mark v0.18 releaseSage Weil
Signed-off-by: Sage Weil <sage@newdream.net>
2009-12-03ceph: allow preferred osd to be get/set via layout ioctlSage Weil
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>
2009-12-03ceph: hide /.ceph from readdir resultsSage Weil
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>
2009-12-03ceph: whitespace cleanupSage Weil
Signed-off-by: Sage Weil <sage@newdream.net>
2009-12-01ceph: plug leak of request_mutexSage Weil
Fix leak of osd client request_mutex on receiving dup ack. Signed-off-by: Sage Weil <sage@newdream.net>
2009-11-21ceph: remove useless IS_ERR checksSage Weil
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>
2009-11-21fs/ceph: Move a dereference below a NULL testJulia Lawall
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>
2009-11-21fs/ceph: introduce missing kfreeJulia Lawall
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>
2009-11-20ceph: remove dead codeSage Weil
Left over from mount/auth protocol changes. Signed-off-by: Sage Weil <sage@newdream.net>
2009-11-20ceph: reset msgr backoff during open, not after successful handshakeSage Weil
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>
2009-11-20ceph: reset requested max_size after mds reconnectSage Weil
The max_size increase request to the MDS can get lost during an MDS restart and reconnect. Reset our requested value after the MDS recovers, so that any blocked writes will re-request a larger max_size upon waking. Also, explicit wake session caps after the reconnect. Normally the cap renewal catches this, but not in the cases where the caps didn't go stale in the first place, which would leave writers waiting on max_size asleep. Signed-off-by: Sage Weil <sage@newdream.net>
2009-11-20ceph: mount fails immediately on errorYehuda Sadeh
Signed-off-by: Yehuda Sadeh <yehuda@newdream.net>
2009-11-20ceph: decode updated mdsmap formatSage Weil
The mds map now uses the global_id as the 'key' (instead of the addr, which was a poor choice). This is protocol change. Signed-off-by: Sage Weil <sage@newdream.net>
2009-11-20ceph: fix debugfs entry, simplify fsid checksSage Weil
We may first learn our fsid from any of the mon, osd, or mds maps (whichever the monitor sends first). Consolidate checks in a single helper. Initialize the client debugfs entry then, since we need the fsid (and global_id) for the directory name. Also remove dead mount code. Signed-off-by: Sage Weil <sage@newdream.net>
2009-11-20ceph: small cleanup in hash functionSage Weil
Signed-off-by: Sage Weil <sage@newdream.net>
2009-11-18ceph: move mempool creation to ceph_create_clientSage Weil
Signed-off-by: Sage Weil <sage@newdream.net>
2009-11-18ceph: negotiate authentication protocol; implement AUTH_NONE protocolSage Weil
When we open a monitor session, we send an initial AUTH message listing the auth protocols we support, our entity name, and (possibly) a previously assigned global_id. The monitor chooses a protocol and responds with an initial message. Initially implement AUTH_NONE, a dummy protocol that provides no security, but works within the new framework. It generates 'authorizers' that are used when connecting to (mds, osd) services that simply state our entity name and global_id. This is a wire protocol change. Signed-off-by: Sage Weil <sage@newdream.net>
2009-11-18ceph: handle errors during osd client initSage Weil
Unwind initializing if we get ENOMEM during client initialization. Signed-off-by: Sage Weil <sage@newdream.net>
2009-11-18ceph: remove unnecessary ceph_con_shutdownSage Weil
We require that ceph_con_close be called before we drop the connection, so this is unneeded. Just BUG if con->sock != NULL. Signed-off-by: Sage Weil <sage@newdream.net>
2009-11-18ceph: remove bad calls to ceph_con_shutdownSage Weil
We want to ceph_con_close when we're done with the connection, before the ref count reaches 0. Once it does, do not call ceph_con_shutdown, as that takes the con mutex and may sleep, and besides that is unnecessary. Signed-off-by: Sage Weil <sage@newdream.net>
2009-11-12ceph: fix page invalidation deadlockSage Weil
We occasionally want to make a best-effort attempt to invalidate cache pages without fear of blocking. If this fails, we fall back to an async invalidate in another thread. Use invalidate_mapping_pages instead of invalidate_inode_page2, as that will skip locked pages, and not deadlock. Signed-off-by: Sage Weil <sage@newdream.net>
2009-11-12ceph: build cleanly without CONFIG_DEBUG_FSSage Weil
Signed-off-by: Sage Weil <sage@newdream.net>