File tree Expand file tree Collapse file tree 3 files changed +13
-0
lines changed
Expand file tree Collapse file tree 3 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1916,6 +1916,8 @@ void ceph_check_caps(struct ceph_inode_info *ci, int flags)
19161916
19171917 spin_lock (& ci -> i_ceph_lock );
19181918 if (ci -> i_ceph_flags & CEPH_I_ASYNC_CREATE ) {
1919+ ci -> i_ceph_flags |= CEPH_I_ASYNC_CHECK_CAPS ;
1920+
19191921 /* Don't send messages until we get async create reply */
19201922 spin_unlock (& ci -> i_ceph_lock );
19211923 return ;
Original file line number Diff line number Diff line change @@ -534,14 +534,23 @@ static void wake_async_create_waiters(struct inode *inode,
534534 struct ceph_mds_session * session )
535535{
536536 struct ceph_inode_info * ci = ceph_inode (inode );
537+ bool check_cap = false;
537538
538539 spin_lock (& ci -> i_ceph_lock );
539540 if (ci -> i_ceph_flags & CEPH_I_ASYNC_CREATE ) {
540541 ci -> i_ceph_flags &= ~CEPH_I_ASYNC_CREATE ;
541542 wake_up_bit (& ci -> i_ceph_flags , CEPH_ASYNC_CREATE_BIT );
543+
544+ if (ci -> i_ceph_flags & CEPH_I_ASYNC_CHECK_CAPS ) {
545+ ci -> i_ceph_flags &= ~CEPH_I_ASYNC_CHECK_CAPS ;
546+ check_cap = true;
547+ }
542548 }
543549 ceph_kick_flushing_inode_caps (session , ci );
544550 spin_unlock (& ci -> i_ceph_lock );
551+
552+ if (check_cap )
553+ ceph_check_caps (ci , CHECK_CAPS_FLUSH );
545554}
546555
547556static void ceph_async_create_cb (struct ceph_mds_client * mdsc ,
Original file line number Diff line number Diff line change @@ -593,6 +593,8 @@ static inline struct inode *ceph_find_inode(struct super_block *sb,
593593#define CEPH_ASYNC_CREATE_BIT (12) /* async create in flight for this */
594594#define CEPH_I_ASYNC_CREATE (1 << CEPH_ASYNC_CREATE_BIT)
595595#define CEPH_I_SHUTDOWN (1 << 13) /* inode is no longer usable */
596+ #define CEPH_I_ASYNC_CHECK_CAPS (1 << 14) /* check caps immediately after async
597+ creating finishes */
596598
597599/*
598600 * Masks of ceph inode work.
You can’t perform that action at this time.
0 commit comments