+ inode-diet-eliminate-i_blksize-and-use-a-per-superblock-default-xfs-fix.patch added to -mm tree

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

 



The patch titled

     rescue large xfs preferred iosize from the inode diet  patch

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

     inode-diet-eliminate-i_blksize-and-use-a-per-superblock-default-xfs-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: rescue large xfs preferred iosize from the inode diet  patch
From: Eric Sandeen <sandeen@xxxxxxxxxxx>

The inode diet patch in -mm unhooked xfs_preferred_iosize from the stat call:

 --- a/fs/xfs/linux-2.6/xfs_vnode.c
 +++ b/fs/xfs/linux-2.6/xfs_vnode.c
 @@ -122,7 +122,6 @@ vn_revalidate_core(
        inode->i_blocks     = vap->va_nblocks;
        inode->i_mtime      = vap->va_mtime;
        inode->i_ctime      = vap->va_ctime;
-       inode->i_blksize    = vap->va_blocksize;
        if (vap->va_xflags & XFS_XFLAG_IMMUTABLE)

This in turn breaks the largeio mount option for xfs:

  largeio/nolargeio
        If "nolargeio" is specified, the optimal I/O reported in
        st_blksize by stat(2) will be as small as possible to allow user
        applications to avoid inefficient read/modify/write I/O.
        If "largeio" specified, a filesystem that has a "swidth" specified
        will return the "swidth" value (in bytes) in st_blksize. If the
        filesystem does not have a "swidth" specified but does specify
        an "allocsize" then "allocsize" (in bytes) will be returned
        instead.
        If neither of these two options are specified, then filesystem
        will behave as if "nolargeio" was specified.

and the (undocumented?) allocsize mount option as well.

For a filesystem like this with sunit/swidth specified,

meta-data=/dev/sda1              isize=512    agcount=32, agsize=7625840 blks
         =                       sectsz=512   attr=0
data     =                       bsize=4096   blocks=244026880, imaxpct=25
         =                       sunit=16     swidth=16 blks, unwritten=1
naming   =version 2              bsize=4096
log      =internal               bsize=4096   blocks=32768, version=1
         =                       sectsz=512   sunit=0 blks
realtime =none                   extsz=65536  blocks=0, rtextents=0

stat on a stock FC6 kernel w/ the largeio mount option returns only the page size:

[root@link-07]# mount -o largeio /dev/sda1 /mnt/test/
[root@link-07]# stat -c %o /mnt/test/foo
4096

with the following patch, it does what it should:

[root@link-07]# mount -o largeio /dev/sda1 /mnt/test/
[root@link-07]# stat -c %o /mnt/test/foo
65536

same goes for filesystems w/o sunit,swidth but with the allocsize mount option.

stock:
[root@link-07]# mount -o largeio,allocsize=32768 /dev/sda1 /mnt/test/
[root@link-07]# stat -c %o /mnt/test/foo
4096

w/ patch:
[root@link-07# mount -o largeio,allocsize=32768 /dev/sda1 /mnt/test/
[root@link-07]# stat -c %o /mnt/test/foo
32768

Signed-off-by: Eric Sandeen <sandeen@xxxxxxxxxxx>
Cc: David Chinner <dgc@xxxxxxx>
Cc: Timothy Shimmin <tes@xxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 fs/xfs/linux-2.6/xfs_iops.c |    6 +++++-
 xfs/linux-2.6/xfs_vnode.c   |    0 
 2 files changed, 5 insertions(+), 1 deletion(-)

diff -puN fs/xfs/linux-2.6/xfs_iops.c~inode-diet-eliminate-i_blksize-and-use-a-per-superblock-default-xfs-fix fs/xfs/linux-2.6/xfs_iops.c
--- a/fs/xfs/linux-2.6/xfs_iops.c~inode-diet-eliminate-i_blksize-and-use-a-per-superblock-default-xfs-fix
+++ a/fs/xfs/linux-2.6/xfs_iops.c
@@ -623,12 +623,16 @@ xfs_vn_getattr(
 {
 	struct inode	*inode = dentry->d_inode;
 	bhv_vnode_t	*vp = vn_from_inode(inode);
+	xfs_inode_t	*ip;
 	int		error = 0;
 
 	if (unlikely(vp->v_flag & VMODIFIED))
 		error = vn_revalidate(vp);
-	if (!error)
+	if (!error) {
 		generic_fillattr(inode, stat);
+		ip = xfs_vtoi(vp);
+		stat->blksize = xfs_preferred_iosize(ip->i_mount);
+	}
 	return -error;
 }
 
diff -puN fs/xfs/linux-2.6/xfs_vnode.c~inode-diet-eliminate-i_blksize-and-use-a-per-superblock-default-xfs-fix fs/xfs/linux-2.6/xfs_vnode.c
_

Patches currently in -mm which might be from sandeen@xxxxxxxxxxx are

inode-diet-eliminate-i_blksize-and-use-a-per-superblock-default-xfs-fix.patch
mount-udf-udf_part_flag_read_only-partitions-with-ms_rdonly.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