mds: fix off-by-one in cow_inode vs snap flushes
mds: fix off-by-one in cow_inode vs snap flushes

We need to wait for the client to flush snapped caps if the client has
not already flushed for the given snap.  If the client has already flushed
caps through the last snapid for the old inode, we do not need to set up
the snapped inode's locks to wait for that.

This fixes an occasional hang on the snaps/snaptest-multiple-capsnaps.sh
workunit.

Signed-off-by: Sage Weil <c5b6ff1fd4f0bde10db63d7a3e07166cf6c4229f@dreamhost.com>

ajnelson/ceph,ajnelson/ceph,ajnelson/ceph,ajnelson/ceph,ajnelson/ceph,ajnelson/ceph