+ mm-only-i_size_write-debugging-fix.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     Fix spurious warning in i_size_write

has been added to the -mm tree.  Its filename is

     mm-only-i_size_write-debugging-fix.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: Fix spurious warning in i_size_write
From: Jiri Kosina <jikos@xxxxxxxx>

i_size_write() can be legitimately called without inode->i_mutex locked. 
This is OK in cases when the inode has not been yet linked into the parent
dentry, so no race condition on i_size can occur.

Signed-off-by: Jiri Kosina <jikos@xxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/inode.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -puN fs/inode.c~mm-only-i_size_write-debugging-fix fs/inode.c
--- a/fs/inode.c~mm-only-i_size_write-debugging-fix
+++ a/fs/inode.c
@@ -1386,7 +1386,9 @@ void __init inode_init(unsigned long mem
 
 void i_size_write(struct inode *inode, loff_t i_size)
 {
-	WARN_ON_ONCE(!mutex_is_locked(&inode->i_mutex));
+	/* calling us without i_mutex is OK when not connected to dentry yet */
+	if (!list_empty(&inode->i_dentry))
+		WARN_ON_ONCE(!mutex_is_locked(&inode->i_mutex));
 #if BITS_PER_LONG==32 && defined(CONFIG_SMP)
 	write_seqcount_begin(&inode->i_size_seqcount);
 	inode->i_size = i_size;
_

Patches currently in -mm which might be from jikos@xxxxxxxx are

origin.patch
mm-only-i_size_write-debugging.patch
mm-only-i_size_write-debugging-fix.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux