https://tracker.ceph.com/https://tracker.ceph.com/favicon.ico2019-01-02T10:38:55ZCeph Linux kernel client - Bug #37713: Centos 7 kernel client overwriting files https://tracker.ceph.com/issues/37713?journal_id=1266682019-01-02T10:38:55ZJozef Kováčkovac@firma.zoznam.sk
<ul></ul><p>Works also fine on Centos 7 with elrepo kernel-ml kernel.</p> Linux kernel client - Bug #37713: Centos 7 kernel client overwriting files https://tracker.ceph.com/issues/37713?journal_id=1268492019-01-07T06:36:46ZZheng Yanukernel@gmail.com
<ul></ul><p>I think your kernel is too old. which does not handle append write correctly</p> Linux kernel client - Bug #37713: Centos 7 kernel client overwriting files https://tracker.ceph.com/issues/37713?journal_id=1321742019-03-15T18:12:31ZIlya Dryomov
<ul></ul><p>Hi Jozef,</p>
<p>Jozef Kováč wrote:</p>
<blockquote>
<p>This happen only with ceph kernel client on Centos 7.3~7.6 ...</p>
</blockquote>
<p>Are you saying that you observed the bug on 7.6? Which kernel version? I thought it was fixed earlier than that...</p>
<p>Jozef Kováč wrote:</p>
<blockquote>
<p>Works also fine on Centos 7 with elrepo kernel-ml kernel.</p>
</blockquote>
<p>Do you have the kernel version?</p> Linux kernel client - Bug #37713: Centos 7 kernel client overwriting files https://tracker.ceph.com/issues/37713?journal_id=1321752019-03-15T18:13:02ZIlya Dryomov
<ul><li><strong>Category</strong> set to <i>fs/ceph</i></li></ul> Linux kernel client - Bug #37713: Centos 7 kernel client overwriting files https://tracker.ceph.com/issues/37713?journal_id=1322982019-03-19T10:32:33ZJozef Kováčkovac@firma.zoznam.sk
<ul></ul><p>Ilya Dryomov wrote:</p>
<blockquote>
<p>Hi Jozef,</p>
<p>Jozef Kováč wrote:</p>
<blockquote>
<p>This happen only with ceph kernel client on Centos 7.3~7.6 ...</p>
</blockquote>
<p>Are you saying that you observed the bug on 7.6? Which kernel version? I thought it was fixed earlier than that...</p>
</blockquote>
<p>Problem still present with latest 3.10.0-957.5.1</p>
<blockquote>
<p>Jozef Kováč wrote:</p>
<blockquote>
<p>Works also fine on Centos 7 with elrepo kernel-ml kernel.</p>
</blockquote>
<p>Do you have the kernel version?</p>
</blockquote>
<p>elrepo ml line 4.19~4.20 works without problem.</p> Linux kernel client - Bug #37713: Centos 7 kernel client overwriting files https://tracker.ceph.com/issues/37713?journal_id=1323992019-03-21T08:36:19ZZheng Yanukernel@gmail.com
<ul></ul><p>It's an append write bug</p>
<pre>
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index 84d17ac3bc8e4..6e71323755db1 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -1487,6 +1487,7 @@ retry_snap:
(ci->i_ceph_flags & CEPH_I_ERROR_WRITE)) {
struct ceph_snap_context *snapc;
struct iov_iter i;
+ loff_t orig_ki_pos;
mutex_unlock(&inode->i_mutex);
spin_lock(&ci->i_ceph_lock);
@@ -1504,11 +1505,15 @@ retry_snap:
iov_iter_init(&i, iov, nr_segs, count, 0);
+ orig_ki_pos = iocb->ki_pos;
+ iocb->ki_pos = pos;
if (file->f_flags & O_DIRECT)
written = ceph_direct_read_write(iocb, &i, snapc,
&prealloc_cf);
else
written = ceph_sync_write(iocb, &i, snapc);
+ if (iocb->ki_pos == pos)
+ iocb->ki_pos = orig_ki_pos;
ceph_put_snap_context(snapc);
} else {
</pre> Linux kernel client - Bug #37713: Centos 7 kernel client overwriting files https://tracker.ceph.com/issues/37713?journal_id=1327792019-03-26T14:02:19ZDan van der Ster
<ul></ul><p>We are also affected in our HPC environment and have opened a ticket with Red Hat support.</p>
<p>We also opened an issue with CentOS (<a class="external" href="https://bugs.centos.org/view.php?id=15953">https://bugs.centos.org/view.php?id=15953</a>) and they have added this patch to the plus kernel. A build is available here:</p>
<p><a class="external" href="https://people.centos.org/toracat/kernel/7/plus/bug15953/">https://people.centos.org/toracat/kernel/7/plus/bug15953/</a></p>
<p>I confirmed this fixes the issue for us.</p> Linux kernel client - Bug #37713: Centos 7 kernel client overwriting files https://tracker.ceph.com/issues/37713?journal_id=1327812019-03-26T14:27:00ZJozef Kováčkovac@firma.zoznam.sk
<ul></ul><p>Dan van der Ster wrote:</p>
<blockquote>
<p>We are also affected in our HPC environment and have opened a ticket with Red Hat support.</p>
<p>We also opened an issue with CentOS (<a class="external" href="https://bugs.centos.org/view.php?id=15953">https://bugs.centos.org/view.php?id=15953</a>) and they have added this patch to the plus kernel. A build is available here:</p>
<p><a class="external" href="https://people.centos.org/toracat/kernel/7/plus/bug15953/">https://people.centos.org/toracat/kernel/7/plus/bug15953/</a></p>
<p>I confirmed this fixes the issue for us.</p>
</blockquote>
<p>fixed for me too.</p> Linux kernel client - Bug #37713: Centos 7 kernel client overwriting files https://tracker.ceph.com/issues/37713?journal_id=1387852019-06-14T02:34:06ZZheng Yanukernel@gmail.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Resolved</i></li></ul><p>Fixed in 7.5 (kernel-3.10.0-862.33.1.el7) and 7.6 (kernel-3.10.0-957.16.1.el7).</p>