diff options
-rw-r--r-- | fs/ubifs/xattr.c | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/fs/ubifs/xattr.c b/fs/ubifs/xattr.c index 61afdfee4b28..f5ad1ede7990 100644 --- a/fs/ubifs/xattr.c +++ b/fs/ubifs/xattr.c | |||
@@ -152,12 +152,6 @@ static int create_xattr(struct ubifs_info *c, struct inode *host, | |||
152 | ui->data_len = size; | 152 | ui->data_len = size; |
153 | 153 | ||
154 | mutex_lock(&host_ui->ui_mutex); | 154 | mutex_lock(&host_ui->ui_mutex); |
155 | |||
156 | if (!host->i_nlink) { | ||
157 | err = -ENOENT; | ||
158 | goto out_noent; | ||
159 | } | ||
160 | |||
161 | host->i_ctime = current_time(host); | 155 | host->i_ctime = current_time(host); |
162 | host_ui->xattr_cnt += 1; | 156 | host_ui->xattr_cnt += 1; |
163 | host_ui->xattr_size += CALC_DENT_SIZE(fname_len(nm)); | 157 | host_ui->xattr_size += CALC_DENT_SIZE(fname_len(nm)); |
@@ -190,7 +184,6 @@ out_cancel: | |||
190 | host_ui->xattr_size -= CALC_XATTR_BYTES(size); | 184 | host_ui->xattr_size -= CALC_XATTR_BYTES(size); |
191 | host_ui->xattr_names -= fname_len(nm); | 185 | host_ui->xattr_names -= fname_len(nm); |
192 | host_ui->flags &= ~UBIFS_CRYPT_FL; | 186 | host_ui->flags &= ~UBIFS_CRYPT_FL; |
193 | out_noent: | ||
194 | mutex_unlock(&host_ui->ui_mutex); | 187 | mutex_unlock(&host_ui->ui_mutex); |
195 | out_free: | 188 | out_free: |
196 | make_bad_inode(inode); | 189 | make_bad_inode(inode); |
@@ -242,12 +235,6 @@ static int change_xattr(struct ubifs_info *c, struct inode *host, | |||
242 | mutex_unlock(&ui->ui_mutex); | 235 | mutex_unlock(&ui->ui_mutex); |
243 | 236 | ||
244 | mutex_lock(&host_ui->ui_mutex); | 237 | mutex_lock(&host_ui->ui_mutex); |
245 | |||
246 | if (!host->i_nlink) { | ||
247 | err = -ENOENT; | ||
248 | goto out_noent; | ||
249 | } | ||
250 | |||
251 | host->i_ctime = current_time(host); | 238 | host->i_ctime = current_time(host); |
252 | host_ui->xattr_size -= CALC_XATTR_BYTES(old_size); | 239 | host_ui->xattr_size -= CALC_XATTR_BYTES(old_size); |
253 | host_ui->xattr_size += CALC_XATTR_BYTES(size); | 240 | host_ui->xattr_size += CALC_XATTR_BYTES(size); |
@@ -269,7 +256,6 @@ static int change_xattr(struct ubifs_info *c, struct inode *host, | |||
269 | out_cancel: | 256 | out_cancel: |
270 | host_ui->xattr_size -= CALC_XATTR_BYTES(size); | 257 | host_ui->xattr_size -= CALC_XATTR_BYTES(size); |
271 | host_ui->xattr_size += CALC_XATTR_BYTES(old_size); | 258 | host_ui->xattr_size += CALC_XATTR_BYTES(old_size); |
272 | out_noent: | ||
273 | mutex_unlock(&host_ui->ui_mutex); | 259 | mutex_unlock(&host_ui->ui_mutex); |
274 | make_bad_inode(inode); | 260 | make_bad_inode(inode); |
275 | out_free: | 261 | out_free: |
@@ -496,12 +482,6 @@ static int remove_xattr(struct ubifs_info *c, struct inode *host, | |||
496 | return err; | 482 | return err; |
497 | 483 | ||
498 | mutex_lock(&host_ui->ui_mutex); | 484 | mutex_lock(&host_ui->ui_mutex); |
499 | |||
500 | if (!host->i_nlink) { | ||
501 | err = -ENOENT; | ||
502 | goto out_noent; | ||
503 | } | ||
504 | |||
505 | host->i_ctime = current_time(host); | 485 | host->i_ctime = current_time(host); |
506 | host_ui->xattr_cnt -= 1; | 486 | host_ui->xattr_cnt -= 1; |
507 | host_ui->xattr_size -= CALC_DENT_SIZE(fname_len(nm)); | 487 | host_ui->xattr_size -= CALC_DENT_SIZE(fname_len(nm)); |
@@ -521,7 +501,6 @@ out_cancel: | |||
521 | host_ui->xattr_size += CALC_DENT_SIZE(fname_len(nm)); | 501 | host_ui->xattr_size += CALC_DENT_SIZE(fname_len(nm)); |
522 | host_ui->xattr_size += CALC_XATTR_BYTES(ui->data_len); | 502 | host_ui->xattr_size += CALC_XATTR_BYTES(ui->data_len); |
523 | host_ui->xattr_names += fname_len(nm); | 503 | host_ui->xattr_names += fname_len(nm); |
524 | out_noent: | ||
525 | mutex_unlock(&host_ui->ui_mutex); | 504 | mutex_unlock(&host_ui->ui_mutex); |
526 | ubifs_release_budget(c, &req); | 505 | ubifs_release_budget(c, &req); |
527 | make_bad_inode(inode); | 506 | make_bad_inode(inode); |
@@ -561,9 +540,6 @@ static int ubifs_xattr_remove(struct inode *host, const char *name) | |||
561 | 540 | ||
562 | ubifs_assert(c, inode_is_locked(host)); | 541 | ubifs_assert(c, inode_is_locked(host)); |
563 | 542 | ||
564 | if (!host->i_nlink) | ||
565 | return -ENOENT; | ||
566 | |||
567 | if (fname_len(&nm) > UBIFS_MAX_NLEN) | 543 | if (fname_len(&nm) > UBIFS_MAX_NLEN) |
568 | return -ENAMETOOLONG; | 544 | return -ENAMETOOLONG; |
569 | 545 | ||