From: Christoph Hellwig <hch@lst.de>
To: mikulas@artax.karlin.mff.cuni.cz
Cc: linux-fsdevel@vger.kernel.org
Subject: [PATCH] hpfs: remove ENOSPC hack in unlink
Date: Thu, 20 Apr 2006 20:31:49 +0200 [thread overview]
Message-ID: <20060420183149.GA6479@lst.de> (raw)
don't try odd hacks on ENOSPC, just fail it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/fs/hpfs/namei.c
===================================================================
--- linux-2.6.orig/fs/hpfs/namei.c 2006-03-24 20:20:00.000000000 +0100
+++ linux-2.6/fs/hpfs/namei.c 2006-04-20 20:29:07.000000000 +0200
@@ -376,12 +376,10 @@
dnode_secno dno;
fnode_secno fno;
int r;
- int rep = 0;
int err;
lock_kernel();
hpfs_adjust_length((char *)name, &len);
-again:
mutex_lock(&hpfs_i(inode)->i_parent_mutex);
mutex_lock(&hpfs_i(dir)->i_mutex);
err = -ENOENT;
@@ -404,35 +402,9 @@
hpfs_error(dir->i_sb, "there was error when removing dirent");
err = -EFSERROR;
break;
- case 2: /* no space for deleting, try to truncate file */
-
+ case 2: /* no space for deleting */
err = -ENOSPC;
- if (rep++)
- break;
-
- mutex_unlock(&hpfs_i(dir)->i_mutex);
- mutex_unlock(&hpfs_i(inode)->i_parent_mutex);
- d_drop(dentry);
- spin_lock(&dentry->d_lock);
- if (atomic_read(&dentry->d_count) > 1 ||
- permission(inode, MAY_WRITE, NULL) ||
- !S_ISREG(inode->i_mode) ||
- get_write_access(inode)) {
- spin_unlock(&dentry->d_lock);
- d_rehash(dentry);
- } else {
- struct iattr newattrs;
- spin_unlock(&dentry->d_lock);
- /*printk("HPFS: truncating file before delete.\n");*/
- newattrs.ia_size = 0;
- newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
- err = notify_change(dentry, &newattrs);
- put_write_access(inode);
- if (!err)
- goto again;
- }
- unlock_kernel();
- return -ENOSPC;
+ break;
default:
inode->i_nlink--;
err = 0;
next reply other threads:[~2006-04-20 18:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-20 18:31 Christoph Hellwig [this message]
2006-04-20 18:39 ` [PATCH] hpfs: remove ENOSPC hack in unlink Al Viro
2006-04-22 19:45 ` Mikulas Patocka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060420183149.GA6479@lst.de \
--to=hch@lst.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=mikulas@artax.karlin.mff.cuni.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).