diff options
author | Sage Weil <sage@newdream.net> | 2010-06-21 13:38:14 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-06-21 19:04:10 -0400 |
commit | d69ed05a80f23b25f06e73af9b7e701ce4900edc (patch) | |
tree | dfe4d372b1c2bb66a71d13d6bf8a22758640ddd0 /fs/ceph/inode.c | |
parent | cebc5be6b6c82a99231e9c9af451e9e3d3399ec6 (diff) |
ceph: handle splice_dentry/d_materialize_unique error in readdir_prepopulate
Handle a splice_dentry failure (due to a d_materialize_unique error)
without crashing. (Also, report the error code.)
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/inode.c')
-rw-r--r-- | fs/ceph/inode.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c index ab47f46ca282..8f9b9fe8ef9f 100644 --- a/fs/ceph/inode.c +++ b/fs/ceph/inode.c | |||
@@ -854,8 +854,8 @@ static struct dentry *splice_dentry(struct dentry *dn, struct inode *in, | |||
854 | d_drop(dn); | 854 | d_drop(dn); |
855 | realdn = d_materialise_unique(dn, in); | 855 | realdn = d_materialise_unique(dn, in); |
856 | if (IS_ERR(realdn)) { | 856 | if (IS_ERR(realdn)) { |
857 | pr_err("splice_dentry error %p inode %p ino %llx.%llx\n", | 857 | pr_err("splice_dentry error %ld %p inode %p ino %llx.%llx\n", |
858 | dn, in, ceph_vinop(in)); | 858 | PTR_ERR(realdn), dn, in, ceph_vinop(in)); |
859 | if (prehash) | 859 | if (prehash) |
860 | *prehash = false; /* don't rehash on error */ | 860 | *prehash = false; /* don't rehash on error */ |
861 | dn = realdn; /* note realdn contains the error */ | 861 | dn = realdn; /* note realdn contains the error */ |
@@ -1234,18 +1234,23 @@ retry_lookup: | |||
1234 | goto out; | 1234 | goto out; |
1235 | } | 1235 | } |
1236 | dn = splice_dentry(dn, in, NULL); | 1236 | dn = splice_dentry(dn, in, NULL); |
1237 | if (IS_ERR(dn)) | ||
1238 | dn = NULL; | ||
1237 | } | 1239 | } |
1238 | 1240 | ||
1239 | if (fill_inode(in, &rinfo->dir_in[i], NULL, session, | 1241 | if (fill_inode(in, &rinfo->dir_in[i], NULL, session, |
1240 | req->r_request_started, -1, | 1242 | req->r_request_started, -1, |
1241 | &req->r_caps_reservation) < 0) { | 1243 | &req->r_caps_reservation) < 0) { |
1242 | pr_err("fill_inode badness on %p\n", in); | 1244 | pr_err("fill_inode badness on %p\n", in); |
1243 | dput(dn); | 1245 | goto next_item; |
1244 | continue; | ||
1245 | } | 1246 | } |
1246 | update_dentry_lease(dn, rinfo->dir_dlease[i], | 1247 | if (dn) |
1247 | req->r_session, req->r_request_started); | 1248 | update_dentry_lease(dn, rinfo->dir_dlease[i], |
1248 | dput(dn); | 1249 | req->r_session, |
1250 | req->r_request_started); | ||
1251 | next_item: | ||
1252 | if (dn) | ||
1253 | dput(dn); | ||
1249 | } | 1254 | } |
1250 | req->r_did_prepopulate = true; | 1255 | req->r_did_prepopulate = true; |
1251 | 1256 | ||