]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: fix snap writeback when racing with writes
authorSage Weil <sage@newdream.net>
Tue, 26 Jul 2011 18:26:31 +0000 (11:26 -0700)
committerSage Weil <sage@newdream.net>
Tue, 26 Jul 2011 18:26:31 +0000 (11:26 -0700)
commit48d9b4193d0b04e9d9341c78800235712611dca3
treea8b0ad426b22548eec9e2d350c131426e13af989
parent56f57bb821f8ce7a0723283dd03c098e2282c168
ceph: fix snap writeback when racing with writes

There are two problems that come up when we try to queue a capsnap while a
write is in progress:

 - The FILE_WR cap is held, but not yet dirty, so we may queue a capsnap
   with dirty == 0.  That will crash later in __ceph_flush_snaps().  Or
   on the FILE_WR cap if a write is in progress.
 - We may not have i_head_snapc set, which causes problems pretty quickly.
   Look to the snaprealm in this case.

Reviewed-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Signed-off-by: Sage Weil <sage@newdream.net>
fs/ceph/snap.c