diff options
author | Sage Weil <sage@newdream.net> | 2010-08-24 11:44:16 -0400 |
---|---|---|
committer | Sage Weil <sage@newdream.net> | 2010-08-24 19:24:18 -0400 |
commit | 7d8cb26d7dcb911f110b7762bd5941e8f009d6c3 (patch) | |
tree | 2adf2f6303cc96ff14c951dc6966f68a0fc3cf25 /fs/ceph/super.h | |
parent | 07a27e226d1ed210d2d4218bd0642b40f5405c6a (diff) |
ceph: maintain i_head_snapc when any caps are dirty, not just for data
We used to use i_head_snapc to keep track of which snapc the current epoch
of dirty data was dirtied under. It is used by queue_cap_snap to set up
the cap_snap. However, since we queue cap snaps for any dirty caps, not
just for dirty file data, we need to keep a valid i_head_snapc anytime
we have dirty|flushing caps. This fixes a NULL pointer deref in
queue_cap_snap when writing back dirty caps without data (e.g.,
snaptest-authwb.sh).
Signed-off-by: Sage Weil <sage@newdream.net>
Diffstat (limited to 'fs/ceph/super.h')
-rw-r--r-- | fs/ceph/super.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ceph/super.h b/fs/ceph/super.h index b33929d8f287..c33897ae5725 100644 --- a/fs/ceph/super.h +++ b/fs/ceph/super.h | |||
@@ -344,7 +344,8 @@ struct ceph_inode_info { | |||
344 | unsigned i_cap_exporting_issued; | 344 | unsigned i_cap_exporting_issued; |
345 | struct ceph_cap_reservation i_cap_migration_resv; | 345 | struct ceph_cap_reservation i_cap_migration_resv; |
346 | struct list_head i_cap_snaps; /* snapped state pending flush to mds */ | 346 | struct list_head i_cap_snaps; /* snapped state pending flush to mds */ |
347 | struct ceph_snap_context *i_head_snapc; /* set if wr_buffer_head > 0 */ | 347 | struct ceph_snap_context *i_head_snapc; /* set if wr_buffer_head > 0 or |
348 | dirty|flushing caps */ | ||
348 | unsigned i_snap_caps; /* cap bits for snapped files */ | 349 | unsigned i_snap_caps; /* cap bits for snapped files */ |
349 | 350 | ||
350 | int i_nr_by_mode[CEPH_FILE_MODE_NUM]; /* open file counts */ | 351 | int i_nr_by_mode[CEPH_FILE_MODE_NUM]; /* open file counts */ |