From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] [GFS2 Patch] GFS2: fsck.gfs2 finds unlinked inodes on full file systems
Date: Thu, 05 Jan 2012 10:39:37 +0000 [thread overview]
Message-ID: <1325759977.2690.11.camel@menhir> (raw)
In-Reply-To: <8d1388e7-3670-4551-8868-96725496d8c0@zmail16.collab.prod.int.phx2.redhat.com>
Hi,
This doesn't compile....
CC [M] fs/gfs2/inode.o
fs/gfs2/inode.c: In function ?gfs2_create_inode?:
fs/gfs2/inode.c:741:2: error: implicit declaration of function
?gfs2_dinode_dealloc?
make[2]: *** [fs/gfs2/inode.o] Error 1
make[1]: *** [fs/gfs2] Error 2
make: *** [fs] Error 2
Steve.
On Wed, 2012-01-04 at 09:06 -0500, Bob Peterson wrote:
> Hi,
>
> This patch fixes a problem whereby GFS2 does not properly clean
> up partially created files when the file system becomes too full.
>
> Regards,
>
> Bob Peterson
> Red Hat File Systems
>
> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
> --
> GFS2: fsck.gfs2 finds unlinked inodes on full file systems
>
> In some cases, when a GFS2 file system was nearly full, GFS2
> was able to allocate a block for a new file's dinode but not
> a second block for linking that new dinode to a directory.
> In these cases, GFS2 was not properly deallocating the partially-
> created file. Thus, subsequent runs of fsck.gfs2 found unlinked
> files. This patch adds a an extra cleanup path to the dinode
> create function to properly deallocate the partially-created file.
>
> diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
> index cb81898..bc81c9d 100644
> --- a/fs/gfs2/inode.c
> +++ b/fs/gfs2/inode.c
> @@ -708,19 +708,19 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
>
> error = gfs2_inode_refresh(GFS2_I(inode));
> if (error)
> - goto fail_gunlock2;
> + goto fail_dealloc;
>
> error = gfs2_acl_create(dip, inode);
> if (error)
> - goto fail_gunlock2;
> + goto fail_dealloc;
>
> error = gfs2_security_init(dip, GFS2_I(inode), name);
> if (error)
> - goto fail_gunlock2;
> + goto fail_dealloc;
>
> error = link_dinode(dip, name, GFS2_I(inode));
> if (error)
> - goto fail_gunlock2;
> + goto fail_dealloc;
>
> if (bh)
> brelse(bh);
> @@ -737,6 +737,8 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
> d_instantiate(dentry, inode);
> return 0;
>
> +fail_dealloc:
> + gfs2_dinode_dealloc(GFS2_I(inode));
> fail_gunlock2:
> gfs2_glock_dq_uninit(ghs + 1);
> fail_gunlock:
>
next prev parent reply other threads:[~2012-01-05 10:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5d3809ab-68d1-429d-9c89-24467729eaf8@zmail16.collab.prod.int.phx2.redhat.com>
2012-01-04 14:06 ` [Cluster-devel] [GFS2 Patch] GFS2: fsck.gfs2 finds unlinked inodes on full file systems Bob Peterson
2012-01-05 10:39 ` Steven Whitehouse [this message]
2012-01-05 14:57 ` Bob Peterson
2012-01-05 15:32 ` Steven Whitehouse
2012-01-05 19:53 ` Bob Peterson
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=1325759977.2690.11.camel@menhir \
--to=swhiteho@redhat.com \
/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).