* [PATCH 0/7] extent list locking fixes V2
@ 2013-12-06 16:48 Christoph Hellwig
2013-12-06 16:48 ` [PATCH 1/7] xfs: reinstate the ilock in xfs_readdir Christoph Hellwig
` (7 more replies)
0 siblings, 8 replies; 14+ messages in thread
From: Christoph Hellwig @ 2013-12-06 16:48 UTC (permalink / raw)
To: xfs
Fixed the review feedback, and includes Bens original patch for completeness.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 1/7] xfs: reinstate the ilock in xfs_readdir
2013-12-06 16:48 [PATCH 0/7] extent list locking fixes V2 Christoph Hellwig
@ 2013-12-06 16:48 ` Christoph Hellwig
2013-12-06 16:53 ` Christoph Hellwig
2013-12-06 16:48 ` [PATCH 2/7] xfs: take the ilock around xfs_bmapi_read in xfs_zero_remaining_bytes Christoph Hellwig
` (6 subsequent siblings)
7 siblings, 1 reply; 14+ messages in thread
From: Christoph Hellwig @ 2013-12-06 16:48 UTC (permalink / raw)
To: xfs; +Cc: Ben Myers
[-- Attachment #1: iolock.diff --]
[-- Type: text/plain, Size: 1760 bytes --]
Although it was removed in commit 051e7cd44ab8, ilock needs to be taken in
xfs_readdir because we might have to read the extent list in from disk. This
keeps other threads from reading from or writing to the extent list while it is
being read in and is still in a transitional state.
This has been associated with "Access to block zero" messages on directories
with large numbers of extents resulting from excessive filesytem fragmentation,
as well as extent list corruption. Unfortunately no test case at this point.
Signed-off-by: Ben Myers <bpm@sgi.com>
---
fs/xfs/xfs_dir2_readdir.c | 4 ++++
1 file changed, 4 insertions(+)
Index: b/fs/xfs/xfs_dir2_readdir.c
===================================================================
--- a/fs/xfs/xfs_dir2_readdir.c 2013-12-02 17:40:38.895185673 -0600
+++ b/fs/xfs/xfs_dir2_readdir.c 2013-12-02 17:40:49.025225554 -0600
@@ -674,6 +674,7 @@ xfs_readdir(
{
int rval; /* return value */
int v; /* type-checking value */
+ uint lock_mode;
trace_xfs_readdir(dp);
@@ -683,6 +684,7 @@ xfs_readdir(
ASSERT(S_ISDIR(dp->i_d.di_mode));
XFS_STATS_INC(xs_dir_getdents);
+ lock_mode = xfs_ilock_map_shared(dp);
if (dp->i_d.di_format == XFS_DINODE_FMT_LOCAL)
rval = xfs_dir2_sf_getdents(dp, ctx);
else if ((rval = xfs_dir2_isblock(NULL, dp, &v)))
@@ -691,5 +693,7 @@ xfs_readdir(
rval = xfs_dir2_block_getdents(dp, ctx);
else
rval = xfs_dir2_leaf_getdents(dp, ctx, bufsize);
+ xfs_iunlock_map_shared(dp, lock_mode);
+
return rval;
}
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 2/7] xfs: take the ilock around xfs_bmapi_read in xfs_zero_remaining_bytes
2013-12-06 16:48 [PATCH 0/7] extent list locking fixes V2 Christoph Hellwig
2013-12-06 16:48 ` [PATCH 1/7] xfs: reinstate the ilock in xfs_readdir Christoph Hellwig
@ 2013-12-06 16:48 ` Christoph Hellwig
2013-12-06 16:48 ` [PATCH 3/7] xfs: use xfs_ilock_map_shared in xfs_qm_dqtobp Christoph Hellwig
` (5 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2013-12-06 16:48 UTC (permalink / raw)
To: xfs
[-- Attachment #1: xfs_zero_remaining_bytes-locking --]
[-- Type: text/plain, Size: 857 bytes --]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: xfs/fs/xfs/xfs_bmap_util.c
===================================================================
--- xfs.orig/fs/xfs/xfs_bmap_util.c 2013-12-05 22:08:41.087843028 +0100
+++ xfs/fs/xfs/xfs_bmap_util.c 2013-12-05 22:13:56.187836562 +0100
@@ -1168,9 +1168,15 @@ xfs_zero_remaining_bytes(
xfs_buf_unlock(bp);
for (offset = startoff; offset <= endoff; offset = lastoffset + 1) {
+ uint lock_mode;
+
offset_fsb = XFS_B_TO_FSBT(mp, offset);
nimap = 1;
+
+ lock_mode = xfs_ilock_map_shared(ip);
error = xfs_bmapi_read(ip, offset_fsb, 1, &imap, &nimap, 0);
+ xfs_iunlock_map_shared(ip, lock_mode);
+
if (error || nimap < 1)
break;
ASSERT(imap.br_blockcount >= 1);
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 3/7] xfs: use xfs_ilock_map_shared in xfs_qm_dqtobp
2013-12-06 16:48 [PATCH 0/7] extent list locking fixes V2 Christoph Hellwig
2013-12-06 16:48 ` [PATCH 1/7] xfs: reinstate the ilock in xfs_readdir Christoph Hellwig
2013-12-06 16:48 ` [PATCH 2/7] xfs: take the ilock around xfs_bmapi_read in xfs_zero_remaining_bytes Christoph Hellwig
@ 2013-12-06 16:48 ` Christoph Hellwig
2013-12-06 16:48 ` [PATCH 4/7] xfs: use xfs_ilock_map_shared in xfs_qm_dqiterate Christoph Hellwig
` (4 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2013-12-06 16:48 UTC (permalink / raw)
To: xfs
[-- Attachment #1: xfs-quota-locking --]
[-- Type: text/plain, Size: 1417 bytes --]
We might not have read in the extent list at this point, so make sure we
take the ilock exclusively if we have to do so.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: xfs/fs/xfs/xfs_dquot.c
===================================================================
--- xfs.orig/fs/xfs/xfs_dquot.c 2013-11-18 14:39:01.955589999 +0100
+++ xfs/fs/xfs/xfs_dquot.c 2013-12-05 11:42:34.759679600 +0100
@@ -469,16 +469,17 @@ xfs_qm_dqtobp(
struct xfs_mount *mp = dqp->q_mount;
xfs_dqid_t id = be32_to_cpu(dqp->q_core.d_id);
struct xfs_trans *tp = (tpp ? *tpp : NULL);
+ uint lock_mode;
dqp->q_fileoffset = (xfs_fileoff_t)id / mp->m_quotainfo->qi_dqperchunk;
- xfs_ilock(quotip, XFS_ILOCK_SHARED);
+ lock_mode = xfs_ilock_map_shared(quotip);
if (!xfs_this_quota_on(dqp->q_mount, dqp->dq_flags)) {
/*
* Return if this type of quotas is turned off while we
* didn't have the quota inode lock.
*/
- xfs_iunlock(quotip, XFS_ILOCK_SHARED);
+ xfs_iunlock_map_shared(quotip, lock_mode);
return ESRCH;
}
@@ -488,7 +489,7 @@ xfs_qm_dqtobp(
error = xfs_bmapi_read(quotip, dqp->q_fileoffset,
XFS_DQUOT_CLUSTER_SIZE_FSB, &map, &nmaps, 0);
- xfs_iunlock(quotip, XFS_ILOCK_SHARED);
+ xfs_iunlock_map_shared(quotip, lock_mode);
if (error)
return error;
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 4/7] xfs: use xfs_ilock_map_shared in xfs_qm_dqiterate
2013-12-06 16:48 [PATCH 0/7] extent list locking fixes V2 Christoph Hellwig
` (2 preceding siblings ...)
2013-12-06 16:48 ` [PATCH 3/7] xfs: use xfs_ilock_map_shared in xfs_qm_dqtobp Christoph Hellwig
@ 2013-12-06 16:48 ` Christoph Hellwig
2013-12-06 16:48 ` [PATCH 5/7] xfs: use xfs_ilock_map_shared in xfs_attr_get Christoph Hellwig
` (3 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2013-12-06 16:48 UTC (permalink / raw)
To: xfs
[-- Attachment #1: xfs-quota-locking-2 --]
[-- Type: text/plain, Size: 1142 bytes --]
We might not have read in the extent list at this point, so make sure we
take the ilock exclusively if we have to do so.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: xfs/fs/xfs/xfs_qm.c
===================================================================
--- xfs.orig/fs/xfs/xfs_qm.c 2013-11-18 14:39:01.967589998 +0100
+++ xfs/fs/xfs/xfs_qm.c 2013-12-05 12:32:36.623617997 +0100
@@ -1193,16 +1193,18 @@ xfs_qm_dqiterate(
lblkno = 0;
maxlblkcnt = XFS_B_TO_FSB(mp, mp->m_super->s_maxbytes);
do {
+ uint lock_mode;
+
nmaps = XFS_DQITER_MAP_SIZE;
/*
* We aren't changing the inode itself. Just changing
* some of its data. No new blocks are added here, and
* the inode is never added to the transaction.
*/
- xfs_ilock(qip, XFS_ILOCK_SHARED);
+ lock_mode = xfs_ilock_map_shared(qip);
error = xfs_bmapi_read(qip, lblkno, maxlblkcnt - lblkno,
map, &nmaps, 0);
- xfs_iunlock(qip, XFS_ILOCK_SHARED);
+ xfs_iunlock_map_shared(qip, lock_mode);
if (error)
break;
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 5/7] xfs: use xfs_ilock_map_shared in xfs_attr_get
2013-12-06 16:48 [PATCH 0/7] extent list locking fixes V2 Christoph Hellwig
` (3 preceding siblings ...)
2013-12-06 16:48 ` [PATCH 4/7] xfs: use xfs_ilock_map_shared in xfs_qm_dqiterate Christoph Hellwig
@ 2013-12-06 16:48 ` Christoph Hellwig
2013-12-06 16:48 ` [PATCH 6/7] xfs: use xfs_ilock_map_shared in xfs_attr_list_int Christoph Hellwig
` (2 subsequent siblings)
7 siblings, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2013-12-06 16:48 UTC (permalink / raw)
To: xfs
[-- Attachment #1: xfs-attr-locking --]
[-- Type: text/plain, Size: 952 bytes --]
We might not have read in the extent list at this point, so make sure we
take the ilock exclusively if we have to do so.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: xfs/fs/xfs/xfs_attr.c
===================================================================
--- xfs.orig/fs/xfs/xfs_attr.c 2013-12-05 22:19:26.087829792 +0100
+++ xfs/fs/xfs/xfs_attr.c 2013-12-05 22:23:54.307824288 +0100
@@ -164,6 +164,7 @@ xfs_attr_get(
{
int error;
struct xfs_name xname;
+ uint lock_mode;
XFS_STATS_INC(xs_attr_get);
@@ -174,9 +175,9 @@ xfs_attr_get(
if (error)
return error;
- xfs_ilock(ip, XFS_ILOCK_SHARED);
+ lock_mode = xfs_ilock_map_shared(ip);
error = xfs_attr_get_int(ip, &xname, value, valuelenp, flags);
- xfs_iunlock(ip, XFS_ILOCK_SHARED);
+ xfs_iunlock_map_shared(ip, lock_mode);
return(error);
}
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 6/7] xfs: use xfs_ilock_map_shared in xfs_attr_list_int
2013-12-06 16:48 [PATCH 0/7] extent list locking fixes V2 Christoph Hellwig
` (4 preceding siblings ...)
2013-12-06 16:48 ` [PATCH 5/7] xfs: use xfs_ilock_map_shared in xfs_attr_get Christoph Hellwig
@ 2013-12-06 16:48 ` Christoph Hellwig
2013-12-06 16:48 ` [PATCH 7/7] xfs: assert that we hold the ilock for extent map access Christoph Hellwig
2013-12-06 17:37 ` [PATCH 0/7] extent list locking fixes V2 Ben Myers
7 siblings, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2013-12-06 16:48 UTC (permalink / raw)
To: xfs
[-- Attachment #1: xfs-attr-locking-2 --]
[-- Type: text/plain, Size: 1190 bytes --]
We might not have read in the extent list at this point, so make sure we
take the ilock exclusively if we have to do so.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: xfs/fs/xfs/xfs_attr_list.c
===================================================================
--- xfs.orig/fs/xfs/xfs_attr_list.c 2013-11-18 14:39:01.947589999 +0100
+++ xfs/fs/xfs/xfs_attr_list.c 2013-12-05 22:25:47.207821971 +0100
@@ -507,17 +507,17 @@ xfs_attr_list_int(
{
int error;
xfs_inode_t *dp = context->dp;
+ uint lock_mode;
XFS_STATS_INC(xs_attr_list);
if (XFS_FORCED_SHUTDOWN(dp->i_mount))
return EIO;
- xfs_ilock(dp, XFS_ILOCK_SHARED);
-
/*
* Decide on what work routines to call based on the inode size.
*/
+ lock_mode = xfs_ilock_map_shared(dp);
if (!xfs_inode_hasattr(dp)) {
error = 0;
} else if (dp->i_d.di_aformat == XFS_DINODE_FMT_LOCAL) {
@@ -527,9 +527,7 @@ xfs_attr_list_int(
} else {
error = xfs_attr_node_list(context);
}
-
- xfs_iunlock(dp, XFS_ILOCK_SHARED);
-
+ xfs_iunlock_map_shared(dp, lock_mode);
return error;
}
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH 7/7] xfs: assert that we hold the ilock for extent map access
2013-12-06 16:48 [PATCH 0/7] extent list locking fixes V2 Christoph Hellwig
` (5 preceding siblings ...)
2013-12-06 16:48 ` [PATCH 6/7] xfs: use xfs_ilock_map_shared in xfs_attr_list_int Christoph Hellwig
@ 2013-12-06 16:48 ` Christoph Hellwig
2013-12-06 17:37 ` [PATCH 0/7] extent list locking fixes V2 Ben Myers
7 siblings, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2013-12-06 16:48 UTC (permalink / raw)
To: xfs
[-- Attachment #1: iread_extents-assert --]
[-- Type: text/plain, Size: 2410 bytes --]
Make sure that xfs_bmapi_read has the ilock held in some way, and that
xfs_bmapi_write, xfs_bmapi_delay, xfs_bunmapi and xfs_iread_extents are
called with the ilock held exclusively.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: xfs/fs/xfs/xfs_bmap.c
===================================================================
--- xfs.orig/fs/xfs/xfs_bmap.c 2013-11-29 14:25:12.172459195 +0100
+++ xfs/fs/xfs/xfs_bmap.c 2013-12-05 10:03:28.243801633 +0100
@@ -3997,6 +3997,7 @@ xfs_bmapi_read(
ASSERT(*nmap >= 1);
ASSERT(!(flags & ~(XFS_BMAPI_ATTRFORK|XFS_BMAPI_ENTIRE|
XFS_BMAPI_IGSTATE)));
+ ASSERT(xfs_isilocked(ip, XFS_ILOCK_SHARED|XFS_ILOCK_EXCL));
if (unlikely(XFS_TEST_ERROR(
(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS &&
@@ -4191,6 +4192,7 @@ xfs_bmapi_delay(
ASSERT(*nmap >= 1);
ASSERT(*nmap <= XFS_BMAP_MAX_NMAP);
ASSERT(!(flags & ~XFS_BMAPI_ENTIRE));
+ ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
if (unlikely(XFS_TEST_ERROR(
(XFS_IFORK_FORMAT(ip, XFS_DATA_FORK) != XFS_DINODE_FMT_EXTENTS &&
@@ -4484,6 +4486,7 @@ xfs_bmapi_write(
ASSERT(tp != NULL);
ASSERT(len > 0);
ASSERT(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_LOCAL);
+ ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
if (unlikely(XFS_TEST_ERROR(
(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS &&
Index: xfs/fs/xfs/xfs_inode_fork.c
===================================================================
--- xfs.orig/fs/xfs/xfs_inode_fork.c 2013-12-05 09:57:24.347809100 +0100
+++ xfs/fs/xfs/xfs_inode_fork.c 2013-12-05 09:59:04.767807039 +0100
@@ -431,6 +431,8 @@ xfs_iread_extents(
xfs_ifork_t *ifp;
xfs_extnum_t nextents;
+ ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
+
if (unlikely(XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE)) {
XFS_ERROR_REPORT("xfs_iread_extents", XFS_ERRLEVEL_LOW,
ip->i_mount);
Index: xfs/fs/xfs/xfs_bmap.c
===================================================================
--- xfs.orig/fs/xfs/xfs_bmap.c 2013-12-05 22:12:32.931838271 +0100
+++ xfs/fs/xfs/xfs_bmap.c 2013-12-05 22:35:59.175809412 +0100
@@ -5038,6 +5038,7 @@ xfs_bunmapi(
if (XFS_FORCED_SHUTDOWN(mp))
return XFS_ERROR(EIO);
+ ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
ASSERT(len > 0);
ASSERT(nexts >= 0);
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/7] xfs: reinstate the ilock in xfs_readdir
2013-12-06 16:48 ` [PATCH 1/7] xfs: reinstate the ilock in xfs_readdir Christoph Hellwig
@ 2013-12-06 16:53 ` Christoph Hellwig
2013-12-06 17:37 ` Ben Myers
0 siblings, 1 reply; 14+ messages in thread
From: Christoph Hellwig @ 2013-12-06 16:53 UTC (permalink / raw)
To: xfs; +Cc: Ben Myers
Oops, looks like quilt didn't preserve the From: line for Ben. This
wasn't intentional.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 0/7] extent list locking fixes V2
2013-12-06 16:48 [PATCH 0/7] extent list locking fixes V2 Christoph Hellwig
` (6 preceding siblings ...)
2013-12-06 16:48 ` [PATCH 7/7] xfs: assert that we hold the ilock for extent map access Christoph Hellwig
@ 2013-12-06 17:37 ` Ben Myers
2013-12-06 17:54 ` Christoph Hellwig
7 siblings, 1 reply; 14+ messages in thread
From: Ben Myers @ 2013-12-06 17:37 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
Hey Christoph,
On Fri, Dec 06, 2013 at 08:48:19AM -0800, Christoph Hellwig wrote:
> Fixed the review feedback, and includes Bens original patch for completeness.
I ran your initial series overnight with xfstests... oddly I hit this:
[16304.656687] XFS: Assertion failed: xfs_isilocked(ip, XFS_ILOCK_EXCL), file: /root/xfs/fs/xfs/xfs_inode_fork.c, line: 434
[16304.668925] ------------[ cut here ]------------
[16304.674098] kernel BUG at /root/xfs/fs/xfs/xfs_message.c:107!
[16304.674102] invalid opcode: 0000 [#1] SMP
[16304.674151] Modules linked in: xfs(OF) ext2(F) dm_flakey(F) crc32c(F) libcrc32c(F) autofs4(F) cpufreq_conservative(F) cpufreq_userspace(F) cpufreq_powersave(F) microcode(F) fuse(F) loop(F) dm_mod(F) joydev(F) hid_generic(F) usbhid(F) hid(F) ehci_pci(F) ehci_hcd(F) iTCO_wdt(F) sg(F) igb(F) iTCO_vendor_support(F) isci(F) ipv6(F) ptp(F) usbcore(F) ioatdma(F) libsas(F) lpc_ich(F) pcspkr(F) i2c_i801(F) sr_mod(F) mptctl(F) pps_core(F) usb_common(F) mfd_core(F) dca(F) cdrom(F) wmi(F) rtc_cmos(F) acpi_cpufreq(F) button(F) mgag200(F) ttm(F) drm_kms_helper(F) drm(F) i2c_algo_bit(F) sysimgblt(F) sysfillrect(F) i2c_core(F) syscopyarea(F) sd_mod(F) crc_t10dif(F) crct10dif_common(F) mpt2sas(F)
raid_class(F) scsi_dh_emc(F) scsi_dh_rdac(F) scsi_dh_alua(F) scsi_dh_hp_sw(F) scsi_dh(F) thermal(F) sata_nv(F) processor(F) piix(F) mptsas(F) mptscsih(F) scsi_transport_sas(F) mptbase(F) megaraid_sas(F) ide_generic(F) ide_core(F) fan(F) thermal_sys(F) hwmon(F) ext3(F) jbd(F) mbcache(F) edd(F) ata_piix(F) ahci(F) libahci(F) libata(F) scsi_mod(F) [last unloaded: scsi_debug]
[16304.674172] CPU: 13 PID: 12264 Comm: fsstress Tainted: GF IO 3.13.0-rc2-0.9-default #28
[16304.674175] Hardware name: SGI.COM SUMMIT/S2600GZ, BIOS SE5C600.86B.01.06.0002.110120121539 11/01/2012
[16304.674183] task: ffff8807fd76c190 ti: ffff88082d02e000 task.ti: ffff88082d02e000
[16304.674231] RIP: 0010:[<ffffffffa072e2ed>] [<ffffffffa072e2ed>] assfail+0x1d/0x30 [xfs]
[16304.674233] RSP: 0018:ffff88082d02f9d8 EFLAGS: 00010296
[16304.674235] RAX: 000000000000006c RBX: 0000000000000001 RCX: 0000000000000000
[16304.674236] RDX: ffff88043faeed68 RSI: ffff88043faed248 RDI: ffff88043faed248
[16304.674238] RBP: ffff88082d02f9d8 R08: 0000000000001a0c R09: 000000000000000d
[16304.674239] R10: 0000000000001a0c R11: 0000000000000006 R12: ffff88042a7eb800
[16304.674240] R13: 0000000000000001 R14: ffff88082d02fb54 R15: 0000000000000000
[16304.674243] FS: 00007fda2ff4d700(0000) GS:ffff88043fae0000(0000) knlGS:0000000000000000
[16304.674245] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[16304.674246] CR2: 00007fda2f4a4b80 CR3: 000000082bf5e000 CR4: 00000000000407e0
[16304.674247] Stack:
[16304.674254] ffff88082d02fa18 ffffffffa077c4fe ffff88043ffd9d80 0000000000000001
[16304.674258] ffff88042a7eb800 ffff88042cd694f0 ffff88082d02fb54 0000000000000004
[16304.674263] ffff88082d02fad8 ffffffffa07471f4 0000000000000000 000000012d6ca940
[16304.674263] Call Trace:
[16304.674308] [<ffffffffa077c4fe>] xfs_iread_extents+0x4e/0x190 [xfs]
[16304.674346] [<ffffffffa07471f4>] xfs_bmapi_read+0x264/0x3f0 [xfs]
[16304.674383] [<ffffffffa075e601>] xfs_dabuf_map+0x281/0x300 [xfs]
[16304.674418] [<ffffffffa075e789>] xfs_da_read_buf+0x59/0x2d0 [xfs]
[16304.674427] [<ffffffff81160a55>] ? kmem_getpages+0xc5/0x170
[16304.674431] [<ffffffff81161cf1>] ? cache_grow+0x171/0x240
[16304.674462] [<ffffffffa075ea27>] xfs_da3_node_read+0x27/0xd0 [xfs]
[16304.674494] [<ffffffffa075fed6>] xfs_da3_node_lookup_int+0x86/0x420 [xfs]
[16304.674498] [<ffffffff81162bdb>] ? kmem_cache_alloc+0xbb/0x1f0
[16304.674532] [<ffffffffa0736dae>] ? kmem_zone_alloc+0x7e/0xf0 [xfs]
[16304.674565] [<ffffffffa073d1c8>] xfs_attr_node_get+0x78/0x170 [xfs]
[16304.674596] [<ffffffffa073ee34>] xfs_attr_get_int+0xb4/0x110 [xfs]
[16304.674626] [<ffffffffa073f108>] xfs_attr_get+0xa8/0xc0 [xfs]
[16304.674661] [<ffffffffa07a1577>] xfs_get_acl+0x137/0x1a0 [xfs]
[16304.674667] [<ffffffff8117d9c5>] check_acl+0x85/0x160
[16304.674671] [<ffffffff8117db25>] generic_permission+0x85/0x130
[16304.674676] [<ffffffff8117dc9c>] __inode_permission+0xcc/0xf0
[16304.674680] [<ffffffff8117dcfd>] inode_permission+0x3d/0x60
[16304.674684] [<ffffffff81170633>] SyS_chdir+0x43/0x100
[16304.674691] [<ffffffff814c4ce2>] system_call_fastpath+0x16/0x1b
[16304.674718] Code: 00 00 00 48 89 45 c8 e8 42 fc ff ff c9 c3 55 41 89 d0 48 89 f1 48 89 fa 48 c7 c6 f0 5c 7b a0 31 ff 48 89 e5 31 c0 e8 93 ff ff ff <0f> 0b eb fe 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 8b
[16304.674748] RIP [<ffffffffa072e2ed>] assfail+0x1d/0x30 [xfs]
[16304.674749] RSP <ffff88082d02f9d8>
[16304.724644] ---[ end trace eddfa0fb40bb8e11 ]---
...which shouldn't have been possible given the additional locking added
to xfs_attr_get. Maybe some PEBKAC or something.
-Ben
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 1/7] xfs: reinstate the ilock in xfs_readdir
2013-12-06 16:53 ` Christoph Hellwig
@ 2013-12-06 17:37 ` Ben Myers
0 siblings, 0 replies; 14+ messages in thread
From: Ben Myers @ 2013-12-06 17:37 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
On Fri, Dec 06, 2013 at 08:53:33AM -0800, Christoph Hellwig wrote:
> Oops, looks like quilt didn't preserve the From: line for Ben. This
> wasn't intentional.
No worries. ;)
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 0/7] extent list locking fixes V2
2013-12-06 17:37 ` [PATCH 0/7] extent list locking fixes V2 Ben Myers
@ 2013-12-06 17:54 ` Christoph Hellwig
2013-12-06 17:57 ` Ben Myers
0 siblings, 1 reply; 14+ messages in thread
From: Christoph Hellwig @ 2013-12-06 17:54 UTC (permalink / raw)
To: Ben Myers; +Cc: Christoph Hellwig, xfs
On Fri, Dec 06, 2013 at 11:37:29AM -0600, Ben Myers wrote:
> Hey Christoph,
>
> On Fri, Dec 06, 2013 at 08:48:19AM -0800, Christoph Hellwig wrote:
> > Fixed the review feedback, and includes Bens original patch for completeness.
>
> I ran your initial series overnight with xfstests... oddly I hit this:
I think I understand the problem:
uint
xfs_ilock_map_shared(
xfs_inode_t *ip)
{
uint lock_mode;
if ((ip->i_d.di_format == XFS_DINODE_FMT_BTREE) &&
((ip->i_df.if_flags & XFS_IFEXTENTS) == 0)) {
lock_mode = XFS_ILOCK_EXCL;
} else {
lock_mode = XFS_ILOCK_SHARED;
}
xfs_ilock(ip, lock_mode);
return lock_mode;
}
This only looks at the data fork, while we'd need to use it for the
fork we plan to operate on. Looks like we'll need some bigger surgery
this area.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 0/7] extent list locking fixes V2
2013-12-06 17:54 ` Christoph Hellwig
@ 2013-12-06 17:57 ` Ben Myers
2013-12-06 17:59 ` Christoph Hellwig
0 siblings, 1 reply; 14+ messages in thread
From: Ben Myers @ 2013-12-06 17:57 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: xfs
On Fri, Dec 06, 2013 at 09:54:44AM -0800, Christoph Hellwig wrote:
> On Fri, Dec 06, 2013 at 11:37:29AM -0600, Ben Myers wrote:
> > Hey Christoph,
> >
> > On Fri, Dec 06, 2013 at 08:48:19AM -0800, Christoph Hellwig wrote:
> > > Fixed the review feedback, and includes Bens original patch for completeness.
> >
> > I ran your initial series overnight with xfstests... oddly I hit this:
>
> I think I understand the problem:
>
> uint
> xfs_ilock_map_shared(
> xfs_inode_t *ip)
> {
> uint lock_mode;
>
> if ((ip->i_d.di_format == XFS_DINODE_FMT_BTREE) &&
> ((ip->i_df.if_flags & XFS_IFEXTENTS) == 0)) {
> lock_mode = XFS_ILOCK_EXCL;
> } else {
> lock_mode = XFS_ILOCK_SHARED;
> }
>
> xfs_ilock(ip, lock_mode);
> return lock_mode;
> }
>
> This only looks at the data fork, while we'd need to use it for the
> fork we plan to operate on. Looks like we'll need some bigger surgery
> this area.
Ah, that makes sense. Maybe just add a flags arg?
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH 0/7] extent list locking fixes V2
2013-12-06 17:57 ` Ben Myers
@ 2013-12-06 17:59 ` Christoph Hellwig
0 siblings, 0 replies; 14+ messages in thread
From: Christoph Hellwig @ 2013-12-06 17:59 UTC (permalink / raw)
To: Ben Myers; +Cc: Christoph Hellwig, xfs
On Fri, Dec 06, 2013 at 11:57:26AM -0600, Ben Myers wrote:
> > uint
> > xfs_ilock_map_shared(
> > xfs_inode_t *ip)
> > {
> > uint lock_mode;
> >
> > if ((ip->i_d.di_format == XFS_DINODE_FMT_BTREE) &&
> > ((ip->i_df.if_flags & XFS_IFEXTENTS) == 0)) {
> > lock_mode = XFS_ILOCK_EXCL;
> > } else {
> > lock_mode = XFS_ILOCK_SHARED;
> > }
> >
> > xfs_ilock(ip, lock_mode);
> > return lock_mode;
> > }
> >
> > This only looks at the data fork, while we'd need to use it for the
> > fork we plan to operate on. Looks like we'll need some bigger surgery
> > this area.
>
> Ah, that makes sense. Maybe just add a flags arg?
My plan was to replace the helper with two different ones that just
return the flag value, and the use ilock on the return value. I'll
have to see if there's enough places where we could lock for either
for that adding a variant that takes an "int whichfork" argument would
make sense.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2013-12-06 17:59 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-06 16:48 [PATCH 0/7] extent list locking fixes V2 Christoph Hellwig
2013-12-06 16:48 ` [PATCH 1/7] xfs: reinstate the ilock in xfs_readdir Christoph Hellwig
2013-12-06 16:53 ` Christoph Hellwig
2013-12-06 17:37 ` Ben Myers
2013-12-06 16:48 ` [PATCH 2/7] xfs: take the ilock around xfs_bmapi_read in xfs_zero_remaining_bytes Christoph Hellwig
2013-12-06 16:48 ` [PATCH 3/7] xfs: use xfs_ilock_map_shared in xfs_qm_dqtobp Christoph Hellwig
2013-12-06 16:48 ` [PATCH 4/7] xfs: use xfs_ilock_map_shared in xfs_qm_dqiterate Christoph Hellwig
2013-12-06 16:48 ` [PATCH 5/7] xfs: use xfs_ilock_map_shared in xfs_attr_get Christoph Hellwig
2013-12-06 16:48 ` [PATCH 6/7] xfs: use xfs_ilock_map_shared in xfs_attr_list_int Christoph Hellwig
2013-12-06 16:48 ` [PATCH 7/7] xfs: assert that we hold the ilock for extent map access Christoph Hellwig
2013-12-06 17:37 ` [PATCH 0/7] extent list locking fixes V2 Ben Myers
2013-12-06 17:54 ` Christoph Hellwig
2013-12-06 17:57 ` Ben Myers
2013-12-06 17:59 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox