Re: [PATCH] ext4: take i_mutex in ext4_symlink to eliminate a warning from ext4_truncate

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

 



I looked more closely at the assumption that ext4_write_begin() holds
i_mutex.  This is guaranteed by Documentation/filesystems/Locking,
which notes that write_begin() and write_end() functions hold i_mutex:

			PageLocked(page)	i_mutex
write_begin:		locks the page		yes
write_end:		yes, unlocks		yes

So the bug is that ext4_symlink() calls __page_symlink();
__page_symlink() calls pagecache_write_begin() which calls
write_begin(), without taking i_mutex.

So we can fix this by taking i_mutex in ext4_symlink(), but I think it
would be better to take the i_mutex in __page_symlink(), since it
would then address a violation of the locking rules for all file
systems.

Al, do you agree?

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




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux