diff options
author | Chengguang Xu <cgxu519@gmx.com> | 2018-07-09 10:17:30 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2018-08-02 15:26:12 -0400 |
commit | 0459871c4995d0bd57d6b1694f0971ec5cabafc1 (patch) | |
tree | 23079381371f924e08f306b7a16d46cb72a46e77 | |
parent | 61ad36d47dd273b7b8c3d63fc8359d96f7976c79 (diff) |
ceph: add d_drop for some error cases in ceph_mknod()
When file num exceeds quota limit or fails from ceph_per_init_acls()
should call d_drop to drop dentry from cache as well.
Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
-rw-r--r-- | fs/ceph/dir.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 036ac0f3a393..4b6a49fd2a61 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
@@ -827,12 +827,14 @@ static int ceph_mknod(struct inode *dir, struct dentry *dentry, | |||
827 | if (ceph_snap(dir) != CEPH_NOSNAP) | 827 | if (ceph_snap(dir) != CEPH_NOSNAP) |
828 | return -EROFS; | 828 | return -EROFS; |
829 | 829 | ||
830 | if (ceph_quota_is_max_files_exceeded(dir)) | 830 | if (ceph_quota_is_max_files_exceeded(dir)) { |
831 | return -EDQUOT; | 831 | err = -EDQUOT; |
832 | goto out; | ||
833 | } | ||
832 | 834 | ||
833 | err = ceph_pre_init_acls(dir, &mode, &acls); | 835 | err = ceph_pre_init_acls(dir, &mode, &acls); |
834 | if (err < 0) | 836 | if (err < 0) |
835 | return err; | 837 | goto out; |
836 | 838 | ||
837 | dout("mknod in dir %p dentry %p mode 0%ho rdev %d\n", | 839 | dout("mknod in dir %p dentry %p mode 0%ho rdev %d\n", |
838 | dir, dentry, mode, rdev); | 840 | dir, dentry, mode, rdev); |