From: Sage Weil Date: Fri, 7 May 2010 22:57:37 +0000 (-0700) Subject: mds: fix max_size==1 bug X-Git-Tag: v0.20.1~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7606ea27ef9539af9d2e3719568c25b8169a7dd2;p=ceph.git mds: fix max_size==1 bug We should provide a minimum of one stripe unit. --- diff --git a/src/mds/Locker.cc b/src/mds/Locker.cc index c0942557a83..7fedf8bcc7c 100644 --- a/src/mds/Locker.cc +++ b/src/mds/Locker.cc @@ -1919,8 +1919,10 @@ bool Locker::_do_cap_update(CInode *in, Capability *cap, change_max = true; new_max = ROUND_UP_TO((m->get_max_size()+1) << 1, latest->get_layout_size_increment()); } else { - //new_max = ROUND_UP_TO((size+1)<<1, latest->get_layout_size_increment()); new_max = calc_bounding(size * 2); + if (new_max < latest->get_layout_size_increment()) + new_max = latest->get_layout_size_increment(); + if (new_max > old_max) change_max = true; else