+ fat-fix-data-past-eof-resulting-from-fsx-testsuite-v2.patch added to -mm tree

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

 



The patch titled
     Subject: fat-fix-data-past-eof-resulting-from-fsx-testsuite-v2
has been added to the -mm tree.  Its filename is
     fat-fix-data-past-eof-resulting-from-fsx-testsuite-v2.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/fat-fix-data-past-eof-resulting-from-fsx-testsuite-v2.patch
		echo and later at
		echo  http://ozlabs.org/~akpm/mmotm/broken-out/fat-fix-data-past-eof-resulting-from-fsx-testsuite-v2.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>
Subject: fat-fix-data-past-eof-resulting-from-fsx-testsuite-v2

Signed-off-by: Namjae Jeon <namjae.jeon@xxxxxxxxxxx>
Signed-off-by: Amit Sahrawat <a.sahrawat@xxxxxxxxxxx>
Acked-by: OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/fat/file.c  |    5 +++--
 fs/fat/inode.c |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff -puN fs/fat/file.c~fat-fix-data-past-eof-resulting-from-fsx-testsuite-v2 fs/fat/file.c
--- a/fs/fat/file.c~fat-fix-data-past-eof-resulting-from-fsx-testsuite-v2
+++ a/fs/fat/file.c
@@ -508,11 +508,12 @@ int fat_setattr(struct dentry *dentry, s
 	}
 
 	if (attr->ia_valid & ATTR_SIZE) {
+		error = fat_block_truncate_page(inode, attr->ia_size);
+		if (error)
+			goto out;
 		down_write(&MSDOS_I(inode)->truncate_lock);
 		truncate_setsize(inode, attr->ia_size);
 		fat_truncate_blocks(inode, attr->ia_size);
-		if (inode->i_size & (inode->i_sb->s_blocksize - 1))
-			fat_block_truncate_page(inode, inode->i_size);
 		up_write(&MSDOS_I(inode)->truncate_lock);
 	}
 
diff -puN fs/fat/inode.c~fat-fix-data-past-eof-resulting-from-fsx-testsuite-v2 fs/fat/inode.c
--- a/fs/fat/inode.c~fat-fix-data-past-eof-resulting-from-fsx-testsuite-v2
+++ a/fs/fat/inode.c
@@ -333,7 +333,7 @@ static sector_t _fat_bmap(struct address
 /*
  * fat_block_truncate_page() zeroes out a mapping from file offset `from'
  * up to the end of the block which corresponds to `from'.
- * This is required during truncate to physically zero out the tail end
+ * This is required during truncate to physically zeroout the tail end
  * of that block so it doesn't yield old data if the file is later grown.
  * Also, avoid causing failure from fsx for cases of "data past EOF"
  */
_

Patches currently in -mm which might be from namjae.jeon@xxxxxxxxxxx are

fat-add-fat_fallocate-operation.patch
fat-skip-cluster-allocation-on-fallocated-region.patch
fat-permit-to-return-phy-block-number-by-fibmap-in-fallocated-region.patch
documentation-filesystems-vfattxt-update-the-limitation-for-fat-fallocate.patch
fat-fix-data-past-eof-resulting-from-fsx-testsuite.patch
fat-fix-data-past-eof-resulting-from-fsx-testsuite-v2.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