ceph: reserve one more caps space when doing readdir

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Wednesday, April 14, 2010 - 6:59 pm

Gitweb:     http://git.kernel.org/linus/e1e4dd0caa63e166afa46a1ccc947bebb4f66bcf
Commit:     e1e4dd0caa63e166afa46a1ccc947bebb4f66bcf
Parent:     fc837c8f0446b73a1661339db406c0238dd1d184
Author:     Yehuda Sadeh <yehuda@hq.newdream.net>
AuthorDate: Tue Apr 13 11:45:56 2010 -0700
Committer:  Sage Weil <sage@newdream.net>
CommitDate: Tue Apr 13 12:28:54 2010 -0700

    ceph: reserve one more caps space when doing readdir
    
    We were missing space for the directory cap.  The result was a BUG at
    fs/ceph/caps.c:2178.
    
    Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
    Signed-off-by: Sage Weil <sage@newdream.net>
---
 fs/ceph/dir.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index 7505b4f..159f588 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -311,7 +311,7 @@ more:
 		req->r_readdir_offset = fi->next_offset;
 		req->r_args.readdir.frag = cpu_to_le32(frag);
 		req->r_args.readdir.max_entries = cpu_to_le32(max_entries);
-		req->r_num_caps = max_entries;
+		req->r_num_caps = max_entries + 1;
 		err = ceph_mdsc_do_request(mdsc, NULL, req);
 		if (err < 0) {
 			ceph_mdsc_put_request(req);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ceph: reserve one more caps space when doing readdir, Linux Kernel Mailing ..., (Wed Apr 14, 6:59 pm)