* [PATCH 0/3] regression fixes for 2.6.29
@ 2009-01-08 18:42 Christoph Hellwig
2009-01-08 18:42 ` [PATCH 1/3] xfs: fix compile of xfs_btree_readahead_lblock on m68k Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Christoph Hellwig @ 2009-01-08 18:42 UTC (permalink / raw)
To: xfs
These are the patches that fix regressions and should go into 2.6.29 ASAP.
The thid patch is also a candidate for 2.6.28-stable.
All the other patches I sent to the list over the previous week are also
small and useful enough fixes that I think they should still go into 2.6.29,
but it's not as urgent. I'll prepare another series for those over the
weekend.
--
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH 1/3] xfs: fix compile of xfs_btree_readahead_lblock on m68k 2009-01-08 18:42 [PATCH 0/3] regression fixes for 2.6.29 Christoph Hellwig @ 2009-01-08 18:42 ` Christoph Hellwig 2009-01-08 22:42 ` Dave Chinner 2009-01-08 18:42 ` [PATCH 2/3] xfs: truncate readdir offsets to signed 32 bit values Christoph Hellwig 2009-01-08 18:42 ` [PATCH 3/3] xfs: make xfs_ino_t an unsigned long long Christoph Hellwig 2 siblings, 1 reply; 8+ messages in thread From: Christoph Hellwig @ 2009-01-08 18:42 UTC (permalink / raw) To: xfs [-- Attachment #1: xfs-fix-xfs_btree_readahead_lblock-compile --] [-- Type: text/plain, Size: 1342 bytes --] Change the left/right variables to the proper always 64bit xfs_dfsbo_t type because otherwise compilation fails for Geert on m68k without CONFIG_LBD: | fs/xfs/xfs_btree.c: In function 'xfs_btree_readahead_lblock': | fs/xfs/xfs_btree.c:736: warning: comparison is always true due to limited range of data type | fs/xfs/xfs_btree.c:741: warning: comparison is always true due to limited range of data type Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Christoph Hellwig <hch@lst.de> Index: linux-2.6/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6.orig/fs/xfs/xfs_btree.c 2009-01-01 15:57:04.606547140 +0100 +++ linux-2.6/fs/xfs/xfs_btree.c 2009-01-01 15:57:24.780673454 +0100 @@ -730,8 +730,8 @@ xfs_btree_readahead_lblock( struct xfs_btree_block *block) { int rval = 0; - xfs_fsblock_t left = be64_to_cpu(block->bb_u.l.bb_leftsib); - xfs_fsblock_t right = be64_to_cpu(block->bb_u.l.bb_rightsib); + xfs_dfsbno_t left = be64_to_cpu(block->bb_u.l.bb_leftsib); + xfs_dfsbno_t right = be64_to_cpu(block->bb_u.l.bb_rightsib); if ((lr & XFS_BTCUR_LEFTRA) && left != NULLDFSBNO) { xfs_btree_reada_bufl(cur->bc_mp, left, 1); -- _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 1/3] xfs: fix compile of xfs_btree_readahead_lblock on m68k 2009-01-08 18:42 ` [PATCH 1/3] xfs: fix compile of xfs_btree_readahead_lblock on m68k Christoph Hellwig @ 2009-01-08 22:42 ` Dave Chinner 0 siblings, 0 replies; 8+ messages in thread From: Dave Chinner @ 2009-01-08 22:42 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs On Thu, Jan 08, 2009 at 01:42:23PM -0500, Christoph Hellwig wrote: > Change the left/right variables to the proper always 64bit xfs_dfsbo_t > type because otherwise compilation fails for Geert on m68k without > CONFIG_LBD: > > | fs/xfs/xfs_btree.c: In function 'xfs_btree_readahead_lblock': > | fs/xfs/xfs_btree.c:736: warning: comparison is always true due to limited range of data type > | fs/xfs/xfs_btree.c:741: warning: comparison is always true due to limited range of data type > > > Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> > Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <david@fromorbit.com> -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 2/3] xfs: truncate readdir offsets to signed 32 bit values 2009-01-08 18:42 [PATCH 0/3] regression fixes for 2.6.29 Christoph Hellwig 2009-01-08 18:42 ` [PATCH 1/3] xfs: fix compile of xfs_btree_readahead_lblock on m68k Christoph Hellwig @ 2009-01-08 18:42 ` Christoph Hellwig 2009-01-08 19:00 ` Christoph Hellwig 2009-01-08 18:42 ` [PATCH 3/3] xfs: make xfs_ino_t an unsigned long long Christoph Hellwig 2 siblings, 1 reply; 8+ messages in thread From: Christoph Hellwig @ 2009-01-08 18:42 UTC (permalink / raw) To: xfs [-- Attachment #1: xfs-dir-d_off --] [-- Type: text/plain, Size: 4555 bytes --] John Stanley reported EOVERFLOW errors in readdir from his self-build glibc. I traced this down to glibc enabling d_off overflow checks in one of the about five million different getdents implementations. In 2.6.28 Dave Woodhouse moved our readdir double buffering required for NFS4 readdirplus into nfsd and at that point we lost the capping of the directory offsets to 32 bit signed values. Johns glibc used getdents64 to even implement readdir for normal 32 bit offset dirents, and failed with EOVERFLOW only if this happens on the first dirent in a getdents call. I managed to come up with a testcase that uses raw getdents and does the EOVERFLOW check manually. We always hit it with our last entry due to the special end of directory marker. The patch below is a dumb version of just putting back the masking, to make sure we have the same behavior as in 2.6.27 and earlier. I will work on a better and cleaner fix for 2.6.30. Reported-by: John Stanley <jpsinthemix@verizon.net> Tested-by: John Stanley <jpsinthemix@verizon.net> Signed-off-by: Christoph Hellwig <hch@lst.de> Index: xfs/fs/xfs/xfs_dir2_block.c =================================================================== --- xfs.orig/fs/xfs/xfs_dir2_block.c 2008-12-30 09:53:55.766493777 +0100 +++ xfs/fs/xfs/xfs_dir2_block.c 2008-12-30 16:38:02.098618118 +0100 @@ -517,9 +517,9 @@ xfs_dir2_block_getdents( /* * If it didn't fit, set the final offset to here & return. */ - if (filldir(dirent, dep->name, dep->namelen, cook, + if (filldir(dirent, dep->name, dep->namelen, cook & 0x7fffffff, ino, DT_UNKNOWN)) { - *offset = cook; + *offset = cook & 0x7fffffff; xfs_da_brelse(NULL, bp); return 0; } @@ -529,7 +529,8 @@ xfs_dir2_block_getdents( * Reached the end of the block. * Set the offset to a non-existent block 1 and return. */ - *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0); + *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0) & + 0x7fffffff; xfs_da_brelse(NULL, bp); return 0; } Index: xfs/fs/xfs/xfs_dir2_leaf.c =================================================================== --- xfs.orig/fs/xfs/xfs_dir2_leaf.c 2008-12-30 09:53:55.848493237 +0100 +++ xfs/fs/xfs/xfs_dir2_leaf.c 2008-12-30 16:50:02.376618389 +0100 @@ -1092,8 +1092,8 @@ xfs_dir2_leaf_getdents( * Won't fit. Return to caller. */ if (filldir(dirent, dep->name, dep->namelen, - xfs_dir2_byte_to_dataptr(mp, curoff), - ino, DT_UNKNOWN)) + XFS_TRUNC_DIR_OFF(xfs_dir2_byte_to_dataptr(mp, curoff)), + ino, DT_UNKNOWN)) break; /* @@ -1108,9 +1108,9 @@ xfs_dir2_leaf_getdents( * All done. Set output offset value to current offset. */ if (curoff > xfs_dir2_dataptr_to_byte(mp, XFS_DIR2_MAX_DATAPTR)) - *offset = XFS_DIR2_MAX_DATAPTR; + *offset = XFS_DIR2_MAX_DATAPTR & 0x7fffffff; else - *offset = xfs_dir2_byte_to_dataptr(mp, curoff); + *offset = xfs_dir2_byte_to_dataptr(mp, curoff) & 0x7fffffff; kmem_free(map); if (bp) xfs_da_brelse(NULL, bp); Index: xfs/fs/xfs/xfs_dir2_sf.c =================================================================== --- xfs.orig/fs/xfs/xfs_dir2_sf.c 2008-12-30 09:53:55.854493790 +0100 +++ xfs/fs/xfs/xfs_dir2_sf.c 2008-12-30 16:48:05.022493945 +0100 @@ -790,15 +790,16 @@ xfs_dir2_sf_getdents( ino += mp->m_inoadd; #endif - if (filldir(dirent, sfep->name, sfep->namelen, - off, ino, DT_UNKNOWN)) { + off = XFS_TRUNC_DIR_OFF(off); + if (filldir(dirent, sfep->name, sfep->namelen, off, ino, DT_UNKNOWN)) { *offset = off; return 0; } sfep = xfs_dir2_sf_nextentry(sfp, sfep); } - *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0); + off = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0); + *offset = XFS_TRUNC_DIR_OFF(off); return 0; } Index: xfs/fs/xfs/xfs_dir2.h =================================================================== --- xfs.orig/fs/xfs/xfs_dir2.h 2008-12-30 16:40:33.803618191 +0100 +++ xfs/fs/xfs/xfs_dir2.h 2008-12-30 16:44:07.635493682 +0100 @@ -103,4 +103,11 @@ extern int xfs_dir2_shrink_inode(struct extern int xfs_dir_cilookup_result(struct xfs_da_args *args, const char *name, int len); + +/* + * We need to make sure all offset in directories fit into 32 bit values, + * or glibc will haunt us with EOVERFLOW errors. + */ +#define XFS_TRUNC_DIR_OFF(off) (off & 0x7fffffff) + #endif /* __XFS_DIR2_H__ */ -- _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] xfs: truncate readdir offsets to signed 32 bit values 2009-01-08 18:42 ` [PATCH 2/3] xfs: truncate readdir offsets to signed 32 bit values Christoph Hellwig @ 2009-01-08 19:00 ` Christoph Hellwig 2009-01-08 22:43 ` Dave Chinner 0 siblings, 1 reply; 8+ messages in thread From: Christoph Hellwig @ 2009-01-08 19:00 UTC (permalink / raw) To: xfs On Thu, Jan 08, 2009 at 01:42:24PM -0500, Christoph Hellwig wrote: > John Stanley reported EOVERFLOW errors in readdir from his self-build > glibc. I traced this down to glibc enabling d_off overflow checks > in one of the about five million different getdents implementations. > > In 2.6.28 Dave Woodhouse moved our readdir double buffering required > for NFS4 readdirplus into nfsd and at that point we lost the capping > of the directory offsets to 32 bit signed values. Johns glibc used > getdents64 to even implement readdir for normal 32 bit offset dirents, > and failed with EOVERFLOW only if this happens on the first dirent in > a getdents call. I managed to come up with a testcase that uses > raw getdents and does the EOVERFLOW check manually. We always hit > it with our last entry due to the special end of directory marker. > > The patch below is a dumb version of just putting back the masking, > to make sure we have the same behavior as in 2.6.27 and earlier. > > I will work on a better and cleaner fix for 2.6.30. > > Reported-by: John Stanley <jpsinthemix@verizon.net> > Tested-by: John Stanley <jpsinthemix@verizon.net> > Signed-off-by: Christoph Hellwig <hch@lst.de> As arkem noticed I should not have sent out some half-mangled version but the first crude patch. Here it is: Index: xfs/fs/xfs/xfs_dir2_block.c =================================================================== --- xfs.orig/fs/xfs/xfs_dir2_block.c 2008-12-29 21:25:29.680613664 +0100 +++ xfs/fs/xfs/xfs_dir2_block.c 2008-12-29 21:29:57.341627581 +0100 @@ -517,9 +517,9 @@ xfs_dir2_block_getdents( /* * If it didn't fit, set the final offset to here & return. */ - if (filldir(dirent, dep->name, dep->namelen, cook, + if (filldir(dirent, dep->name, dep->namelen, cook & 0x7fffffff, ino, DT_UNKNOWN)) { - *offset = cook; + *offset = cook & 0x7fffffff; xfs_da_brelse(NULL, bp); return 0; } @@ -529,7 +529,8 @@ xfs_dir2_block_getdents( * Reached the end of the block. * Set the offset to a non-existent block 1 and return. */ - *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0); + *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0) & + 0x7fffffff; xfs_da_brelse(NULL, bp); return 0; } Index: xfs/fs/xfs/xfs_dir2_leaf.c =================================================================== --- xfs.orig/fs/xfs/xfs_dir2_leaf.c 2008-12-29 21:25:13.899613482 +0100 +++ xfs/fs/xfs/xfs_dir2_leaf.c 2008-12-29 21:29:36.125616996 +0100 @@ -1092,7 +1092,7 @@ xfs_dir2_leaf_getdents( * Won't fit. Return to caller. */ if (filldir(dirent, dep->name, dep->namelen, - xfs_dir2_byte_to_dataptr(mp, curoff), + xfs_dir2_byte_to_dataptr(mp, curoff) & 0x7fffffff, ino, DT_UNKNOWN)) break; @@ -1108,9 +1108,9 @@ xfs_dir2_leaf_getdents( * All done. Set output offset value to current offset. */ if (curoff > xfs_dir2_dataptr_to_byte(mp, XFS_DIR2_MAX_DATAPTR)) - *offset = XFS_DIR2_MAX_DATAPTR; + *offset = XFS_DIR2_MAX_DATAPTR & 0x7fffffff; else - *offset = xfs_dir2_byte_to_dataptr(mp, curoff); + *offset = xfs_dir2_byte_to_dataptr(mp, curoff) & 0x7fffffff; kmem_free(map); if (bp) xfs_da_brelse(NULL, bp); Index: xfs/fs/xfs/xfs_dir2_sf.c =================================================================== --- xfs.orig/fs/xfs/xfs_dir2_sf.c 2008-12-29 21:23:55.174613820 +0100 +++ xfs/fs/xfs/xfs_dir2_sf.c 2008-12-29 21:29:00.721617384 +0100 @@ -752,8 +752,8 @@ xfs_dir2_sf_getdents( #if XFS_BIG_INUMS ino += mp->m_inoadd; #endif - if (filldir(dirent, ".", 1, dot_offset, ino, DT_DIR)) { - *offset = dot_offset; + if (filldir(dirent, ".", 1, dot_offset & 0x7fffffff, ino, DT_DIR)) { + *offset = dot_offset & 0x7fffffff; return 0; } } @@ -766,8 +766,8 @@ xfs_dir2_sf_getdents( #if XFS_BIG_INUMS ino += mp->m_inoadd; #endif - if (filldir(dirent, "..", 2, dotdot_offset, ino, DT_DIR)) { - *offset = dotdot_offset; + if (filldir(dirent, "..", 2, dotdot_offset & 0x7fffffff, ino, DT_DIR)) { + *offset = dotdot_offset & 0x7fffffff; return 0; } } @@ -791,14 +791,15 @@ xfs_dir2_sf_getdents( #endif if (filldir(dirent, sfep->name, sfep->namelen, - off, ino, DT_UNKNOWN)) { - *offset = off; + off & 0x7fffffff, ino, DT_UNKNOWN)) { + *offset = off & 0x7fffffff; return 0; } sfep = xfs_dir2_sf_nextentry(sfp, sfep); } - *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0); + *offset = xfs_dir2_db_off_to_dataptr(mp, mp->m_dirdatablk + 1, 0) & + 0x7fffffff; return 0; } _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 2/3] xfs: truncate readdir offsets to signed 32 bit values 2009-01-08 19:00 ` Christoph Hellwig @ 2009-01-08 22:43 ` Dave Chinner 0 siblings, 0 replies; 8+ messages in thread From: Dave Chinner @ 2009-01-08 22:43 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs On Thu, Jan 08, 2009 at 02:00:00PM -0500, Christoph Hellwig wrote: > On Thu, Jan 08, 2009 at 01:42:24PM -0500, Christoph Hellwig wrote: > > John Stanley reported EOVERFLOW errors in readdir from his self-build > > glibc. I traced this down to glibc enabling d_off overflow checks > > in one of the about five million different getdents implementations. > > > > In 2.6.28 Dave Woodhouse moved our readdir double buffering required > > for NFS4 readdirplus into nfsd and at that point we lost the capping > > of the directory offsets to 32 bit signed values. Johns glibc used > > getdents64 to even implement readdir for normal 32 bit offset dirents, > > and failed with EOVERFLOW only if this happens on the first dirent in > > a getdents call. I managed to come up with a testcase that uses > > raw getdents and does the EOVERFLOW check manually. We always hit > > it with our last entry due to the special end of directory marker. > > > > The patch below is a dumb version of just putting back the masking, > > to make sure we have the same behavior as in 2.6.27 and earlier. > > > > I will work on a better and cleaner fix for 2.6.30. > > > > Reported-by: John Stanley <jpsinthemix@verizon.net> > > Tested-by: John Stanley <jpsinthemix@verizon.net> > > Signed-off-by: Christoph Hellwig <hch@lst.de> > > As arkem noticed I should not have sent out some half-mangled version > but the first crude patch. Here it is: Reviewed-by: Dave Chinner <david@fromorbit.com> -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 3/3] xfs: make xfs_ino_t an unsigned long long 2009-01-08 18:42 [PATCH 0/3] regression fixes for 2.6.29 Christoph Hellwig 2009-01-08 18:42 ` [PATCH 1/3] xfs: fix compile of xfs_btree_readahead_lblock on m68k Christoph Hellwig 2009-01-08 18:42 ` [PATCH 2/3] xfs: truncate readdir offsets to signed 32 bit values Christoph Hellwig @ 2009-01-08 18:42 ` Christoph Hellwig 2009-01-08 22:44 ` Dave Chinner 2 siblings, 1 reply; 8+ messages in thread From: Christoph Hellwig @ 2009-01-08 18:42 UTC (permalink / raw) To: xfs [-- Attachment #1: xfs-ino-printing-fixes --] [-- Type: text/plain, Size: 1135 bytes --] Currently xfs_ino_t is defined as a u64 which can either be an unsigned long long or on some 64 bit platforms and unsigned long. Just making it and unsigned long long mean's it's still always 64 bits wide, but we don't need to resort to cases to print it. Fixes a warning regression on 64 bit powerpc in current git. Signed-off-by: Christoph Hellwig <hch@lst.de> Index: xfs/fs/xfs/xfs_types.h =================================================================== --- xfs.orig/fs/xfs/xfs_types.h 2009-01-01 11:53:17.321546620 +0100 +++ xfs/fs/xfs/xfs_types.h 2009-01-05 20:30:04.794549213 +0100 @@ -45,7 +45,7 @@ typedef __uint32_t prid_t; /* project typedef __uint32_t inst_t; /* an instruction */ typedef __s64 xfs_off_t; /* <file offset> type */ -typedef __u64 xfs_ino_t; /* <inode> type */ +typedef unsigned long long xfs_ino_t; /* <inode> type */ typedef __s64 xfs_daddr_t; /* <disk address> type */ typedef char * xfs_caddr_t; /* <core address> type */ typedef __u32 xfs_dev_t; -- _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 3/3] xfs: make xfs_ino_t an unsigned long long 2009-01-08 18:42 ` [PATCH 3/3] xfs: make xfs_ino_t an unsigned long long Christoph Hellwig @ 2009-01-08 22:44 ` Dave Chinner 0 siblings, 0 replies; 8+ messages in thread From: Dave Chinner @ 2009-01-08 22:44 UTC (permalink / raw) To: Christoph Hellwig; +Cc: xfs On Thu, Jan 08, 2009 at 01:42:25PM -0500, Christoph Hellwig wrote: > Currently xfs_ino_t is defined as a u64 which can either be an unsigned > long long or on some 64 bit platforms and unsigned long. Just making > it and unsigned long long mean's it's still always 64 bits wide, but we > don't need to resort to cases to print it. > > Fixes a warning regression on 64 bit powerpc in current git. > > > Signed-off-by: Christoph Hellwig <hch@lst.de> > > Index: xfs/fs/xfs/xfs_types.h > =================================================================== > --- xfs.orig/fs/xfs/xfs_types.h 2009-01-01 11:53:17.321546620 +0100 > +++ xfs/fs/xfs/xfs_types.h 2009-01-05 20:30:04.794549213 +0100 > @@ -45,7 +45,7 @@ typedef __uint32_t prid_t; /* project > typedef __uint32_t inst_t; /* an instruction */ > > typedef __s64 xfs_off_t; /* <file offset> type */ > -typedef __u64 xfs_ino_t; /* <inode> type */ > +typedef unsigned long long xfs_ino_t; /* <inode> type */ > typedef __s64 xfs_daddr_t; /* <disk address> type */ > typedef char * xfs_caddr_t; /* <core address> type */ > typedef __u32 xfs_dev_t; Reviewed-by: Dave Chinner <david@fromorbit.com> -- Dave Chinner david@fromorbit.com _______________________________________________ xfs mailing list xfs@oss.sgi.com http://oss.sgi.com/mailman/listinfo/xfs ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-01-08 22:49 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-01-08 18:42 [PATCH 0/3] regression fixes for 2.6.29 Christoph Hellwig 2009-01-08 18:42 ` [PATCH 1/3] xfs: fix compile of xfs_btree_readahead_lblock on m68k Christoph Hellwig 2009-01-08 22:42 ` Dave Chinner 2009-01-08 18:42 ` [PATCH 2/3] xfs: truncate readdir offsets to signed 32 bit values Christoph Hellwig 2009-01-08 19:00 ` Christoph Hellwig 2009-01-08 22:43 ` Dave Chinner 2009-01-08 18:42 ` [PATCH 3/3] xfs: make xfs_ino_t an unsigned long long Christoph Hellwig 2009-01-08 22:44 ` Dave Chinner
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox