Skip to contentSkip to conversation

vi, multiple users

DISCUSSION Yehuda Sadeh Weinraub 2 participants 4 messages Dec 30, 2009 – Dec 31, 2009 Ceph client

lore
Share & tools
lore
#0 lore raw

There still is a problem with vi and multiple users. E.g., the following scenario fails:

client1: cd /mnt; cp ~/foo .
client2: head foo
client1: vi foo; <change something, write, exit>
client2: head foo

now foo appears to be corrupted.

I guess it is likely that is still related to the truncation reporting that was found yesterday, I'll try to verify that.

Yehuda

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev

_______________________________________________
Ceph-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ceph-devel

#1 lore raw
Quoted 8 lines · Yehuda Sadeh Weinraub

There still is a problem with vi and multiple users. E.g., the following scenario fails:

client1: cd /mnt; cp ~/foo .
client2: head foo
client1: vi foo; <change something, write, exit>
client2: head foo

Quoted 4 lines

now foo appears to be corrupted.

I guess it is likely that is still related to the truncation reporting that was found yesterday, I'll try to verify that.

BTW the corruption I was seeing was that the second page was written to the first page (or something very close to that, possibly shifted by a byte?).

sage

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev

#2 lore raw
Quoted 5 lines · Sage Weil

BTW the corruption I was seeing was that the second page was written to the first page (or something very close to that, possibly shifted by a byte?).

I see the last page being written over the first one, also shifted by one byte. The rest of the pages are just garbage. Could be just a bug in the sync write related functions, wasn't able to isolate it yet.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev

_______________________________________________
Ceph-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ceph-devel

#3 lore raw
Quoted 5 lines · Yehuda Sadeh Weinraub
Quoted 1 line · Sage Weil
Quoted 9 lines
Quoted 4 lines

BTW the corruption I was seeing was that the second page was written to the first page (or something very close to that, possibly shifted by a byte?).

I see the last page being written over the first one, also shifted by one byte. The rest of the pages are just garbage. Could be just a bug in the sync write related functions, wasn't able to isolate it yet.

Yes, the problem was in the copy_user_to_page_vector() helper function, which was broken for the case where more than one page is involved. This has only affected us in the synchronous write case, so it only happened with multiple users. Just pushed a fix.

There is another issue I'm not sure about, which we should look at when we audit the truncation code, and is whether we also need to update the truncation size in the sync_write case, e.g., something along the line of:

fs/ceph/file.c +0 -0
index 2d88c80..910f970 100644
@@ -631,6 +631,10 @@ static ssize_t ceph_sync_write(struct file *file, const

char __user *data,

         */
 more:
        len = left;

+
+ if (ci->i_truncate_size < pos + len)
+ ci->i_truncate_size = pos + len;
+
req = ceph_osdc_new_request(&client->osdc, &ci->i_layout,
ceph_vino(inode), pos, &len, CEPH_OSD_OP_WRITE, flags,

Yehuda

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev

_______________________________________________
Ceph-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ceph-devel