Subject: + ocfs2-adjust-minlen-with-discard_granularity-in-the-fitrim-ioctl.patch added to -mm tree To: jeff.liu@xxxxxxxxxx,jlbec@xxxxxxxxxxxx,mfasheh@xxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Tue, 10 Dec 2013 16:18:05 -0800 The patch titled Subject: ocfs2: adjust minlen with discard_granularity in the FITRIM ioctl has been added to the -mm tree. Its filename is ocfs2-adjust-minlen-with-discard_granularity-in-the-fitrim-ioctl.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/ocfs2-adjust-minlen-with-discard_granularity-in-the-fitrim-ioctl.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/ocfs2-adjust-minlen-with-discard_granularity-in-the-fitrim-ioctl.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: Jie Liu <jeff.liu@xxxxxxxxxx> Subject: ocfs2: adjust minlen with discard_granularity in the FITRIM ioctl Adjust minlen with discard_granularity for FITRIM ioctl(2) if the given minimum size in bytes is less than it because, discard granularity is used to tell us that the minimum size of extent that can be discarded by the storage device. This is inspired by ext4 commit 5c2ed62fd4 ("ext4: Adjust minlen with discard_granularity in the FITRIM ioctl") from Lukas Czerner. Signed-off-by: Jie Liu <jeff.liu@xxxxxxxxxx> Cc: Mark Fasheh <mfasheh@xxxxxxxx> Cc: Joel Becker <jlbec@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/ocfs2/ioctl.c | 2 ++ 1 file changed, 2 insertions(+) diff -puN fs/ocfs2/ioctl.c~ocfs2-adjust-minlen-with-discard_granularity-in-the-fitrim-ioctl fs/ocfs2/ioctl.c --- a/fs/ocfs2/ioctl.c~ocfs2-adjust-minlen-with-discard_granularity-in-the-fitrim-ioctl +++ a/fs/ocfs2/ioctl.c @@ -980,6 +980,8 @@ long ocfs2_ioctl(struct file *filp, unsi if (copy_from_user(&range, argp, sizeof(range))) return -EFAULT; + range.minlen = max_t(u64, q->limits.discard_granularity, + range.minlen); ret = ocfs2_trim_fs(sb, &range); if (ret < 0) return ret; _ Patches currently in -mm which might be from jeff.liu@xxxxxxxxxx are ocfs2-return-eopnotsupp-if-the-device-does-not-support-discard.patch ocfs2-return-einval-if-the-given-range-to-discard-is-less-than-block-size.patch ocfs2-adjust-minlen-with-discard_granularity-in-the-fitrim-ioctl.patch ocfs2-should-call-ocfs2_journal_access_di-before-ocfs2_delete_entry-in-ocfs2_orphan_del.patch ocfs2-llseek-requires-ocfs2-inode-lock-for-the-file-in-seek_end.patch ocfs2-fix-issue-that-ocfs2_setattr-does-not-deal-with-new_i_size==i_size.patch binfmt_elfc-use-get_random_int-to-fix-entropy-depleting.patch linux-next.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