]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librgw: make rgw file handle versioned
authorXuehan Xu <xuxuehan@qianxin.com>
Sat, 2 Jan 2021 14:50:23 +0000 (22:50 +0800)
committerXuehan Xu <xxhdx1985126@gmail.com>
Mon, 17 Jan 2022 03:17:24 +0000 (11:17 +0800)
commit49a35d72e0982c03781d4845c800332bded1c658
tree39f9663183ca949ad594e6327e4ec9648f27844a
parent7e035110784fba02ba81944e444be9a36932c6a3
librgw: make rgw file handle versioned

The reason that we need this is that there could be the following scenario:

1. rgw_setattr sets the file attr;
2. rgw_write writes some new data, and encodes its attr to store into rados;
3. before the actual persistence of the file's attr bl, rgw_lookup loads the file's
   previous attr and modifies the current file handle's metadata;
4. rgw_write's result persisted to rados;
5. rgw_setattr set the current file handle's metadata which is actually an old one to rados

In this case, the attr in rados would be out of date which means loss of data

Fixes: https://tracker.ceph.com/issues/50194
Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
src/rgw/rgw_file.cc
src/rgw/rgw_file.h