mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hugh@veritas.com>
To: Andrew Morton <akpm@osdl.org>
Cc: "Theodore Ts'o" <tytso@mit.edu>, linux-kernel@vger.kernel.org
Subject: Re: [patch 7/8] inode-diet: Use a union for i_blocks and i_size, i_rdev and i_devices
Date: Mon, 3 Jul 2006 15:35:17 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0607031518170.6960@blonde.wat.veritas.com> (raw)
In-Reply-To: <20060703012711.1bbf3af8.akpm@osdl.org>

On Mon, 3 Jul 2006, Andrew Morton wrote:
> On Sun, 02 Jul 2006 20:53:40 -0400
> "Theodore Ts'o" <tytso@mit.edu> wrote:
> 
> > The i_blocks and i_size fields are only used for regular files.  So we
> > move them into the union, along with i_rdev and i_devices, which are
> > only used by block or character devices.
> 
> It appears that device nodes in tmpfs tripped this up.
> kernel BUG at mm/shmem.c:693!
> EIP is at shmem_delete_inode+0x89/0xa4

I'm happy for you to resolve that by moving the tmpfs BUG_ON up into
the truncation block just above it, patch below.  But note that this
also covers the case of long symbolic links, and I think tmpfs is not
alone in using i_blocks with long symbolic links; and would some file-
systems also use it with directories?  Looks to me like there's more
auditing needed before putting i_blocks into a union (and it might
help if we delete those many lines initializing i_blocks to 0:
they're probably done before the union diverges, but worrysome).

Hugh

--- 2.6.17-mm6/mm/shmem.c	2006-07-03 12:23:59.000000000 +0100
+++ linux/mm/shmem.c	2006-07-03 15:17:19.000000000 +0100
@@ -689,8 +689,8 @@ static void shmem_delete_inode(struct in
 			list_del_init(&info->swaplist);
 			spin_unlock(&shmem_swaplist_lock);
 		}
+		BUG_ON(inode->i_blocks);
 	}
-	BUG_ON(inode->i_blocks);
 	if (sbinfo->max_inodes) {
 		spin_lock(&sbinfo->stat_lock);
 		sbinfo->free_inodes++;

  reply	other threads:[~2006-07-03 14:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-03  0:53 [patch 0/8] Inode slimming patches, part 1 Theodore Ts'o
2006-07-03  0:53 ` [patch 1/8] inode_diet: Replace inode.u.generic_ip with inode.i_private Theodore Ts'o
2006-07-03  0:53 ` [patch 2/8] inode-diet: Move i_pipe into a union Theodore Ts'o
2006-07-03  0:53 ` [patch 3/8] inode-diet: Move i_bdev " Theodore Ts'o
2006-07-03  0:53 ` [patch 4/8] inode-diet: Move i_cdev " Theodore Ts'o
2006-07-03  0:53 ` [patch 5/8] inode-diet: Eliminate i_blksize and use a per-superblock default Theodore Ts'o
2006-07-03  0:53 ` [patch 6/8] inode-diet: Move i_cindex from struct inode to struct file Theodore Ts'o
2006-07-03  9:05   ` Christoph Hellwig
2006-07-03 14:05     ` Theodore Tso
2006-07-03  0:53 ` [patch 7/8] inode-diet: Use a union for i_blocks and i_size, i_rdev and i_devices Theodore Ts'o
2006-07-03  8:27   ` Andrew Morton
2006-07-03 14:35     ` Hugh Dickins [this message]
2006-07-03  9:06   ` Christoph Hellwig
2006-07-03 14:02     ` Theodore Tso
2006-07-03 14:42       ` Jan Engelhardt
2006-07-03 15:18       ` H. Peter Anvin
2006-07-03  0:53 ` [patch 8/8] inode-diet: Fix size of i_blkbits, i_version, and i_dnotify_mask Theodore Ts'o

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=Pine.LNX.4.64.0607031518170.6960@blonde.wat.veritas.com \
    --to=hugh@veritas.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /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

all inboxes | Powered by JetHome®