linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Mahoney <jeffm@suse.com>
To: linux-xfs@vger.kernel.org
Subject: [PATCH] xfs: clear di_forkoff on ialloc
Date: Wed, 5 Oct 2016 13:04:04 -0400	[thread overview]
Message-ID: <bb3e00eb-7334-1ac5-509f-89804583e9ff@suse.com> (raw)

Commit 6dfe5a049f2 (xfs: xfs_attr_inactive leaves inconsistent
attr fork state behind) fixed an issue where an inconsistent
attr fork count persisted on disk if there was concurrent inode
writeback happening after the inode was evicted from the VFS layer.

If one of those inodes landed on disk and was reused, it may have
an invalid di_forkoff, which can cause problems when trying to add
new extended attributes.  Since we clear the rest of the attribute
fork values on ialloc, let's clear di_forkoff as well and ensure the
invalid value won't be encountered.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
---
 fs/xfs/xfs_inode.c |    1 +
 1 file changed, 1 insertion(+)

--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -835,6 +835,7 @@ xfs_ialloc(
 	 */
 	ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS;
 	ip->i_d.di_anextents = 0;
+	ip->i_d.di_forkoff = 0;
 
 	/*
 	 * Log the new values stuffed into the inode.

-- 
Jeff Mahoney
SUSE Labs

             reply	other threads:[~2016-10-05 17:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-05 17:04 Jeff Mahoney [this message]
2016-10-05 20:52 ` [PATCH] xfs: clear di_forkoff on ialloc Dave Chinner
2017-06-29 22:34 ` Eric Sandeen
2017-06-29 22:41   ` Eric Sandeen

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=bb3e00eb-7334-1ac5-509f-89804583e9ff@suse.com \
    --to=jeffm@suse.com \
    --cc=linux-xfs@vger.kernel.org \
    /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).