]> 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)
committerCory Snyder <csnyder@iland.com>
Thu, 17 Mar 2022 13:34:20 +0000 (09:34 -0400)
commit88f370d45115d15c4488052508d51a5e2670c48b
tree2cd0a5b2a423974624775cceefd7879ec8f76f5a
parent179a7bca8a84771b0dde09e26f7a2146a985df90
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>
(cherry picked from commit 49a35d72e0982c03781d4845c800332bded1c658)
src/rgw/rgw_file.cc
src/rgw/rgw_file.h