diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-22 12:58:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-22 12:58:05 -0400 |
commit | f753c4ec151c5c385fa0508a29aa793dee966325 (patch) | |
tree | 934e16b1aaa6c16a73e0c1d94d36997ef7ad419d /fs | |
parent | ad746be96941ddd2fb31fad7a629de7912051c8d (diff) | |
parent | 45f2e081f573526977abfa781a12728f83e9641f (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
Pull ceph fixes from Sage Weil:
"Jim's fix closes a narrow race introduced with the msgr changes. One
fix resolves problems with debugfs initialization that Yan found when
multiple client instances are created (e.g., two clusters mounted, or
rbd + cephfs), another one fixes problems with mounting a nonexistent
server subdirectory, and the last one fixes a divide by zero error
from unsanitized ioctl input that Dan Carpenter found."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
ceph: avoid divide by zero in __validate_layout()
libceph: avoid truncation due to racing banners
ceph: tolerate (and warn on) extraneous dentry from mds
libceph: delay debugfs initialization until we learn global_id
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ceph/debugfs.c | 1 | ||||
-rw-r--r-- | fs/ceph/inode.c | 15 | ||||
-rw-r--r-- | fs/ceph/ioctl.c | 3 |
3 files changed, 13 insertions, 6 deletions
diff --git a/fs/ceph/debugfs.c b/fs/ceph/debugfs.c index fb962efdace..6d59006bfa2 100644 --- a/fs/ceph/debugfs.c +++ b/fs/ceph/debugfs.c | |||
@@ -201,6 +201,7 @@ int ceph_fs_debugfs_init(struct ceph_fs_client *fsc) | |||
201 | int err = -ENOMEM; | 201 | int err = -ENOMEM; |
202 | 202 | ||
203 | dout("ceph_fs_debugfs_init\n"); | 203 | dout("ceph_fs_debugfs_init\n"); |
204 | BUG_ON(!fsc->client->debugfs_dir); | ||
204 | fsc->debugfs_congestion_kb = | 205 | fsc->debugfs_congestion_kb = |
205 | debugfs_create_file("writeback_congestion_kb", | 206 | debugfs_create_file("writeback_congestion_kb", |
206 | 0600, | 207 | 0600, |
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index 9fff9f3b17e..4b5762ef7c2 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -992,11 +992,15 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req, | |||
992 | if (rinfo->head->is_dentry) { | 992 | if (rinfo->head->is_dentry) { |
993 | struct inode *dir = req->r_locked_dir; | 993 | struct inode *dir = req->r_locked_dir; |
994 | 994 | ||
995 | err = fill_inode(dir, &rinfo->diri, rinfo->dirfrag, | 995 | if (dir) { |
996 | session, req->r_request_started, -1, | 996 | err = fill_inode(dir, &rinfo->diri, rinfo->dirfrag, |
997 | &req->r_caps_reservation); | 997 | session, req->r_request_started, -1, |
998 | if (err < 0) | 998 | &req->r_caps_reservation); |
999 | return err; | 999 | if (err < 0) |
1000 | return err; | ||
1001 | } else { | ||
1002 | WARN_ON_ONCE(1); | ||
1003 | } | ||
1000 | } | 1004 | } |
1001 | 1005 | ||
1002 | /* | 1006 | /* |
@@ -1004,6 +1008,7 @@ int ceph_fill_trace(struct super_block *sb, struct ceph_mds_request *req, | |||
1004 | * will have trouble splicing in the virtual snapdir later | 1008 | * will have trouble splicing in the virtual snapdir later |
1005 | */ | 1009 | */ |
1006 | if (rinfo->head->is_dentry && !req->r_aborted && | 1010 | if (rinfo->head->is_dentry && !req->r_aborted && |
1011 | req->r_locked_dir && | ||
1007 | (rinfo->head->is_target || strncmp(req->r_dentry->d_name.name, | 1012 | (rinfo->head->is_target || strncmp(req->r_dentry->d_name.name, |
1008 | fsc->mount_options->snapdir_name, | 1013 | fsc->mount_options->snapdir_name, |
1009 | req->r_dentry->d_name.len))) { | 1014 | req->r_dentry->d_name.len))) { |
diff --git a/fs/ceph/ioctl.c b/fs/ceph/ioctl.c index 8e3fb69fbe6..1396ceb4679 100644 --- a/fs/ceph/ioctl.c +++ b/fs/ceph/ioctl.c | |||
@@ -42,7 +42,8 @@ static long __validate_layout(struct ceph_mds_client *mdsc, | |||
42 | /* validate striping parameters */ | 42 | /* validate striping parameters */ |
43 | if ((l->object_size & ~PAGE_MASK) || | 43 | if ((l->object_size & ~PAGE_MASK) || |
44 | (l->stripe_unit & ~PAGE_MASK) || | 44 | (l->stripe_unit & ~PAGE_MASK) || |
45 | ((unsigned)l->object_size % (unsigned)l->stripe_unit)) | 45 | (l->stripe_unit != 0 && |
46 | ((unsigned)l->object_size % (unsigned)l->stripe_unit))) | ||
46 | return -EINVAL; | 47 | return -EINVAL; |
47 | 48 | ||
48 | /* make sure it's a valid data pool */ | 49 | /* make sure it's a valid data pool */ |