14 Jan, 2012
1 commit
-
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
ceph: ensure prealloc_blob is in place when removing xattr
rbd: initialize snap_rwsem in rbd_add()
ceph: enable/disable dentry complete flags via mount option
vfs: export symbol d_find_any_alias()
ceph: always initialize the dentry in open_root_dentry()
libceph: remove useless return value for osd_client __send_request()
ceph: avoid iput() while holding spinlock in ceph_dir_fsync
ceph: avoid useless dget/dput in encode_fh
ceph: dereference pointer after checking for NULL
crush: fix force for non-root TAKE
ceph: remove unnecessary d_fsdata conditional checks
ceph: Use kmemdup rather than duplicating its implementationFix up conflicts in fs/ceph/super.c (d_alloc_root() failure handling vs
always initialize the dentry in open_root_dentry)
13 Jan, 2012
2 commits
-
In __ceph_build_xattrs_blob(), if a ceph inode's extended attributes
are marked dirty, all attributes recorded in its rb_tree index are
formatted into a "blob" buffer. The target buffer is recorded in
ceph_inode->i_xattrs.prealloc_blob, and it is expected to exist and
be of sufficient size to hold the attributes.The extended attributes are marked dirty in two cases: when a new
attribute is added to the inode; or when one is removed. In the
former case work is done to ensure the prealloc_blob buffer is
properly set up, but in the latter it is not.Change the logic in ceph_removexattr() so it matches what is
done in ceph_setxattr(). Note that this is done in a way that
keeps the two blocks of code nearly identical, in anticipation
of a subsequent patch that encapsulates some of this logic into
one or more helper routines.Signed-off-by: Alex Elder
Signed-off-by: Sage Weil -
Enable/disable use of the dentry dir 'complete' flag via a mount option.
This lets the admin control whether ceph uses the dcache to satisfy
negative lookups or readdir when it has the entire directory contents in
its cache.This is purely a performance optimization; correctness is guaranteed
whether it is enabled or not.Reviewed-by: Christoph Hellwig
Signed-off-by: Sage Weil
12 Jan, 2012
1 commit
-
When open_root_dentry() gets a dentry via d_obtain_alias() it does
not get initialized. If the dentry obtained came from the cache,
this is OK. But if not, the result is an improperly initialized
dentry.To fix this, call ceph_init_dentry() regardless of which path
produced the dentry. That function returns immediately for a dentry
that is already initialized, it is safe to use either way.(Credit to Sage, who suggested this fix.)
Signed-off-by: Alex Elder
11 Jan, 2012
4 commits
-
ceph_mdsc_put_request() can call iput(), which can sleep. Don't do that.
Fixes: #1812
Signed-off-by: Sage Weil -
Nothing we do here sleeps, so just do it under d_lock and avoid the dget/
dput entirely.Reported-by: Al Viro
Signed-off-by: Sage Weil -
moved dereference after BUG_ON
Signed-off-by: Yehuda Sadeh
-
We now set d_fsdata unconditionally on all dentries prior to setting up
the d_ops, so all of these checks are unnecessary.Signed-off-by: Sage Weil
10 Jan, 2012
1 commit
-
... and ceph_init_dentry(NULL) will oops
Signed-off-by: Al Viro
07 Jan, 2012
1 commit
-
Signed-off-by: Al Viro
04 Jan, 2012
6 commits
-
Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
-
vfs_create() ignores everything outside of 16bit subset of its
mode argument; switching it to umode_t is obviously equivalent
and it's the only caller of the methodSigned-off-by: Al Viro
-
vfs_mkdir() gets int, but immediately drops everything that might not
fit into umode_t and that's the only caller of ->mkdir()...Signed-off-by: Al Viro
-
Seeing that just about every destructor got that INIT_LIST_HEAD() copied into
it, there is no point whatsoever keeping this INIT_LIST_HEAD in inode_init_once();
the cost of taking it into inode_init_always() will be negligible for pipes
and sockets and negative for everything else. Not to mention the removal of
boilerplate code from ->destroy_inode() instances...Signed-off-by: Al Viro
30 Dec, 2011
1 commit
-
Ceph attempts to use the dcache to satisfy negative lookups and readdir
when the entire directory contents are in cache. Disable this behavior
until lingering bugs in this code are shaken out; we'll re-enable these
hooks once things are fully stable.Signed-off-by: Sage Weil
14 Dec, 2011
2 commits
-
one of the paths was missing spin_unlock
Signed-off-by: Yehuda Sadeh
-
Commit 06222e491e663dac939f04b125c9dc52126a75c4 got the if wrong so that
it always evaluates as true. This is semantically harmless, but makes
SEEK_CUR and SEEK_SET needlessly query the server.Rewrite the if to explicitly enumerate the cases we DO need a valid i_size
to make this code less fragile.Reported-by: Roel Kluin
Signed-off-by: Sage Weil
08 Dec, 2011
1 commit
-
We have been using i_lock to protect all kinds of data structures in the
ceph_inode_info struct, including lists of inodes that we need to iterate
over while avoiding races with inode destruction. That requires grabbing
a reference to the inode with the list lock protected, but igrab() now
takes i_lock to check the inode flags.Changing the list lock ordering would be a painful process.
However, using a ceph-specific i_ceph_lock in the ceph inode instead of
i_lock is a simple mechanical change and avoids the ordering constraints
imposed by igrab().Reported-by: Amon Ott
Signed-off-by: Sage Weil
03 Dec, 2011
1 commit
-
Fix typo.
Reported-by: mowang da
Signed-off-by: Sage Weil
12 Nov, 2011
1 commit
-
Set up d_fsdata on the root dentry. This fixes a NULL pointer dereference
in ceph_d_prune on umount. It also means we can eventually strip out all
of the conditional checks on d_fsdata because it is now set unconditionally
(prior to setting up the d_ops).Fix the ceph_d_prune debug print while we're here.
Signed-off-by: Sage Weil
06 Nov, 2011
4 commits
-
If we queue a work item that calls iput(), make sure we ihold() before
attempting to queue work. Otherwise our queued work might miraculously run
before we notice the queue_work() succeeded and call ihold(), allowing the
inode to be destroyed.That is, instead of
if (queue_work(...))
ihold();we need to do
ihold();
if (!queue_work(...))
iput();Reported-by: Amon Ott
Signed-off-by: Sage Weil -
Quiet the sparse noise:
warning: symbol 'create_fs_client' was not declared. Should it be static?
warning: symbol 'destroy_fs_client' was not declared. Should it be static?Signed-off-by: H Hartley Sweeten
Cc: Sage Weil
ceph-devel@vger.kernel.org
Signed-off-by: Sage Weil -
Quiet the following sparse noise:
warning: symbol 'get_nonsnap_parent' was not declared. Should it be static?
warning: symbol 'done_closing_sessions' was not declared. Should it be static?Local functions don't need external visability. Make them static.
Signed-off-by: H Hartley Sweeten
Cc: Sage Weil
Signed-off-by: Sage Weil -
We used to use a flag on the directory inode to track whether the dcache
contents for a directory were a complete cached copy. Switch to a dentry
flag CEPH_D_COMPLETE that is safely updated by ->d_prune().Signed-off-by: Sage Weil
04 Nov, 2011
1 commit
-
When the VFS prunes a dentry from the cache, clear the D_COMPLETE flag
on the parent dentry. Do this for the live and snapshotted namespaces. Do
not bother for the .snap dir contents, since we do not cache that.Signed-off-by: Sage Weil
02 Nov, 2011
1 commit
-
Replace remaining direct i_nlink updates with a new set_nlink()
updater function.Signed-off-by: Miklos Szeredi
Tested-by: Toshiyuki Okajima
Signed-off-by: Christoph Hellwig
26 Oct, 2011
11 commits
-
ceph_release_page_vector() kfrees the vector; we shouldn't do it here too.
Reported-by: Jeff Wu
Signed-off-by: Sage Weil -
Fix 32-bit ino generation to not always be 1.
Signed-off-by: Amon Ott
-
Previously we were validating the passed-in stripe unit, object size,
and stripe count against each other (and not testing most other stuff).
Instead, make sure that the composed previous layout and new values are valid,
and only send the new values to the MDS. This lets users change the
pool without setting the whole layout, for instance.Signed-off-by: Greg Farnum
-
This reverts commit c9af9fb68e01eb2c2165e1bc45cfeeed510c64e6.
We need to block and truncate all pages in order to reliably invalidate
them. Otherwise, we could:- have some uptodate pages in the cache
- queue an invalidate
- write(2) locks some pages
- invalidate_work skips them
- write(2) only overwrites part of the page
- page now dirty and uptodate
-> partial leakage of invalidated dataIt's not entirely clear why we started skipping locked pages in the first
place. I just ran this through fsx and didn't see any problems.Signed-off-by: Sage Weil
-
Trivial formatting fix.
Signed-off-by: Noah Watkins
Signed-off-by: Sage Weil -
The pool allocation failures are masked by the pool; there is no need to
spam the console about them. (That's the whole point of having the pool
in the first place.)Mark msg allocations whose failure is safely handled as such.
Signed-off-by: Sage Weil
-
This simplifies the init/shutdown paths, and makes client->msgr available
during the rest of the setup process.Signed-off-by: Sage Weil
-
...after some prodding by Christoph.
Signed-off-by: Sage Weil
-
The 'rsize' mount option limits the maximum size of an individual
read(ahead) operation that is sent off to an OSD. This is distinct from
'rasize', which controls the size of the readahead window.Signed-off-by: Sage Weil
-
It controls readahead.
Signed-off-by: Sage Weil
-
When we get a ->readpages() aop, submit async reads for all page ranges
in the provided page list. Lock the pages immediately, so that VFS/MM
will block until the reads complete.Signed-off-by: Sage Weil
10 Sep, 2011
1 commit
-
* 'for-linus' of git://ceph.newdream.net/git/ceph-client:
libceph: fix leak of osd structs during shutdown
ceph: fix memory leak
ceph: fix encoding of ino only (not relative) paths
libceph: fix msgpool