From: ericm Date: Sat, 22 Nov 2003 07:09:16 +0000 (+0000) Subject: liblustre: forgot to commit last night: workaround O_WRONLY (b2282) X-Git-Tag: v1_7_0_51~2^7~196 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=d6443ba1d4a96045474f23daa191143232652eab;p=fs%2Flustre-release.git liblustre: forgot to commit last night: workaround O_WRONLY (b2282) --- diff --git a/lustre/liblustre/namei.c b/lustre/liblustre/namei.c index ad597d0..3ac2399 100644 --- a/lustre/liblustre/namei.c +++ b/lustre/liblustre/namei.c @@ -538,6 +538,18 @@ translate_lookup_intent(struct intent *intent, const char *path) it->it_flags = intent->int_arg2 ? *((int*)intent->int_arg2) : 0; + /* FIXME when use open(O_WRONLY) to create a file, MDS will + * delay the object creation on OST, thus no lsm will be returned. + * if call write() at the time, ll_extent_lock() will failed out + * because there will be no strip MD supplied. but O_RDWR will + * work fine. Here we forcely set the O_RDWR in this case, find + * a real fix later! FIXME + */ + if (it->it_flags & O_WRONLY) { + it->it_flags &= ~O_WRONLY; + it->it_flags |= O_RDWR; + } + if (intent->int_opmask & INT_OPEN) it->it_op |= IT_OPEN; /*