ceph: shut down access to inode when async create fails
[platform/kernel/linux-rpi.git] / fs / ceph / locks.c
index bdeb271..74c227d 100644 (file)
@@ -241,6 +241,9 @@ int ceph_lock(struct file *file, int cmd, struct file_lock *fl)
        if (!(fl->fl_flags & FL_POSIX))
                return -ENOLCK;
 
+       if (ceph_inode_is_shutdown(inode))
+               return -ESTALE;
+
        dout("ceph_lock, fl_owner: %p\n", fl->fl_owner);
 
        /* set wait bit as appropriate, then make command as Ceph expects it*/
@@ -306,6 +309,9 @@ int ceph_flock(struct file *file, int cmd, struct file_lock *fl)
        if (fl->fl_type & LOCK_MAND)
                return -EOPNOTSUPP;
 
+       if (ceph_inode_is_shutdown(inode))
+               return -ESTALE;
+
        dout("ceph_flock, fl_file: %p\n", fl->fl_file);
 
        spin_lock(&ci->i_ceph_lock);